-------------------------------------------------------------------------------------------------------------------------------------

ubuntu基础

目录

Debian与Ubuntu简介

Debian简介

  • 是从 1993 年由 Ian Murdock(伊恩·默多克) 发起的,受到当时 Linux 与GNU 的⿎舞,⽬标是成为⼀个公开的发⾏版,经过⼆⼗⼏年的迭代更新Debian 从⼀个⼩型紧密的⾃由软件骇客(hacker)⼩组,逐渐成⻓成今⽇庞⼤且运作良好的开发者与⽤⼾社群,Debian 的名字是由 Debian 的创始⼈ Ian Murdock (伊恩·默多克) 和他的爱妻 Debra(黛布拉) 两⼈的名字组合⽽成的。

  • Debian 是由⼤约⼀千个分布在世界各地的开发者⽆偿地利⽤他们的业余时间开发的,⽽这些开发者实际上⼤部分都没⻅过⾯,彼此之间的通讯⼤多是通过电⼦邮件(lists.debian.org 上的邮件列表)和 IRC(irc.debian.org上的 #debian 频道)来完成的,⽬前Debian 提供59000多个软件包的维护与更新。

  • Debian官⽹: https://www.debian.org/

  • 官⽅镜像地址: https://www.debian.org/mirror/list

  • 清华⼤学下载地址:https://mirrors.tuna.tsinghua.edu.cn/debian-cd/10.1.0-live/amd64/iso-hybrid/

Ubuntu简介

  • Ubuntu(友帮拓、优般图、乌班图)早期是⼀个开源的GNU/Linux操作系统,Ubuntu 是基于Debian GNU/Linux,⽀持x86、amd64(即x64)和ppc架构,由全球化的专业开发团队(Canonical Ltd)打造的,其名称来⾃⾮洲南部祖鲁语或豪萨语的“ubuntu”⼀词,类似儒家“仁爱”的思想,意思是“⼈性”、“我的存在是因为⼤家的存在”,是⾮洲传统的⼀种价值观,Ubuntu基于Debian发⾏版和GNOME桌⾯环境,⽽从11.04版起,Ubuntu发⾏版放弃了Gnome桌⾯环境,改为Unity,与Debian的不同在于它每6个⽉会发布⼀个新版本,Ubuntu的⽬标在于为⼀般⽤⼾提供⼀个最新的、同时⼜相当稳定的主要由⾃由软件构建⽽成的操作系统,Ubuntu具有庞⼤的社区⼒量,⽤⼾可以⽅便地从社区获得帮助,Ubuntu对GNU/Linux的普及特别是桌⾯普及作出了巨⼤贡献,由此使更多⼈共享开源的成果与精彩。

    • Canonical公司是⼀个私营公司,由南⾮的企业家⻢克·沙特尔沃思(MarkShuttleworth)创建,主要为了促进开源软件项⽬,Canonical在⻢恩岛登记注册,其雇员分布在世界各地,其主要办事处在伦敦,在蒙特利尔也有办事处,Canonical公司⽀持并创建了⼏个项⽬,主要都是⾃由/开源软件(FOSS)或是⼀些旨在改善⾃由软件开发者和贡献者的⼯具。http://www.techweb.com.cn/business/2013-08-20/1318187.shtml #ubuntu公司⽬前并未实现盈利
  • Ubuntu是各种公有云上最受欢迎的操作系统,这是因为Ubuntu与各⼤云运营商密切合作,针对云服务商的基础架构优化内核和系统,加快安全更新速度,并最⼤限度降低⽤⼾默认需要的⽹络或存储成本。

  • 中⽂官⽹: https://cn.ubuntu.com/

  • 英⽂官⽹: https://ubuntu.com/download

Ubuntu历史发⾏版本

  • Ubuntu 没有像其它软件⼀样有 1.0 版本,是因为其第⼀个版本是发布于2004 年,所以Ubuntu的⽣⽇是2004年的10⽉20⽇。

  • ubuntu的版本号有个固定的特征,其使⽤⼀个形容词和⼀个动物名称组成,并且形容词和名词的⾸字⺟都是⼀致的,Ubuntu版本的命名规则是根据正式版发布的年⽉命名,Ubuntu 16.04 也就意味着 2016年4⽉发布的Ubuntu,研发⼈员与⽤⼾可从版本号码就知道正式发布的时间。

  • 每两年的 4 ⽉份,都会推出⼀个⻓期⽀持版本(LTS),其⽀持期⻓达五年,⽽⾮ LTS 版本的⽀持期通常只有半年。

名称格式是一个形容词一个动物,这样组成
版本 别名 发布⽇期
4.10 Warty Warthog(⻓疣的疣猪) 2004年10⽉20⽇
5.04 Hoary Hedgehog(灰⽩的刺猬) 2005年4⽉8⽇
5.10 Breezy Badger(活泼的獾) 2005年10⽉13⽇
6.06(LTS) Dapper Drake(整洁的公鸭) 2006年6⽉1⽇
6.10 Edgy Eft(急躁的⽔蜥) 2006年10⽉6⽇
7.04 Feisty Fawn(坏脾⽓的⼩⿅) 2007年4⽉19⽇
7.10 Gutsy Gibbon(勇敢的⻓臂猿) 2007年10⽉18⽇
8.04(LTS) Hardy Heron(耐寒的苍鹭) 2008年4⽉24⽇
8.10 Intrepid Ibex (勇敢的野⼭⽺) 2008年10⽉30⽇
9.04 Jaunty Jackalope(得意洋洋的怀俄明野兔) 2009年4⽉23⽇
9.10 Karmic Koala(幸运的考拉) 2009年10⽉29⽇
10.04(LTS) Lucid Lynx(清醒的猞猁) 2010年4⽉29⽇
11.10 Oneiric Ocelot(梦幻的豹猫) 2010年10⽉13⽇
11.04 Natty Narwhal(敏捷的独⻆鲸) 2011年4⽉28⽇
12.04(LTS) Precise Pangolin(精准的穿⼭甲) 2012年的4⽉26⽇
12.10 Quantal Quetzal(量⼦的绿咬鹃) 2012年的10⽉20⽇
13.04 Raring Ringtail(铆⾜了劲的猫熊) 2013年4⽉25⽇
13.10 Saucy Salamander(活泼的蝾螈) 2013年10⽉17⽇
14.04(LTS) Trusty Tahr (可靠的塔尔⽺) 2014年4⽉18⽇
14.10 Utopic Unicorn(乌托邦独⻆兽) 2014年10⽉23⽇
15.04 Vivid Vervet (活泼的⼩猴) 2015年4⽉
15.10 Wily Werewolf (狡猾的狼⼈) 2015年10⽉
16.04(LTS) Xenial Xerus (好客的地松⿏) 2016-04-21
16.10 Yakkety Yak(喋喋不休的牦⽜) 2016-10-13
17.04 Zesty Zapus(热情的美洲林跳⿏) 2017-04-13
17.10 Artful Aardvark(巧妙的⼟豚) 2017-10-19
18.04(LTS) Bionic Beaver(仿⽣的海狸) 2018-04-26
18.10 Cosmic Cuttlefish(宇宙的墨⻥) 2018-10-18
19.04 Disco Dingo(迪斯可的澳洲野⽝) 2019-04-18
19.10 Eoan Ermine(短尾的⻩⿏狼) 2019-10-17
20.04 LTS Focal Fossa(焦点窝) 2020-04-23
20.10 Groovy Gorilla(时髦的大猩猩) 2020-10-22
21.04 Hirsute Hippo(多毛河马) 2021-04-22

Ubuntu使⽤场景

  • Ubuntu系统在物联⽹、桌⾯系统、云环境、服务器系统与容器有⼴泛的使⽤场景

Ubuntu 桌⾯系统

  • Ubuntu作为个⼈电脑既快速⼜安全、开源、免费,有数以千计的应⽤程序可供选择。从⼯作学习、到娱乐游戏,⽆所不能。(服务器系统和桌面系统内核是一样的,只不过安装的包不一样,桌面系统会安装一些浏览器,办公软件等等,而服务器系统就是个命令行,我们的服务器系统都是最小化安装,只安装一些基本的内核加vim这样的命令,因为安装的越多,对资源的消耗越多,而且最主要是他可能会有BUG,导致系统崩溃)

Ubuntu桌⾯系统简介

基于Ubuntu的优麒麟

  • Canonical,⼯业和信息化部软件与集成电路促进中⼼(CSIP)以及国防科学技术⼤学(NUDT)携⼿打造,⽬前,开发团队正在与开源社区合作打造Ubuntu的核⼼功能,以更好地适应中国⽤⼾,除了Ubuntu软件中⼼推出的本⼟化版本以外,优麒麟还带最常⽤的中⽂程序。(对于Ubuntu做的二次开发发行版)

基于Ubuntu的Elementary OS

  • Elementary OS系统是⼀款基于Ubuntu精⼼打磨美化的桌⾯ Linux 发⾏版,号称“最漂亮的Linux系统”,它最早是Ubuntu的⼀个美化主题项⽬,后来太受欢迎演变成了独⽴的发⾏版,Elementary OS 由设计师主导开发,⻛格与macOS 相似,它借鉴了ChromeOS的菜单设计,系统核⼼依然是 Ubuntu并完全兼容所有Ubuntu软件包,elementary OS从界⾯外观到系统设计都很精美,视觉效果很好!(号称最漂亮的linux系统,但是好多软件都非常的轻量级,为了节省资源,好多功能都没有)

基于Ubuntu的其他分⽀

  • 除了标准Ubuntu版本之外,Ubuntu官⽅还有⼏⼤主要分⽀,分别是Edubuntu、Kubuntu、Lubuntu、Mythbuntu、Ubuntu MATE,UbuntuGNOME、Ubuntu Kylin、Ubuntu Studio和Xubunt

    • Edubuntu是Ubuntu的教育发⾏版,专注于学校(教育)的需求,是由Ubuntu社区和K12-LTSP社区合作开发的,适合⼉童、学⽣、教师使⽤的基础发⾏版,其内置了⼤量适合教学的应⽤软件和游戏。

    • Kubuntu是使⽤KDE桌⾯管理器取代GNOME桌⾯管理器作为其默认的桌⾯管理器的版本。Kubuntu的推出,为喜爱KDE桌⾯环境的使⽤者的安装和使⽤带来了很⼤的便利。

    • Lubuntu是⼀个后起之秀,以轻量级桌⾯环境LXDE替代Ubuntu默认的Unity。由于LXDE是⼀个轻量级桌⾯环境,所以Lubuntu所需的计算机资源很少,⼗分适合追求简洁或速度,以及还在使⽤⽼旧硬件的朋友选⽤。

    • Mythbuntu是⼀个⽤来实现媒体中⼼的Ubuntu发⾏版本,其核⼼组件是MythTV,所以Mythbuntu可以视为Ubuntu和MythTV的结合体。

    • Ubuntu GNOME是采⽤GNOME3作为Ubuntu默认桌⾯管理器的发⾏版本。由于Ubuntu的默认桌⾯环境是Unity,为了满⾜Linux⽤⼾的不同需求和使⽤习惯,Ubuntu GNOME项⽬应运⽽⽣。

    • Ubuntu Kylin(优麒麟)是⼀个专⻔为中⽂⽤⼾定制的Ubuntu版本,预置了⼤量中国⽤⼾熟悉的应⽤,是开箱即⽤的Ubuntu官⽅中国定制版本,适合中国⽤⼾使⽤。

    • Ubuntu Studio则是--个为专业多媒体制作⽽打造的Ubuntu版本,可以编辑和处理⾳频、视频和图形图像等多媒体⽂件,对于多媒体专业⼈⼠⽽⾔,是⼀个⻥和熊掌兼得的好选择。

    • Xubuntu采⽤了⼩巧和⾼效的Xfce作为桌⾯环境,界⾯简约,类似于GNOME2,功能全⾯,系统资源消耗较⼩,是追求速度和低配置计算机⽤⼾的福⾳,同时也为⽼旧计算机提供了发挥余热的机会

基于debain的deepin

  • deepin:基于debain的发⾏版,Deepin原名Linux Deepin、deepin os、深度系统、深度操作系统,在2014年4⽉改名Deepin,由武汉深之度科技有限公司开发,被誉为“最美国产操作系统”,其以桌⾯应⽤为主的开源GNU/Linux操作系统,⽀持笔记本、台式机和⼀体机。

    • 深度操作系统(deepin)是中国第⼀个具备国际影响⼒的Linux发⾏版本,截⽌⾄2019年7⽉25⽇,深度操作系统⽀持33种语⾔,⽤⼾遍布除了南极洲的其它六⼤洲,深度桌⾯环境(deepinDDE)和⼤量的应⽤软件被移植到了包括Fedora、Ubuntu、Arch等⼗余个国际Linux发⾏版和社区,在开源操作系统统计⽹站DistroWatch上,deepin⻓期位于世界前⼗。

其他Linux发⾏版

  • 统计不同linux发行版排名地址: http://www.distrowatch.org/index.php?dataspan=2018

  • Manjaro是⼀款基于Arch Linux对⽤⼾友好的Linux发⾏版,使⽤pacman管理安装包。(pacman据说安装包特别特别多,他好像是linux最全的发行版,你能想到的,想不到的应用程序他都有,centos有的他有,centos没有的他还有,ubuntu有的他也有,ubuntu没有的他还有)

  • MX Linux是基于Debian稳定分⽀的⾯向桌⾯的Linux发⾏版本。

  • elementary OS是⼀个基于ubuntu的衍⽣版本,早期是⼀个ubuntu主题,后来衍⽣为⼀个专⻔的发⾏版。

Ubuntu与云环境

Ubuntu与私有云

  • ubuntu在私有云环境⼤量在openstack、容器与kubernetes环境使⽤。

Ubuntu与公有云

  • Ubuntu是各种公有云上最受欢迎的操作系统,这是因为我们与各⼤云运营商密切合作,针对他们的基础架构优化内核和系统,加快安全更新速度,并最⼤限度降低⽤⼾默认需要的⽹络或存储成本。

Ubuntu server系统

  • Ubuntu Server 可让您的公共或私有数据中⼼在经济和技术上(技术上表示主要内核比较新)都具有出⾊的可扩展性。⽆论是部署 OpenStack 云、Hadoop 集群还是 50,000 个节点的⼤型渲染场(渲染就是图像处理),Ubuntu Server 都能提供性价⽐最佳的横向扩展能⼒。

    • LTS版本可以跨版本升级,比如18.04 LTS直接升级到20.04 LTS

Ubuntu Server 18.04 LTS 新增功能

  • 地址:https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes/

  • 由 Canonical 提供到 2023 年的⻓期⽀持

  • 可在所有主流架构上运⾏ - x86、x86-64、ARM v7、ARM64、POWER8 和IBM s390x (LinuxONE)占⽤空间更⼩、启动速度更快的全新 ubuntu-minimal 映像

  • 通过 chrony 实现快速准确的时间同步 新的默认服务器安装程序 ISO 带来全新界⾯和更快的安装速度⽀持 ZFS(⾮常适合服务器和容器的新⼀代卷管理/⽂件系统)

  • LXD 3.0 - 提供包括集群、Qos 和资源控制(CPU、内存、块 I/O/ 图形处理器和存储配额)等在内的多种 Linux 容器

  • 更新了 LXD (v3.0)、DPDK (v17.11.1)、Postgresql (v10.3)、Libvirt (v4.0)、NGINX (v1.13)、Qemu (v2.11.1)、Docker(v17.03)、Puppet (v4.10)、MySQL (v5.7)、PHP (v7.2) 等

  • 安装 snap 来⽀持简单的应⽤程序安装和发布管理

  • Linux 4.15 内核

  • 获得 AWS、Microsoft Azure、Joyent、IBM、Google CloudPlatform 和 Rackspace 客⼾机认证通过 netplan.io 轻松配置⽹络连接

Ubuntu Server 19.10 LTS 新增功能

Ubuntu Server 20.04 LTS新功能

  • 由Canonical提供5年的支持至2025年,ESM扩展支持至2030年。

  • 可在主流平台上运行——x86-64,ARM v7,ARM64,POWER8,POWER9,IBM s390x(LinuxONE),且将引入对RISC-V的基础支持。

  • 为AWS和Azure所定制的云镜像——Ubuntu Pro,包含了安全加固,认证,内核热补丁(Kernel livepatch)以及其他功能。

  • Ubuntu Server Live安装助手现在在联网的情况下自动更新到最新版本并获取最新安全漏洞补丁。提供自动安装的基础支持。

  • SSH支持2次身份认证(2FA)

  • WireGuard®——具有现代加密技术且简单易用的创新VPN技术

  • AppArmor3使系统更安全

  • 更为灵活的bootloader,可容许故障磁盘启动。

  • 在Microsoft Azure上对IPv6的支持更好

  • 支持Amazon Web Services (AWS)最新的Instance Metadata Service(IMDSv2)

  • 长期支持的Linux 5.4内核支持最新的硬件,且包含最新的安全更新。

  • 软件版本更新:QEMU(v4.2), libvirt(v6.0), PHP(v7.4),Ruby(v2.7),GCC(V9.3),Python(v3.8),MySQL(v8.0),NGINX(v1.17)

Ubuntu与容器环境

  • Ubuntu是容器的⾸选平台,从LXD到Kubernetes再到Docker,Canonical与⾏业领先的公司合作,提供全⽅位的技术和服务,帮助⽤⼾在公有云、私有云和混合云或裸机云上⼤规模运⾏容器。

企业级Docker

  • 与Docker Inc.(docker公司)密切合作,在Ubuntu上提供商业⽀持的集成式Docker引擎。

  • Docker引擎的映像以snap包(snap一种包管理工具,可以在一个服务器上安装多个不同的环境,做环境隔离的)的形式发布,并会⾃动进⾏事务性更新。

  • Canonical为CS Docker引擎提供1级和2级技术⽀持,Docker Inc.则负责3级⽀持。(这就类似于一线,二线和三线,1级是最简单的可能是一些重启或者一些简单操作都能解决,如果解决不了就找二线,二线就是一些高级工程师,如果二线解决不了,那么就找三线(原厂)提供代码级的支持)

Canonical的Kubernetes发⾏版

  • 内置弹性扩展能⼒:

    • Canonical的Kubernetes简单易⽤,⽽且本⾝具有弹性。
  • 规模化成本效益:

    • Canonical的Kubernetes使⽤Juju进⾏建模,并拥有管理持久性集群所需的所有操作脚本和⼯具,包括升级和弹性扩展。
  • 随时可⽤的分析功能:

    • 可轻松与Prometheus集成以进⾏监控,与Ceph集成以进⾏存储,以及与Elastic Stack(包括Kibana)集成以进⾏分析和可视化。

Ubuntu镜像下载

系统镜像版本区别

  • 地址:https://packages.ubuntu.com/search?lang=zh-cn&arch=any&keywords=libfuse-dev

  • 服务器版安装光盘 (Server Install CD, ubuntu-10.04-server-*.iso) - 这张光盘可以让您安装 Ubuntu 在计算机上作服务器之用。其安装接口只有文字模式。服务器版特别有提供 Sparc 版支援 Sun UltraSparc 平台。这亦是本文要讲及的安装光盘。

  • 文字接口安装光盘 (Alternate Install CD, ubuntu-10.04-alternate-*.iso) - 这张光盘可以让您作一些特别的安装。包括建立预先设定的 OEM 系统、设定自动安装、没有网络情况上升级旧的 Ubuntu 系统和把 GRUB 安装在 MBR 以外的位置等。

  • 桌面版光盘 (Desktop CD, ubuntu-10.04-desktop-*.iso) - 这张光盘主要用作试用和安装桌面之用。它可以让您无须安装下真接在光盘上启动和试用 Ubuntu 桌面,并在满意时简易地安装 Ubuntu 桌面

  • 安装/Live DVD (Install/Live DVD) - 集以上多种安装及 Live 系统于一身。

  • 带live,ISO镜像提供不安装就可以试⽤系统的功能

    • ubuntu-18.04.3-live-server-amd64.iso
  • 不带live,不可⽤试⽤,但是可以直接进⾏系统安装

    • ubuntu-18.04.3-server-amd64.iso

不同CPU指令集的ISO镜像

CPU架构 安装包标识 备注 镜像名称⽰例
x86 i386 32位,server版16.0之后已不再⽀持32位 ubuntu-16.04.6-desktop-i386.iso
x86-64 amd64 64位(因为64位cpu是adm发明的,所以叫adm64) ubuntu-18.04.3-server-amd64.iso
ARM v7 ARM64 arm平台 ubuntu-18.04.3-server-arm64.iso
IBM s390x s390x IBM System z ubuntu-18.04.3-server-s390x.iso
POWER >PPC64el PowerPC ubuntu-18.04.3-server-ppc64el.iso
preinstalled-server-arm64+raspi3 预安装的树莓派系列 ubuntu-18.04.3-preinstalled-server-arm64+raspi3.img.xz:

Ubuntu Server 版安装及使⽤

Ubuntu Server18.04 TLS版本安装

  • ubuntu 18.04服务器版本安装

选择安装语⾔

  • 语言选择English(英语),服务器系统语言一般不选中文的
F1 Help                     (F1帮助)
F2 Language                (F2语言)
F3 Keymap                  (F3按键图)
F4 Modes                   (F4模式)
F5 Accessibility            (F5辅助功能)
F6 Other Options            (F6其他选项)

安装界⾯传递内核参数

  • 如果想修改内核参数,在选项安装语言页面按ESC返回到安装页面,按F6,包括修改网卡名称,也可以在这里改,或者在安装完系统后修改

按ESC(返回)或者ENTER(回车)

# Install Ubuntu server                             (安装Ubuntu服务器)
# Install Ubuntu server with the HHE kernel         (使用HHE内核安装Ubuntu服务器)
# Install MAAS Region Controller                    (安装MAAS区域控制器)
# Install MAAS Rack Controller                      (安装MAAS机架控制器)
# Check disc for defects                            (检查光盘是否有缺陷)
# Test memory                                       (测试内存)
# Boot from first hard disk                         (从第一个硬盘启动,(启动硬盘中的操作系统))
# Rescue a broken system                            (抢救损坏的系统)

# F1 Help                     (F1帮助)
# F2 Language                (F2语言),选择接口语言。这个会影响安装出来系统的接口语言
# F3 Keymap                  (F3按键图),设定键盘排列。一般中港台澳新的使用者都不用改变此设定。
# F4 Modes                   (F4模式),设定启动模式,可以选择下列模式:
## 正式模式 (Normal)
## 安装最小型系统 (Install a minimal system)
## 安装最小型虚拟机器 (Install a minimal virtual machine)

# F5 Accessibility            (F5辅助功能), 选择开启一些无障碍辅助,方便伤健人仕使用安装系统。
## 无 (None) - 无任何无障碍辅助
## 高对比 (High Contrast) - 接口采用高对比布景对题,画面主用采用黑白二色,令视力有少许障碍的人仕较易观看萤幕。
## 放大镜 (Magnifier) - 提供萤幕放大镜,可以放大萤幕上任何一处内容,令视力有少许障碍的人仕较易观看萤幕。
## 萤幕阅读器 (Screen Reader) - 可以读出萤幕上显示的文字 ,令视力有障碍的人仕可以知道萤幕的内容。
## 盲人点字终端机 (Braille Terminal) - 可以把萤幕上显示的文字输出至盲人点字终端机。
## 键盘修饰键 (Keyboard Modifiers) - 容许使用者分开逐个按下组合键中的每个按键来按该组合键,令手部有少许障碍的人仕较操作系统。
## 萤幕键盘 (On-Screen Keyboard) - 在萤幕提供虚拟键盘。

# F6 Other Options            (F6其他选项),手动为 Linux 核心加上其他启动选项。
## Expert mode                (专家模式)
## acpi=off                   (禁用了你的高级配置和电源接口,如果必须添加acpi =off来让ubuntu成功启动,这意味着你计算机上的ACPI(acpi:高级配置电源接口,是处理电源管理的标准,较老的系统可能不支持ACPI full,所以有时它有助于给内核一个提示。" acpi=off ")与这个版本的ubuntu不兼容)
## noapic                      (此选项关闭了在一些新主板上存在的高级可编程中断控制器。它在一些旧的硬件上会引发一些问题。)
## nolapic                     (此选项关闭了在单处理器内核上的本地APIC)
## edd=on
## nodmraid
## nomodeset
## Free softuare only

### Boot Options reseed/ubuntu-server.seed vga=788initrd=/install/initrd.gz quiet --- net.infnames=0 biosdevname=0 按ESC推出上面的小菜单,在这里就可以传递net.infnames=0 biosdevname=0内核参数了,修改网卡的名称,添加好后直接按ENTER(回车),就可以直接安装了

选择安装过程语⾔

  • 依然语言选择English(英语),服务器系统语言一般不选中文的,然后按ENTER(回车)

地区设置(选择时区香港)

The selected location will be used to set your time zone and also for example to help select the system locale. Normally this should be the country where you live.(所选位置将用于设置您的时区,例如还可以帮助选择系统区域设置。 通常,这应该是您居住的国家/地区。)

This is a shortlist of locations based on the language you selected. Choose "other" it your location is not listed.(这是根据您选择的语言显示的位置的简短列表。 如果您的位置未列出,请选择“其他”。)

Country, territory or area(国家,地区或区域:)
Antigua and Barbuda         (安提瓜和巴布达)
Australia                   (澳大利亚)
Botswana                    (博茨瓦纳)
Canada                      (加拿大)
Hong Kong                   (香港)
India                       (印度)
Ireland                     (爱尔兰)
Israel                      (以色列)
Neu Zealand                 (纽西兰)
Nigeria                     (尼日利亚)
Philippines                 (菲律宾)
Seychelles                  (塞舌尔)
Singapore                   (新加坡)
South Africa                (南非)
United Kingdom              (英国)
United states               (美国)
Zambia                      (赞比亚)
Zimbabue                    (津巴布韦)
other                        (其他)

键盘选择(选择No不检测键盘)

  • 不进⾏探测,⼿动设置
You can try to have your keyboard layout detected by pressing a series of keys. If you do not want to do this, you will be able to select your keyboard layout from a list.(您可以尝试通过按一系列键来检测键盘布局。 如果您不想这样做,则可以从列表中选择键盘布局。)

Detect keyboard layout?(检测键盘布局?)

<Go Back>(<返回>)                     <Yes>  <No>(<是> <否>)

选择键盘

  • 选美式键盘
The layout of keyboards varies per country, with some countries having multiple common layouts. Please select the country of origin for the keyboard of this computer(键盘的布局因国家/地区而异,某些国家/地区具有多种通用布局。 请选择此计算机键盘的原产国)

Country of origin for the keyboard:(键盘的原产国:)

English (US)(英文(美国))

键盘确认

Please select the layout matching the keyboard for this machine.(请选择与本机键盘匹配的布局。)

Keyboard layout:(键盘布局:)

English (US)(英文(美国))

配置主机名

Please enter the hostname for this system.(请输入该系统的主机名。)

The hostname is a single word that identifies your system to the netuork. If you don“t nou uhat your hostname should be, consult your netuork administrator. If you are setting up your oun home netuork, you can make something up here.(主机名是一个单词,用于向网络标识您的系统。 如果不知道您的主机名,请咨询您的网络管理员。 如果您要建立自己的家庭网络,则可以在这里进行一些设置。)

Hostname:(主机名:默认是ubuntu)


<Go Back>    <Cont inue>(<返回> <继续>)

创建新的普通系统⽤⼾

  • ubuntu创建完之后必须使用普通用户登录,他的选项相对比较严格一些,centos可以使用root直接登录
A user account will be created for you to use instead of the root account for non-adoninistrat ive activities.(将创建一个用户帐户供您使用,而不是用于非附加活动的根帐户。)

Please enter the real name of this user. This information will be used for instance as default origin for emails sent by this user as well as any program which displays or use the user“s real name, Your full name is a reasonable choice.(请输入该用户的真实姓名。 例如,此信息将用作该用户发送的电子邮件以及显示或使用该用户真实姓名的任何程序的默认来源。您的全名是一个合理的选择。)

Full name for the new user:(新用户的全名:)

<Go Back>    <Cont inue>(<返回> <继续>)

确认新账⼾名称

Select a username for the new account. Your first name is a reasonable choice. The username should start with a louer-case letter, which can be followed by any combination of numbers and more lower-case letters.(选择新帐户的用户名。 您的名字是一个合理的选择。 用户名应以大写字母开头,其后可以是数字和更多小写字母的任意组合。)

Username for your account:(您帐户的用户名:)

<Go Back>    <Cont inue>(<返回> <继续>)

设置⽤⼾密码

A good passuord will contain a mixture of letters, numbers and punctuation and should be changed at regular intervals.


choose a passuord for the new user:(选择新用户的密码:)

Shou Password in Clean(清除密码)


<Go Back>    <Cont inue>(<返回> <继续>)

确认账⼾密码

Please enter the same user password again to verify you have tuped it correct ly. Re-enter password to verify:(请再次输入相同的用户密码,以确认您输入的密码正确无误。 重新输入密码以验证:)

Shou Password in clear(清除密码)

<Go Back>    <Cont inue>(<返回> <继续>)

确认使⽤密码

  • 他觉得密码太简单,yes确定依然使用这个密码
You entered a password that consists of less than eight characters, which is considered too weak. You should choose a stronger password.(您输入的密码少于八个字符,被认为太弱。 您应该选择一个更强的密码)

Use weak password?(使用弱密码?)

<Go Back>(<返回>)                     <Yes>  <No>(<是> <否>)

确认时区

Based on your present physical location, your time zone is Asia/Harbin.(根据您当前的地理位置,您所在的时区是亚洲/哈尔滨。)

If this is not correct, you may select from a full list of time zones instead.(如果这不正确,则可以从时区的完整列表中进行选择。)

Is this time zone correct?(这个时区正确吗?)

<Go Back>(<返回>)                     <Yes>  <No>(<是> <否>)

⼿动分区(选择Manual(手动的),回车继续)

The installer can guide you through partitioning a disk (using different standard schemes) or, if you prefer, you can do it manually. with guided partitioning you will still have a chance later to review and customise the results.(安装程序可以指导您对磁盘进行分区(使用不同的标准方案),或者,如果您愿意,也可以手动进行。 使用分区指导,以后您仍然有机会查看和自定义结果。)

If you choose guided partitioning for an entire disk, you will next be asked which disk should be used(如果您选择整个磁盘的引导分区,则接下来将询问您应使用哪个磁盘)

Partitioning method:(分区方法:)

Guided - use entire disk(指导-使用整个磁盘)
Guided - use entire disk and set up LVM(指导-使用整个磁盘并设置LVM)
Guided - use entire disk and set up encrypted LVM(指导-使用整个磁盘并设置加密的LVM)
Manual(手动的)

<Go Back>(<返回>)

选择磁盘

This is an overview of your current ly configured partitions and mount points. Select a partition to modify its settings (file system, mount point, etc。),a free space to create partitions, or a device to initialize its partition table.(这是您当前配置好的分区和挂载点的概述。 选择一个分区以修改其设置(文件系统,挂载点等。),创建分区的可用空间,或初始化其分区表的设备。)

Guided partitioning(引导分区)
Configure iscsI volumes(配置iscsI卷)

SCS133 (0,0,0) (sda)-42.9 GB VMuare, VMuare Virtual s (这是你的磁盘,空间大小42.9G,选择这个,回车)

Undo changes to partitions(撤消对分区的更改)
Finish partitioning and write changes to disk(完成分区并将更改写入磁盘)

确认使⽤磁盘

You have selected an entire device to partition. If you proceed with creating a new partition table on the device, then all current partitions will be removed.(您已选择要分区的整个设备。 如果继续在设备上创建新的分区表,则将删除所有当前分区。)

Note that you will be able to undo this operation later if you wish.(请注意,以后您将可以撤消此操作。)

Create new empty partition table on this device?(在此设备上创建新的空分区表?)

<Go Back>(<返回>)                     <Yes>  <No>(<是> <否>)

对磁盘分区

This is an overvieu of your currently configured partitions and mount points. Select a partition to modify its settings (file system, mount point, etc。), a free space to create partitions, or a device to initialize its partition table.(这是对当前配置的分区和挂载点的概述。 选择一个分区以修改其设置(文件系统,挂载点等。),创建分区的可用空间或用于初始化其分区表的设备。)

Guided partitioning(引导分区)
Configure softuare RAID(配置软件RAID)
Configure the Logical Volume Manager(配置逻辑卷管理器)
configure encrypted volumes(配置加密的卷)
Configure ISCSI volumes(配置ISCSI卷)

SCS133 (0,0,0) (sda)42.9 GB VHuare, WHuare virtual s(SCS133(0,0,0)(sda)42.9 GB VHuare,WHuare虚拟s)
pri/log 42.9 GB FREE SPACE(pri / log 42.9 GB可用空间)              (创建的新的分区,选择这个)

Undo changes to partitions(撤消对分区的更改)
Finish partitioning and write changes to disk(完成分区并将更改写入磁盘)

创建新分区

How to use this free space:(如何使用此可用空间:)

Create a new partition(创建一个新分区)        (选择这个,创建一个新分区)
Automat ically partition the free space (自动划分可用空间)
Show Cylinder/Head/Sector information(显示(Heads)、柱面(Cylinder)、扇区(Sector)信息)

<Go Back>(<返回>) 

指定分区⼤⼩

The maximum size for this partition is 42.9 GB.(该分区的最大大小为42.9 GB。)

Hint: "max" can be used as a shortcut to specify the maximum size,or enter a percentage (e.g. "20%") to use that percentage of the maximum size.(提示:“ max”可用作指定最大尺寸的快捷方式,或输入一个百分比(例如“ 20%”)以使用最大尺寸的百分比。)

New partition size:(新分区大小:)

<Go Back>    <Cont inue>(<返回> <继续>)

选择分区类型

  • 分区类型为主分区
Type for the new partition:(输入新分区:)

Primary(基本分区)         (选择这个为主分区)
Logical(逻辑分区)

<Go Back>(<返回>)

分区完成

  • ⽂件系统类型可以选择ext4/xfs/等
You are editing partition #1 of SCS133 (0,0,0) (sda). No existing file system was detected in this partition.(您正在编辑SCS133(0,0,0)(sda)的分区#1,在此分区中未检测到现有文件系统。)

Partition settings:(分区设置:)

Use as: Ext4 journaling file system(用作:Ext4日记文件系统)(这里可以选择文件系统,默认是ext4,如果没有一般的需求,那么ext4就够了,如果你的磁盘空间特别大,超过了ext4的上限了,那么就选择xfs)

Mount point:           /                (挂载点:/)
Mount options:         defaults         (挂载选项:默认)
Label:                 none             (标签:无)
Reserved blocks:       5%               (预留块:5%)
Tupical usage:         standard         (名词用法:标准)
Bootabie flag:         off              (开机自检标志:关闭)

Delete the pantition                    (删除内容)
Done setting up the partition           (完成设置分区)        (选择这个,完成设置分区)

完成分区并写⼊数据

This is an overvieu of your currently configured partitions and mount points. Select a partition to modify its settings (file system, mount point, etc。), a free space to create partitions, or a device to initialize its partition table(这是对当前配置的分区和挂载点的概述。 选择一个分区以修改其设置(文件系统,挂载点等。),创建分区的可用空间或用于初始化其分区表的设备。)

Guided partitioning(引导分区)
Configure software RAID(配置软件RAID)
Configure the Logical Volume Manager(配置逻辑卷管理器)
Configure encrupted volumes(配置加密卷)
Configure iscsI volumes(配置iscsI卷)
SCS133 (0.0.0) (sda) -42.9 GB VMware. VMware virtual s(SCS133(0.0.0)(sda)-42.9 GB VMware。 VMware虚拟机)
#1 grimary 42.9 GB     f    ext4        /

Undo changes to partitions(撤消对分区的更改)
Finish partitioning and write changes to disk(完成分区并将更改写入磁盘)   (选择这个把更改写入磁盘)

确认写⼊磁盘

  • creat ing swap file...(正在创建交换文件...)
    • 他会默认创建swap分区,进入系统后可以选择禁用掉
If you continue, the changes listed belou will be written to the disks. Dtherwise, you will be able to make further changes manually.(如果继续,则下面列出的更改将被写入磁盘。 否则,您将能够手动进行进一步的更改。)

The partition tables of the following devices are changed:(更改了以下设备的分区表:)
SCS133 (0,0,0) (sda)

The following partitions are going to be formatted:(以下分区将被格式化:)
partition #1 of SsT33 (0.0.0) (sda) as ext4

Write the changes to disks?(将更改写入磁盘?)
<Yes  <NO>(<是> <否>)

是否使⽤代理(不使用,留空,点击继续)

If you need to use a HTTP proxy to access the outside world, enter the proxy information here. otherwise, leave this blank.(如果您需要使用HTTP代理访问外界,请在此处输入代理信息。 否则,请留空。)

The proxy information should be given in the standard form of (代理信息应以以下形式提供:)"http:// [[user] [:pass]@]host [:port]/“

HTTP proxy information (blank for none):(HTTP代理信息(无  空白))

<Go Back>  <Cont inue>  (<返回> <继续>)

系统安装过程中

Retrieving file 40 of 63 (8min 54s remaining)(检索文件40(共63)(剩余8分54秒))


<Cancel>(<取消>)

是否⾃动更新(选择不自动更新)

Applying updates on a frequent basis is an important part of keeping your system secure.(应用经常更新是确保系统安全的重要部分。)

By default, updates need to be applied manually using package management tools.(默认情况下,需要使用程序包管理工具手动应用更新。)

Alternatively, you can choose to have this system automatically dounload and install security updates, or you can choose to manage this system over the web as part of a group of systems using Canonical“s Landscape service(或者,您可以选择让该系统自动卸载并安装安全更新,也可以选择使用Canonical的Landscape服务将其作为一组系统的一部分通过Web进行管理)

Hou do you want to manage upgrades on this system?(您要管理此系统上的升级吗?)

No automatic updates(不自动更新)
Install security updates automatically(自动安装安全更新)
Manage system with landscape(使用 Landscape 管理系统)

选择安装组件(把openSSH安装上,按空格勾选上)

  • 不安装ssh,后面远程都远程不了,还要单独安装
At the moment, only the core of the system is installed. To tune the system to your needs, you can choose to install one or more of the following predefined collections of software.(目前,仅安装了系统核心。 要根据需要调整系统,可以选择安装以下预定义的软件集合中的一个或多个。)

Choose software to install:(选择要安装的软件:)
[  ] DNS server(DNS服务器)
[  ] LAMP server(LAMP服务器)
[  ] Mail server(邮件服务器)
[  ] PostgreSQL database(PostgreSQL数据库)
[  ] Print server(打印服务器)
[  ] Samba file server(Samba文件服务器)
[ x ] OpenSSH server(OpenSSH服务器)

<Continue>    (<继续>)

可能发生程序安装报错信息

Installation step failed(安装步骤失败)

An installation step failed. You can try to run the failing item again from the menu, or skip it and choose something else. The failing step is: Select and install software(安装步骤失败。 您可以尝试从菜单中再次运行失败的项目,或者跳过它并选择其他内容。 失败的步骤是:选择并安装软件)

<Continue>(<继续>)

写⼊grub引导

It seems that this new installation is the only operating system on this computer. If so,it should be safe to install the GRUB boot loader to the master boot record of your first hard drive(似乎此新安装是此计算机上的唯一操作系统。 如果是这样,将GRUB引导加载程序安装到第一个硬盘的主引导记录中应该是安全的。)

Warning: If the installer failed to detect another operating system that is present on your computer, modifying the master boot record will make that operating system temporarily unbootable, though GRUB can be manually configured later to boot it.(警告:如果安装程序无法检测到计算机上存在的另一个操作系统,则可以在以后手动配置GRUB来启动主引导记录,从而使该主引导记录暂时无法引导。)

Install the GRUB boot loader to the master boot record?(将GRUB引导加载程序安装到主引导记录中吗?)
<Go Back>                                <Yes>   <No>   (<返回>         <是> <否>)

确认重启服务器

  • 重新服务器后就安装成功了,输入账号密码登录

Installation complete(安装完成)

Installation is complete, so it is time to boot into your new system. Make sure to remove the installation media (CD-ROM, floppies), so that you boot into the new system rather than restart ing the installation.(安装完成,因此是时候启动新系统了。 确保删除安装介质(CD-ROM,软盘),以便引导至新系统,而不是重新启动安装。)

<GO Back>                               <Cont inue>  (<返回上一页>     <继续>)

有可能出现的内核报错信息

  • 更换镜像,或者重新下载镜像
Unable to install the selected kernel.(无法安装选定的内核)

An error was returned while trying to install the kernel into the target system.(尝试将内核安装到目标系统时返回错误。)

Kernel package: “linux-generic(内核包:“ linux-generic)

Check /var/log/syslog or see virtual console 4 for the details.(检查/var/log/ yslog或查看虚拟控制台4了解详细信息。)

<Go Back>   < Continue >            (<返回>   <继续>)


-------------------------

Installation step failed(安装步骤失败)

An installation step failed. You can try to run the failing item again from the menu, or skip it and choose something else. The failing step is: Install the system(安装步骤失败。 您可以尝试从菜单中再次运行失败的项目,或者跳过它并选择其他内容。 失败的步骤是:安装系统)

<Continue>      (<继续>)



--------------------------
Choose the next step in the install process:(选择安装过程中的下一步:)

Choose language(选择语言)
Access software for a blind person using a braille display(使用盲文显示器的盲人访问软件)
Conf igure the keyboaro(配置键盘)
Detect and mount CD-ROM(检测并安装CD-ROM)
Load debconf preconfiguration file(加载debconf预配置文件)
Detect virtual driver disks from harduare manufacturer(检测来自硬件制造商的虚拟驱动器磁盘)
Load installer components from CD(从CD加载安装程序组件)
Detect network hardware(检测网络硬件)
Configure the netuork(配置网络)
Set up users and passuords(设置用户和密码)
conf igure the clock(配置时钟)
Detect disks(检测磁盘)
Partition disks(分区磁盘)
Install the system(安装系统)
Conf igure the package manager(配置包管理器)
Select and install softuare(选择并安装软件)
nstall the GRUB boot loader on a hard disk(将GRUB引导加载程序安装在硬盘上)
Cont inue without boot loaden(无需引导加载的继续)
Finish the installat ion(完成安装)
Change debconf priority(更改debconf优先级)
Check the CD-ROM(s) integrity(检查CD-ROM的完整性)
Save debug logs(保存调试日志)
Execute a shell(执行一个shell)
Eject a CD from the drive(从驱动器中弹出CD)
Abort the installatior(中止安装)


---------------------------------

If you have not finished the install, your system may be left in an unusable state.(如果尚未完成安装,则系统可能处于无法使用的状态。)

Are you sure you want to exit now?(您确定要立即退出吗?)
<Yes> <NO>      (<是> <否>)

Ubuntu Server20.04 TLS版本安装

选择语言(选择英语)

Use UP, DOHN and ENTER keys to select your language.(使用UP,DOHN和ENTER键选择您的语言。)

Asturianu                   (阿斯图里亚斯语)
Bahasa Indonesia            (印度尼西亚语)
Català                      (加泰罗尼亚语)
Deutsch                     (德语)
English                     (英语)
English (UK)                (英文(英国))
Español                     (西班牙文)
Francais                    (法兰西)
Hrvatsk i                   (克罗地亚语)
Latviski                    (拉脱维亚语)
Lietuviskai                 (立陶宛语)
Magyar                      (匈牙利语)
Nederlands                  (荷兰语)
Norsk bokmal                (挪威语)
Polski                      (波兰文)
Suomi                       (芬兰语)
Svenska                     (瑞典文)
Čeština                     (捷克语)

选择键盘(选择英文(美国))

Please select your keyboard layout belou, or select "“Identify keuboard" to detect your layout automatically.(请在下面选择您的键盘布局,或选择““识别键盘””以自动检测您的布局。)
Layout:   [ English (US)    ](版式:[英文(美国)])
variant:  [ English (US)    ](变体:[英文(美国)])

[ Ident ify keyboard ]([识别键盘])
## Keyboard auto-detection(键盘自动检测)
### Keuboard detection starting. You uill be asked a series of questions about your keyboard. Press escape at any time to go back to the previous screen.(Keuboard检测开始。 您将被问到有关键盘的一系列问题。 随时按Escape键可返回上一屏幕。)
#### [ OK ]([ 好的 ])
##### Keyboard auto-detection(键盘自动检测)
##### please  press one of the follouing keys:(请按以下其中一个键:)

##### Is the following key present on your keyboard?(键盘上是否存在以下按键?)
###### Keyboard auto detection completed(键盘自动检测完成)
####### Your keyboard was detected as:(您的键盘被检测为:)
####### Layout: English (US)(版式:英文(美国))
####### variant: English (US) - English (us, intl., with deadkeys)(变体:英文(美国)-英文(美国,国际,含空键))
####### If this is correct, select Done on the next screen. If not you can select another layout or run the automated detection again.(如果正确,请在下一个屏幕上选择“完成”。 如果没有,您可以选择其他布局或再次运行自动检测。)
######## [ OK ]([ 好的 ])

#### [ Cancel ]([ 取消 ])

[ Done ]([ 完毕 ])
[ Back ]([ 后退 ])

配置网络连接(选择dhcp自动获取ipv4的ip地址,或者手动输入即可)

Configure at least one interface this server can use to talk to other machines, and uhich preferably provides sufficient access for updates.(配置该服务器可用于与其他计算机通信的至少一个接口,并且最好为更新提供足够的访问权限。)
  NAME    TYPE   NOTES(名称   类型    注释)
[ ens33   eth    -      ]
## (close)(关闭)
## Info(信息)


## Edit IPv4(编辑IPv4)
### Edit ens33 IPv4 configuration(编辑ens33 IPv4配置)
#### IPv4 Method: [ Automatic (DHCP)  ](IPv4方法:[自动(DHCP)])
##### Manual(手动)
##### Disabled(禁止、禁用、关闭或取消的意思)
###### [ Save ]([ 保存 ])
###### [ Cancel ]([ 取消 ])

## Edit IPv6(编辑IPv6)
### 配置和ipv4大致一样,默认Disabled(禁用)

## Add a VLAN tag(添加VLAN标签)

  DHCPv4  192.168.198.128/24
00:0c:29:bd:98:31 / Intel corporation / 82545EM Gigabit Ethernet Controller (Copper) (PRO/1000 MT single Port Adapter)(0:0c:29:bd:98:31 /英特尔公司/ 82545EM千兆位以太网控制器(铜)(PRO / 1000 MT单端口适配器))
[ Create bond ]([建立联系])

[ Done ]([ 完毕 ])
[ Back ]([ 后退 ])

配置代理(不配置代理,保留为空,选择Done)

If this system requires a proxy to connect to the internet, enter its details here(如果此系统需要代理才能连接到Internet,请在此处输入其详细信息)
Proxy address:(代理地址:)
## If you need to use a HTTP proxy to access the outside world,enter the proxy information here. Otheruise, leave this blank.(如果您需要使用HTTP代理访问外部环境,请在此处输入代理信息。 换句话说,将此空白留空。)
## The proxy information should be given in the standard form of(代理信息应以以下形式提供:)
## "http:// [ [user] [:pass] @] host [:port]/"(“ http:// [[用户] [:pass] @]主机[:port] /”)

[ Done ]([ 完毕 ])
[ Back ]([ 后退 ])

配置Ubuntu存档镜像(保持默认,选择Done)

If you use an alternative mirror for Ubuntu, enter its details here.(如果您为Ubuntu使用备用镜像,请在此处输入其详细信息。)
mirror address: http://cn.archive.ubuntu.com/ubuntu(镜像地址:http://cn.archive.ubuntu.com/ubuntu)
## You may provide an archive mirror that will be used instead of the default(您可以提供一个存档镜像,而不是默认的镜像)

配置磁盘布局,即对硬盘进行分区(这里使用整个磁盘,让其自动分区)

Configure a guided storage layout, or create a custom one:(配置引导式存储布局,或创建自定义布局:)

(x) Use an entire disk((x)使用整个磁盘:此方法将擦除整个硬盘并自动对驱动器进行分区)

    [ /dev/sda local disk 40.000G ]

    [X] Set up this disk as an LVM group([X]将此磁盘设置为LVM组)

        [ ] Encrypt the LVM group with LUKS([ ]使用LUKS加密LVM组)
                    Passphrase:(密码:)

            Confirm passphrase:(确认密码:)

() Custom storage layout(()自定义存储布局)
## To cont inue you need to: Mount a filesystem at / select a boot disk(要继续,您需要:在/选择启动盘上挂载文件系统。)

## FILE SYSTEM SUMMARY(文件系统摘要)

    No disks or partitions mounted.(没有安装磁盘或分区。)

## AVAILABLE DEVICES(可用设备)

   DEVICE    TYPE        SIZE(设备  类型    大小)
[ /dev/sda  local disk   40.000G    ]
### (close)((关闭))
### Info(信息)
### Reformat(重新格式化)
### Add GPT Partition(添加GPT分区)
#### Adding GPT partition to /dev/sda(将GPT分区添加到/dev/sda)
#### size (max 39.998G):(大小(最大39.998G):)
#### Format: [ ext4 ](格式:[ext4])
#### Mount: [ / ](挂载: [ / ]     分配分区,给boot目录分配一个单独分区,给500M磁盘空间,或者别的比如usr目录单独创建一个分区,剩下的空间给/根)
#### [ Create ]([ 创造 ])
#### [ Cancel ]([ 取消 ])

### Format(格式)
#### Format and/or mount /dev/sda(格式化和/或挂载/dev/sda)
#### Formatting and mount ing a disk directly is unusual. You probably want to add a partition instead(直接格式化和挂载磁盘是不常见的。 您可能想添加一个分区)
#### Format: [ Leave unformatted  ](格式:[保留未格式化])
##### ext4
##### xfs
##### btrfs
##### swap

#### Mount: [ / ]
##### [ Done ]([ 完毕 ])
##### [ Cancel ]([ 取消 ])

### Remove from RAID/LVM(从RAID / LVM中删除)
### Use As Boot Device(用作启动设备)
    unused(没用过)


## [ Create software RAID (md)     ]([创建软件RAID(md)])
## [ Create volume group (LVM)     ]([创建卷组(LVM)])

## USED DEVICES(使用的设备)

    No used devices(没有使用过的设备)

### [ Done ]([ 完毕 ])
### [ Reset ]([ 重启 ])
### [ Back ]([ 后退 ])

[ Done ]([ 完毕 ])
[ Back ]([ 后退 ])

存储配置(保持默认点Done完毕,并Continue(继续)确认)

FILE SYSTEM SUMMARY(文件系统摘要)
  MOUNT POIN    TSIZE      TYPE        DEVICE TYPE(安装点       大小        类型        设备类型)
[ /             20.000G    new ext4    new LVM logical volume ]([/ 20.000G 新的ext4 新的LVM逻辑卷])
[ /boot         1.000G     new ext4    new partition of local disk ]([/boot 1.000G 新的ext4 本地磁盘的新分区])
AVAILABLE DEVICES(可用设备)

DEVICE  TYPE  SIZE
ubuntu-vg (new)   LXM volume group   38.996G
free space                           18.996G

[ Create softuare RAID (md)      ]([ 创建软件RAID(md)])
[ Create volume group (LVM)      ]([ 创建卷组(LVM)   ])

USED DEVICES(设备类型大小)

   DEVICE            TYPE                                            SIZE(设备  类型    大小)

[ ubuntu-vg (new)    LVM volume group                                38.996G    ]([ubuntu-vg(新)     LVM卷组         38.996G)
  ubuntu-lv          new, to be formatted as ext4  mounted at  /     20.000G(ubuntu-lv     new,格式为ext4,安装在 /    20.000G)

[ /dev/sda      local disk                                          40.000G     ]([/dev/sda    本地磁盘           40.000G])
partition 1 new, bios_grub                                          1.000M (新建分区1,bios_grub                  1.000M)
partition 2 new, to be formatted as ext4, mounted at /boot          1.000G (新建分区2,格式化为ext4,安装在/boot    1.000G)
partition 3 new, PV of LVM volume group ubuntu-vg                   38.997G(新建分区3,LVM卷组ubuntu-vg的PV       38.997G)

[ Done ]([ 完毕 ])
## Confirm destructive action
### selecting Continue belou uill begin the installation process and result in the loss of data on the disks selected to be formatted.(如果选择“继续”,则将开始安装过程,并且会导致选择要格式化的磁盘上的数据丢失。)
### You will not be able to return to this or a previous screen once the installation has stanted.(安装停止后,您将无法返回到此屏幕或上一个屏幕。)
### Are you sure you want to cont inue?(你确定你要继续吗?)
#### [ No ]([ 不 ])
#### [ Continue ]([ 继续 ])

[ Reset ]([ 重启 ])
[ Back ]([ 后退 ])

个人资料设置

Enter the username and passuord you uill use to log in to the system. You can configure SSH access on the next screen but a passuord is stil needed for sudo(输入您用来登录系统的用户名和密码。 您可以在下一个屏幕上配置SSH访问,但是sudo需要密码)
Your name:(你的名字:)
Your server“s name:(您的服务器名称)

  The name it uses uhen it talks to other computers.(与其他计算机通话时使用的名称。)

Pick a username:(选择一个用户名)
Choose a passuord:(选择一个密码)
Confirm your passuord:(确认您的密码)
[ Done ]([ 完毕 ])

SSH设置

  • 您可以选择安装openSSH服务器,该服务器允许您从网络上的任何系统远程访问该服务器。按空格键选择/取消选择。如果您现在不执行此操作,则可以在安装完成后稍后再安装。SSH对于从任何地方访问Ubuntu服务器都很重要,因此我选择了它。按ENTER继续
You can choose to install the OpensSH server package to enabie secure remote
access to your server(您可以选择安装OpensSH服务器软件包以启用安全远程
访问您的服务器)

  [ x ] Install openSSH server([ ]安装openSSH服务器)

impont SSH identity: [NO    ](启用SSH身份:[否])

You can import your SSH keys from Github or Launchpad.(您可以从Github或Launchpad导入SSH密钥。)
Import Username(导入用户名)
X] Allow passuord authentication over SSH([X]允许通过SSH进行密码验证)

选择适用于您的Ubuntu系统的可用特性软件包列表(不安装,后期安装,点击Done)

  • 选择适用于您的Ubuntu系统的可用特性软件包列表。它们将与Ubuntu服务器安装一起安装。使用SPACE选择或取消选择它们。按ENTER查看快照应用程序的更多详细信息。这是可选的,您以后也可以这样做
These are popular snaps in server environments. select or deselect uith SPACE,press ENTER to see more details of the package, publisher and versions available(这些是服务器环境中流行的快照。 选择或取消选择空格,按ENTER键以查看软件包,发布者和可用版本的更多详细信息)

[ Done ]([ 完毕 ])
[ Back ]([ 后退 ])

安装系统(点击Cancel update and reboot取消更新重新启动,完成安装)

Ubuntu 20.04 LTS安装将立即开始。需要一段时间,具体取决于软件包的选择和Internet的速度。
成功安装Ubuntu 20.04 LTS服务器后,请重新引导它以完成安装

Installing system(安装系统)

[ vieu full log ]([vieu完整日志])
[ Cancel update and reboot ]([取消更新并重新启动])

设置root密码

  • 安装完Ubuntu之后,除了需要新建用户、设置密码之外,我们还要设置root密码,虽然Ubuntu默认有root超级管理员账户,但是具体的密码我们可以自行设置
终端输入sudo passwd root,

在[sudo] password for landry:后输入当前用户的密码


当前用户密码验证通过后

输入需要设置的root超级管理员账户密码Enter new UNIX password:

验证输入的密码Retype new UNIX password:

出现passwd: password updated successfully字样,表示超级管理员root账户密码设置成功


验证:输入su,后输入超级管理员账户的密码,验证通过则成功切换到root账户root@DESKTOP-SUKSNN6:/home/landry#

Ubuntu Server系统基础配置

  • 官⽅使⽤⽂档:https://help.ubuntu.com

  • 第一次登录要使用普通用户,root用户登录不进去,他为了安全默认不让root用户登录

    • 正常情况下,当执行普通用户没有权限的操作的时候,要加一个sudo让你使用超级用户的身份执行某些命令,但是需要输入超级用户的密码

直接切换到root身份

ubuntu@ubuntu:~$ sudo su - root
[sudo] password for ubuntu: 
root@ubuntu:~# 

更改主机名

  • 这个是一定要改的,公司的服务器一定都不是叫localhost
    • 主机名见名知意,比如ubuntu-tmplate.example.com一个模板服务器
root@ubuntu:~# vim /etc/hostname
ubuntu-tmplate.example.com

更改⽹卡名称为eth*

  • 如果安装系统的时候没有把网卡改为eth0,那么可以编辑/etc/default/grub文件,在里面添加参数也行
# 变价grub文件
root@ubuntu-tmplate:~# vim /etc/default/grub 
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"       # 在这个文件中,内存参数会写在这一行,把net.ifnames=0 biosdevname=0这两个参数加进来


# 执行把引导文件更新一下(在重启之后他就可以把网卡名称,改为eth0)
root@ubuntu-tmplate:~# update-grub


# 修改网卡名(改成eth0)
root@ubuntu-tmplate:/home/ubuntu# vim /etc/netplan/01-netcfg.yaml 
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:       # 改成eth0否者重启后找不到设备无法绑定ip地址

# 重启设备
root@ubuntu-tmplate:/home/ubuntu# reboot

配置root远程登录

  • 默认情况下,ubuntu不允许root⽤⼾远程ssh,如果有实际场景需要允许root⽤⼾远程ssh,则需要设置root密码,并且编辑/etc/ssh/sshd_config⽂件(也就是sshd的配置文件)修改如下:
root@ubuntu-tmplate:~# vim /etc/ssh/sshd_config
 #Port 22            # 这个端口有时候我们也会改(这里先不改),默认是22,会点linux的都知道这样不安全,所以可以改一下端口号,改完让别人不知道这是个什么端口,这样比较安全,但是注意不要端口冲突了

 ...

 #PermitRootLogin prohibit-password       # 是否允许root用户通过ssh远程登录他默认是不允许的,如果想登录的话,就把这个改成yes,但是公司中是不允许的,公司的服务器都是先用普通用户登录进去,然后在切换到root,或者以sudo的身份去执行命令,这样相对比较安全一些
 PermitRootLogin yes

...

 #UseDNS no       # 这是在你ssh的时候,他是否要把你的主机名做DNS解析,如果这个这个打开的话,他有时候ssh会非常慢,所以尽量不要开这个,no是关掉
 UseDNS no


 # 重启ssh
 root@ubuntu-tmplate:~# systemctl restart sshd

  • 给root设置一个密码
    • 就可以使用ssh使用root用户直接登录了
# 当前用户是root,直接passwd回车,给root用户设置密码
root@ubuntu-tmplate:~# passwd
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully


# 在本地登录测试一下(登录成功)
root@ubuntu-tmplate:~# ssh root@localhost
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is SHA256:h12pevo/X9MWUFWfVZanah7Pz4VPw7CRp4jzAfpGLq4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
root@localhost's password: 
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-112-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon May 17 20:29:58 CST 2021

  System load:  0.03              Processes:            180
  Usage of /:   9.7% of 39.98GB   Users logged in:      1
  Memory usage: 12%               IP address for ens33: 10.0.0.12
  Swap usage:   0%


158 packages can be updated.(可以更新158个程序包。)
108 updates are security updates.(108个更新是安全更新。)

New release '20.04.2 LTS' available.(新版本“ 20.04.2 LTS”可用。)
Run 'do-release-upgrade' to upgrade to it.(运行“ do-release-upgrade”进行升级。从18.04 LTS版直接升级到20.04.2 LTS版)



The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

root@ubuntu-tmplate:~# 

Ubuntu 18.04⽹络配置

  • 官⽅⽂档: https://netplan.io/

    • Ubuntu 从 17.10 开始,已放弃在 /etc/network/interfaces ⾥固定IP的配置,⽽是改成 netplan ⽅式,配置⽂件是:/etc/netplan/01-netcfg.yaml
  • ubuntu 17.04及之前的静态IP配置⽅式:

# /etc/network/interfaces是用来配置宿主机的ip地址的,这是早期的配置方式
root@magedu:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo           
iface lo inet loopback

auto eth0 #⽹卡⾃启动,写⾃⼰要配置IP的实际⽹卡名称
iface eth0 inet static #配置静态IP,写⾃⼰要配置IP的实际⽹卡名称
address 172.18.3.12 #IP地址
netmask 255.255.0.0 #掩码
gateway 172.18.0.1 #⽹关
dns-nameservers 223.6.6.6 #DNS
dns-nameservers 223.5.5.5

#重启⽹络服务
~# /etc/init.d/networking restart
~# systemctl restart networking.service

单⽹卡静态IP地址

  • ubuntu 18.04配置静态IP地址
#  修改/etc/vim/vimrc文件,默认yaml文件copy进来的的文件,自动缩进(yaml文件在默认的情况下,复制进yaml文件的时候他会自动给你添加缩进)
root@ubuntu-tmplate:~# vim /etc/vim/vimrc
set paste           # 添加一条命令set paste相当于设置粘贴让他不添加自动缩进,


# 退出当前会话,重新登录一下让配置生效
root@kubeadm-master1:~# exit
exit
ubuntu@kubeadm-master1:~$ su
Password: 


---------------------------------------

# 通过01-netcfg.yaml这个文件来控制ip地址,yaml文件缩进一定不能出错,一旦出错他起不来的,所以要保证缩进关系,顶级,一级,二级,三级,四级,依此类推有严格的上下级关系

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    ens33:
      dhcp4: no          # 这是开启dhcp,这里设置静态地址,不用dhcp改成no,dhcp4就表示ipv4
      dhcp6: no          # 添加一个dhcp6,ipv6也不使用dhcp
      addresses: [10.0.0.12/24]       # 指定地址
      gateway4: 10.0.0.2              # 指定网关
      nameservers:                      # 指定DNS
        addresses: [223.6.6.6]          # DNS地址


# 立即生效配置
root@ubuntu-tmplate:~# netplan apply

配置多⽹卡静态IP

  • ubuntu 18.04配置多⽹卡静态IP以及静态路由

  • 多网段(网卡)需要添加静态路由,让报文强制从另一个网卡出去

~# sudo vim /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on
your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
      addresses: [172.18.3.18/16]
      gateway4: 172.18.0.1
      nameservers:
        addresses: [223.6.6.6]

    eth1:
      dhcp4: no
      dhcp6: no
      addresses: [10.20.3.18/16]
      routes:
        - to: 172.20.0.0/16       # 去往这个网段的地址
          via: 10.20.0.1          # 从这里出去,就是内网的网关
        - to: 10.20.0.0/16
          via: 10.20.0.1
        - to: 10.2.0.0/16
          via: 10.20.0.1
        - to: 10.8.0.0/16
          via: 10.20.0.1


~# sudo netplan apply

# route -n查看静态路由

单⽹卡桥接

  • ubuntu 18.04的单⽹卡桥接配置
~# sudo cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on
your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
  bridges:
    br0:
      dhcp4: no
      dhcp6: no
      addresses: [172.18.3.18/16]

      gateway4: 172.18.0.1
      nameservers:
        addresses: [223.6.6.6]
      interfaces:
        - eth0

~# sudo netplan apply

多⽹卡桥接

  • ubuntu 18.04多⽹卡的桥接配置,将br0和br1分别桥接到eth0和eth1。
~# sudo cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on
your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
    eth1:
      dhcp4: no
      dhcp6: no

  bridges:
    br0:
      dhcp4: no
      dhcp6: no
      addresses: [172.18.3.18/16]
      gateway4: 172.18.0.1
      nameservers:
        addresses: [223.6.6.6]
      interfaces:
        - eth0
    br1:
      dhcp4: no
      dhcp6: no
      addresses: [10.20.3.18/16]
      routes:
        - to: 172.20.0.0/16
          via: 10.20.0.1
        - to: 10.20.0.0/16
          via: 10.20.0.1
        - to: 10.2.0.0/16
          via: 10.20.0.1
        - to: 10.8.0.0/16
          via: 10.20.0.1
      interfaces:
        - eth1

双⽹卡绑定

  • 七种bond模式说明

    • 第⼀种模式:mod=0,即:(balance-rr) Round-robin policy(平衡抡循环策略)

      • 特点:传输数据包顺序是依次传输(即:第1个包⾛eth0,下⼀个包就⾛eth1….⼀直循环下去,直到最后⼀个传输完毕),此模式提供负载平衡和容错能⼒。
    • 第⼆种模式:mod=1,即: (active-backup) Active-backuppolicy(主-备份策略)

      • 特点:只有⼀个设备处于活动状态,当⼀个宕掉另⼀个⻢上由备份转换为主设备。mac地址是外部可⻅得,从外⾯看来,bond的MAC地址是唯⼀的,以避免switch(交换机)发⽣混乱。此模式只提供了容错能⼒;由此可⻅此算法的优点是可以提供⾼⽹络连接的可⽤性,但是它的资源利⽤率较低,只有⼀个接⼝处于⼯作状态,在有 N 个⽹络接⼝的情况下,资源利⽤率为1/N。
    • 第三种模式:mod=2,即:(balance-xor) XOR policy(平衡策略)

      • 特点:基于指定的传输HASH策略传输数据包。缺省的策略是:(源MAC地址 XOR⽬标MAC地址) % slave数量。其他的传输策略可以通过xmit_hash_policy选项指定,此模式提供负载平衡和容错能⼒。
    • 第四种模式:mod=3,即:broadcast(⼴播策略)

      • 特点:在每个slave接⼝上传输每个数据包,此模式提供了容错能⼒。
    • 第五种模式:mod=4,即:(802.3ad) IEEE 802.3adDynamic link aggregation(IEEE 802.3ad 动态链接聚合)

      • 特点:创建⼀个聚合组,它们共享同样的速率和双⼯设定。根据802.3ad规范将多个slave⼯作在同⼀个激活的聚合体下。

        • 必要条件:
          • 条件1:ethtool⽀持获取每个slave的速率和双⼯设定。

          • 条件2:switch(交换机)⽀持IEEE 802.3ad Dynamic link aggregation。

          • 条件3:⼤多数switch(交换机)需要经过特定配置才能⽀持802.3ad模式。

    • 第六种模式:mod=5,即:(balance-tlb) Adaptive transmit load balancing(适配器传输负载均衡)

      • 特点:不需要任何特别的switch(交换机)⽀持的通道bonding。在每个slave上根据当前的负载(根据速度计算)分配外出流量。如果正在接受数据的slave出故障了,另⼀个slave接管失败的slave的MAC地址。
        • 该模式的必要条件:
          • ethtool⽀持获取每个slave的速率
    • 第七种模式:mod=6,即:(balance-alb) Adaptive load balancing(适配器适应性负载均衡)

      • 特点:该模式包含了balance-tlb模式,同时加上针对IPV4流量的接收负载均衡(receive load balance, rlb),⽽且不需要任何switch(交换机)的⽀持。
  • ubuntu 18.04的双⽹卡绑定配置。

# 需要提前安装好bridge命令
~# sudo vim /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on
your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
    eth1:
      dhcp4: no
      dhcp6: no

  bonds:
    bond0:
      interfaces:
        - eth0
        - eth1
      addresses: [172.18.3.18/16]
      gateway4: 172.18.0.1
      nameservers:
        addresses: [223.6.6.6,223.5.5.5]
      parameters:
        mode: active-backup
        mii-monitor-interval: 100

~# sudo netplan apply

双⽹卡绑定+桥接

  • ⽹卡绑定⽤于提供⽹卡接⼝冗余以及⾼可⽤和端⼝聚合功能,桥接⽹卡再给需要桥接设备的服务使⽤。
~# sudo cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on
your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
    eth1:
      dhcp4: no
      dhcp6: no

  bonds:
    bond0:
      interfaces:
        - eth0
        - eth1

      #addresses: [172.18.3.18/16]
      #gateway4: 172.18.0.1
      #nameservers:
      # addresses: [223.6.6.6,223.5.5.5]
      parameters:
        mode: active-backup
        mii-monitor-interval: 100

bridges:
  br0:
    dhcp4: no
    dhcp6: no
    addresses: [172.18.3.18/16]
    gateway4: 172.18.0.1
    nameservers:
      addresses: [223.6.6.6,223.5.5.5]
    interfaces:
      - bond0

~#reboot

内外多⽹卡绑定

  • 多⽹络情况下实现⽹卡绑定
~# sudo cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on
your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
    eth1:
      dhcp4: no
      dhcp6: no
    eth2:
      dhcp4: no
      dhcp6: no
    eth3:
      dhcp4: no
      dhcp6: no
  bonds:
    bond0:
      interfaces:
        - eth0
        - eth1
      addresses: [172.18.3.18/16]
      gateway4: 172.18.0.1
      nameservers:
        addresses: [223.6.6.6,223.5.5.5]
      parameters:
        mode: active-backup
        mii-monitor-interval: 100

  bond1:
    interfaces:
      - eth2
      - eth3
    addresses: [10.20.3.18/16]
    parameters:
      mode: active-backup
      mii-monitor-interval: 100
  routes:
    - to: 172.20.0.0/16
      via: 10.20.0.1
    - to: 10.20.0.0/16
      via: 10.20.0.1
    - to: 10.2.0.0/16
      via: 10.20.0.1
    - to: 10.8.0.0/16
      via: 10.20.0.1

内⽹多⽹卡绑定+桥接

~# sudo cat /etc/netplan/01-netcfg.yaml
# This file describes the network interfaces available on
your system
# For more information, see netplan(5).
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: no
      dhcp6: no
    eth1:
      dhcp4: no
      dhcp6: no
    eth2:
      dhcp4: no
      dhcp6: no
    eth3:
      dhcp4: no
      dhcp6: no

  bonds:
    bond0:
      interfaces:
        - eth0
        - eth1
      parameters:
        mode: active-backup
        mii-monitor-interval: 100

    bond1:
      interfaces:
        - eth2
        - eth3
      parameters:
        mode: active-backup
        mii-monitor-interval: 100

  bridges:
    br0:
      dhcp4: no
      dhcp6: no
      addresses: [172.18.3.18/16]
      gateway4: 172.18.0.1
      nameservers:
        addresses: [223.6.6.6,223.5.5.5]
      interfaces:
        - bond0
    br1:
      dhcp4: no
      dhcp6: no
      interfaces:
        - bond1
      addresses: [10.20.3.18/16]
      routes:
        - to: 172.20.0.0/16
          via: 10.20.0.1
        - to: 10.20.0.0/16
          via: 10.20.0.1
        - to: 10.2.0.0/16
          via: 10.20.0.1
        - to: 10.8.0.0/16
          via: 10.20.0.1

Ubuntu软件包管理

  • 在ubuntu安装、升级、卸载软件包等常规操作。

系统资源限制优化

# root账⼾的资源软限制和硬限制
## ubuntu系统root用户也要添加上限制,否者root用户不生效
root@ubuntu-tmplate:/home/ubuntu# cat << EOF >> /etc/security/limits.conf
root             soft    core            unlimited
root             hard    core            unlimited
root             soft    nproc           1000000
root             hard    nproc           1000000
root             soft    nofile          1000000
root             hard    nofile          1000000
root             soft    memlock         32000
root             hard    memlock         32000
root             soft    msgqueue        8192000
root             hard    msgqueue        8192000
*                soft    core            unlimited
*                hard    core            unlimited
*                soft    nproc           1000000
*                hard    nproc           1000000
*                soft    nofile          1000000
*                hard    le              1000000
*                soft    lock            32000
*                hard    lock            32000
*                soft    queue           8192000
*                hard    msgqueue        8192000
EOF


# 其他账⼾的资源软限制和硬限制(在centos系统*号就表示所有用户,包括root,仅用这一个就可以了)
root@ubuntu-tmplate:/home/ubuntu# cat << EOF >> /etc/security/limits.conf
*                soft    core            unlimited
*                hard    core            unlimited
*                soft    nproc           1000000
*                hard    nproc           1000000
*                soft    nofile          1000000
*                hard    le              1000000
*                soft    lock            32000
*                hard    lock            32000
*                soft    queue           8192000
*                hard    msgqueue        8192000
EOF


# 查看当前资源限制(做一下对比)
root@ubuntu-tmplate:/home/ubuntu# ulimit -n
1024

# 重启设备
root@ubuntu-tmplate:/home/ubuntu# reboot


# 在看一下(在ubuntu如果使用仅使用*那么root用户是不生效的,仅普通用户生效)
ubuntu@ubuntu-tmplate:~$ ulimit -n
1000000

内核参数优化

root@ubuntu-tmplate:/home/ubuntu# cat << EOF >> /etc/sysctl.conf
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
net.ipv4.ip_nonlocal_bind = 1
net.ipv4.ip_forward = 1


# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0


# Controls the System Request debugging functionality of
the kernel
kernel.sysrq = 0


# Controls whether core dumps will append the PID to the
core filename.


# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1


# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1


# Disable netfilter on bridges.
net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0


# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536


# # Controls the maximum size of a message, in bytes
kernel.msgmax = 65536


# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# # Controls the maximum number of shared memory segments,in pages
kernel.shmall = 4294967296

# TCP kernel paramater
net.ipv4.tcp_mem = 786432 1048576 1572864
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_sack = 1


# socket buffer
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn = 20480
net.core.optmem_max = 81920


# TCP conn
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_syn_retries = 3
net.ipv4.tcp_retries1 = 3
net.ipv4.tcp_retries2 = 15


# tcp conn reuse
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_tw_reuse = 0
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_max_tw_buckets = 20000
net.ipv4.tcp_max_orphans = 3276800
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syncookies = 1


# keepalive conn
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.ip_local_port_range = 10001 65000

# swap
vm.overcommit_memory = 0
vm.swappiness = 10
#net.ipv4.conf.eth1.rp_filter = 0
#net.ipv4.conf.lo.arp_ignore = 1
#net.ipv4.conf.lo.arp_announce = 2
#net.ipv4.conf.all.arp_ignore = 1
#net.ipv4.conf.all.arp_announce = 2
EOF

# 他会有些参数文件找不到,执行以下指令重新加载一下
root@ubuntu-tmplate:/home/ubuntu# modprobe br_netfilter && modprobe ip_conntrack


# 从文件中读取值
root@ubuntu-tmplate:/home/ubuntu# sysctl -p

修改软件仓库

# 编辑配置文件,把代码配置到文件中(把里面官方的源地址全部删除掉,放入清华大学的镜像源地址)
root@ubuntu-tmplate:/home/ubuntu# cat << EOF > /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
EOF


# 更新软件源(否者识别不了新的包)
root@ubuntu-tmplate:/home/ubuntu# apt update

apt/apt-get

  • apt-get是以前用的命令,现在官方推荐使用apt,这两个命令的功能是一摸一样的
  • apt命令帮你安装程序包并解决依赖关系

更新本地软件包列表索引

# 更新本地软件包列表索引,修改了apt仓库后必须执⾏

root@ubuntu-tmplate:/home/ubuntu# apt update

升级已安装的包

  • 所有的包
# 升级所有已安装且可升级到新版本的软件包

root@ubuntu-tmplate:/home/ubuntu# apt -y upgrade

升级整个系统

  • 这个升级会很慢,通常情况下没有什么特殊的BUG,是不用跨那么大的版本升级的
# 升级整个系统,必要时可以自动移除旧软件包。

apt full-upgrade

## 如果你要升级,在你登录进系统时会提醒你
  System load:  0.74               Processes:           220
  Usage of /:   11.3% of 39.98GB   Users logged in:     1
  Memory usage: 21%                IP address for eth0: 10.0.0.12
  Swap usage:   0%

 * Pure upstream Kubernetes 1.21, smallest, simplest cluster ops!

     https://microk8s.io/



New release '20.04.2 LTS' available.(# 新版本“ 20.04.2 LTS”可用。)
Run 'do-release-upgrade' to upgrade to it.(# 运行“ do-release-upgrade”进行升级)


*** System restart required ***
Last login: Tue May 18 15:08:11 2021 from 10.0.0.1

查看包有哪些

#apt列出仓库软件包,等于yum list(也就是当前仓库当中有哪些包可以安装)

root@ubuntu-tmplate:/home/ubuntu# apt list

编辑source源⽂件

  • 这个命令等于直接编辑/etc/apt/sources.list文件
root@ubuntu-tmplate:/home/ubuntu# apt edit-sources

Select an editor.  To change later, run 'select-editor'.(# 选择一个编辑器。 要稍后更改,请运行“选择编辑器”)
  1. /bin/nano        <---- easiest(最简单)
  2. /usr/bin/vim.basic
  3. /usr/bin/vim.tiny
  4. /bin/ed

Choose 1-4 [1]: 2     (# 我们使用vim选2.nane太难用了,这就相当于使用vim打开这个文件)

查看一个包

#搜索安装包(如果我们要安装apache但是不知道这个包叫什么那就search apache然后去找带有apache关键字的安装包)

root@ubuntu-tmplate:/home/ubuntu# apt search apache

查看安装包的详细信息

 #查看某个安装包的详细信息(前提需要知道程序包的包名)

 root@ubuntu-tmplate:/home/ubuntu# apt show nginx
Package: nginx(# 包装:nginx)
Version: 1.14.0-0ubuntu1.7(# 版本:1.14.0-0ubuntu1.7)
Priority: optional(# 优先级:可选)
Section: web(# 这个包是用来做什么的)
Origin: Ubuntu(# 来源:Ubuntu)
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Nginx Maintainers <pkg-nginx-maintainers@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 44.0 kB
Depends: nginx-core (<< 1.14.0-0ubuntu1.7.1~) | nginx-full (<< 1.14.0-0ubuntu1.7.1~) | nginx-light (<< 1.14.0-0ubuntu1.7.1~) | nginx-extras (<< 1.14.0-0ubuntu1.7.1~), nginx-core (>= 1.14.0-0ubuntu1.7) | nginx-full (>= 1.14.0-0ubuntu1.7) | nginx-light (>= 1.14.0-0ubuntu1.7) | nginx-extras (>= 1.14.0-0ubuntu1.7)
Homepage: http://nginx.net(# 主页:http://nginx.net)
Supported: 5y(# 支持:5年)
Download-Size: 3,596 B(# 下载大小:3,596 B)
APT-Sources: http://hk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages(# APT来源:http://hk.archive.ubuntu.com/ubuntu bionic-updates / main amd64软件包)
Description: small, powerful, scalable web/proxy server
 Nginx ("engine X") is a high-performance web and reverse proxy server(# 说明:小型,功能强大,可扩展的Web /代理服务器
 Nginx(“引擎X”)是一种高性能的Web和反向代理服务器)
 created by Igor Sysoev. It can be used both as a standalone web server and as a proxy to reduce the load on back-end HTTP or mail servers.(# 由Igor Sysoev创建。它既可以用作独立的Web服务器,也可以用作代理,以减少后端HTTP或邮件服务器上的负载。)
 .
 This is a dependency package to install either nginx-full (by default),
 nginx-light or nginx-extras.(# 这是一个依赖包,用于安装nginx-full(默认情况下),
 nginx-light或nginx-extras。)

N: There is 1 additional record. Please use the '-a' switch to see it(# N:还有1条记录。请使用“ -a”开关进行查看)

列出仓库中的安装包

查看帮助
root@mimabaohu:/home/ubuntu# apt-cache --help
apt 2.0.4 (amd64)
Usage: apt-cache [options] command
       apt-cache [options] show pkg1 [pkg2 ...]

apt-cache queries and displays available information about installed and installable packages. It works exclusively on the data acquired into the local cache via the 'update' command of e.g. apt-get. The displayed information may therefore be outdated if the last update was too long ago, but in exchange apt-cache works independently of the availability of the configured sources (e.g. offline).

Most used commands(最常用的命令):
  showsrc - Show source records (# 显示源记录)

  search - Search the package list for a regex pattern (# 在包列表中搜索正则表达式模式)

  depends - Show raw dependency information for a package (# 显示包的原始依赖信息)

  rdepends - Show reverse dependency information for a package (# 显示包的反向依赖信息)

  show - Show a readable record for the package (# 显示包的可读记录)

  pkgnames - List the names of all packages in the system (# 列出系统中所有包的名称)

  policy - Show policy settings (# 显示策略设置)

See apt-cache(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).


通过正则查找仓库中的软件包
root@mimabaohu:/home/ubuntu# apt-cache search mariadb-*

root@mimabaohu:/home/ubuntu# apt-cache search ^mariadb-*
libmariadb-dev - MariaDB database development files
libmariadb-dev-compat - MariaDB Connector/C, compatibility symlinks
libmariadb3 - MariaDB database client library
libmariadbclient-dev - MariaDB database development files (transitional package)
libmariadbd-dev - MariaDB embedded database, development files
libmariadbd19 - MariaDB embedded database, shared library
libreoffice-sdbc-mysql - MariaDB/MySQL SDBC driver for LibreOffice
mariadb-backup - Backup tool for MariaDB server
mariadb-client - MariaDB database client (metapackage depending on the latest version)
mariadb-client-10.3 - MariaDB database client binaries
mariadb-client-core-10.3 - MariaDB database core client binaries
mariadb-common - MariaDB common metapackage
mariadb-plugin-connect - Connect storage engine for MariaDB
mariadb-plugin-cracklib-password-check - CrackLib Password Validation Plugin for MariaDB
mariadb-plugin-gssapi-client - GSSAPI authentication plugin for MariaDB client
mariadb-plugin-gssapi-server - GSSAPI authentication plugin for MariaDB server
mariadb-plugin-mroonga - Mroonga storage engine for MariaDB
mariadb-plugin-oqgraph - OQGraph storage engine for MariaDB
mariadb-plugin-rocksdb - RocksDB storage engine for MariaDB
mariadb-plugin-spider - Spider storage engine for MariaDB
mariadb-plugin-tokudb - TokuDB storage engine for MariaDB
mariadb-server - MariaDB database server (metapackage depending on the latest version)
mariadb-server-10.3 - MariaDB database server binaries
mariadb-server-core-10.3 - MariaDB database core server files
mariadb-test - MariaDB database regression test suite
mariadb-test-data - MariaDB database regression test suite - data files


查看软件包版本
#查看仓库中软件包有哪些版本可以安装(可以看到nginx在这个仓库中的包都是1.14的)

root@ubuntu-tmplate:/home/ubuntu# apt-cache madison nginx
     nginx | 1.14.0-0ubuntu1.7 | http://hk.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
     nginx | 1.14.0-0ubuntu1.7 | http://hk.archive.ubuntu.com/ubuntu bionic-updates/main i386 Packages
     nginx | 1.14.0-0ubuntu1.7 | http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     nginx | 1.14.0-0ubuntu1.7 | http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages
     nginx | 1.14.0-0ubuntu1 | http://hk.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
     nginx | 1.14.0-0ubuntu1 | http://hk.archive.ubuntu.com/ubuntu bionic/main i386 Packages


## 显示的信息:
## nginx
### 第一列是名称

## 1.14.0-0ubuntu1.7、
### 第二列是版本信息

## http://hk.archive.ubuntu.com/ubuntu bionic/main i386 Packages
### 第三列是仓库地址


在线安装软件包

  • ubuntu的包名称,和centos的包名称对不上,比如apache在centos叫httpd,但是在ubuntu没有httpd这个包,在ubuntu要安装apache2,这个包就需要自己去找了

  • ubuntu安装完程序包之后,默认会安装最新版本并把服务启动

root@ubuntu-tmplate:/home/ubuntu# apt -y install nginx


# 指定版本号安装
apt -y install nginx=1.14.0-0ubuntu1.7

# 查看端口
root@ubuntu-tmplate:/home/ubuntu# ss -tnl
LISTEN       0             511                            [::]:80                          [::]:* 

# 查看服务
root@ubuntu-tmplate:/home/ubuntu# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2021-05-18 14:53:12 CST; 50s ago
     Docs: man:nginx(8)
 Main PID: 8403 (nginx)
    Tasks: 3 (limit: 2290)
   CGroup: /system.slice/nginx.service
           ├─8403 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           ├─8404 nginx: worker process
           └─8405 nginx: worker process


# 访问测试
http://10.0.0.12/

卸载程序包

# autoremove删除安装包并解决依赖关系(自动把依赖的包也删掉)
root@ubuntu-tmplate:/home/ubuntu# apt autoremove nginx

# remove卸载单个软件包但是保留配置⽂件
root@ubuntu-tmplate:/home/ubuntu# apt remove nginx


# purge卸载单个软件包删除配置⽂件 
root@ubuntu-tmplate:/home/ubuntu# apt purge nginx

## 可以配合apt autoremove删除依赖后,在删除配置文件,实现完全删除
root@mimabaohu:/home/ubuntu# apt -y autoremove zabbix-java-gateway && apt -y purge zabbix-java-gateway

安装常⽤系统命令

  • 这些就包括了常见的安装包,把这些安装上就够使用了,常见的编译这些环境就足够使用了
apt purge ufw lxd lxd-client lxcfs lxc-common


root@ubuntu-tmplate:/home/ubuntu# apt -y install iproute2 ntpdate tcpdump telnet traceroute nfs-kernel-server nfs-common lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev ntpdate tcpdump telnet traceroute gcc openssh-server lrzsz tree openssl libssl-dev libpcre3 libpcre3-dev zlib1g-dev ntpdate tcpdump telnet traceroute iotop unzip zip

dpkg安装包管理

  • rpm:RPM(Red Hat Package Manager),是基于Red hat的Linux Distribution的包管理系统,同时也指rpm包本⾝,RPM⽤于rpm包的管理(诸如安装、卸载、升级等)

  • "dpkg "是"Debian Packager "的简写,为 "Debian"专⻔开发的套件管理系统,⽅便软件的安装、更新及移除。所有源⾃“Debian”的“Linux ”发⾏版都使⽤ “dpkg”,例如 “Ubuntu”、“Knoppix ”等

    • dpkg是管理单个包的,不解决依赖关系,类似于centos中的rpm
  • 查看帮助

    • dpkg-deb --help查看未安装包信息
    • dpkg --help
  • 如果安装包真不知道叫什么名字,除了可以在网络上找之外,还可以去仓库中去翻,进到仓库里面去搜,比如https://mirrors.tuna.tsinghua.edu.cn/ubuntu/这个ubuntu仓库,在pool里面(pool的意思就是池子的意思),然后找main(main的意思是主仓库),他的报名是安装a,b,c,d...这样排的

查看未安装软件包内的⽂件及⽬录内容

# wget下来一个deb包
root@ubuntu-tmplate:/home/ubuntu# wget https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ubuntu/ubuntu/ubuntu/ubuntu/pool/main/n/nginx/nginx_1.18.0-6ubuntu8_amd64.deb


# 查看你软件包内文件及目录内容
root@ubuntu-tmplate:/home/ubuntu# dpkg-deb -c nginx_1.18.0-6ubuntu8_amd64.deb 
drwxr-xr-x root/root         0 2021-03-10 23:50 ./
drwxr-xr-x root/root         0 2021-03-10 23:50 ./usr/
drwxr-xr-x root/root         0 2021-03-10 23:50 ./usr/share/
drwxr-xr-x root/root         0 2021-03-10 23:50 ./usr/share/doc/
drwxr-xr-x root/root         0 2021-03-10 23:50 ./usr/share/doc/nginx/
-rw-r--r-- root/root      9764 2021-03-08 23:13 ./usr/share/doc/nginx/copyright
lrwxrwxrwx root/root         0 2021-03-10 23:50 ./usr/share/doc/nginx/changelog.Debian.gz -> ../nginx-core/changelog.Debian.gz

root@ubuntu-tmplate:/home/ubuntu# dpkg -c nginx_1.18.0-6ubuntu8_amd64.deb 
drwxr-xr-x root/root         0 2021-03-10 23:50 ./
drwxr-xr-x root/root         0 2021-03-10 23:50 ./usr/
drwxr-xr-x root/root         0 2021-03-10 23:50 ./usr/share/
drwxr-xr-x root/root         0 2021-03-10 23:50 ./usr/share/doc/
drwxr-xr-x root/root         0 2021-03-10 23:50 ./usr/share/doc/nginx/
-rw-r--r-- root/root      9764 2021-03-08 23:13 ./usr/share/doc/nginx/copyright
lrwxrwxrwx root/root         0 2021-03-10 23:50 ./usr/share/doc/nginx/changelog.Debian.gz -> ../nginx-core/changelog.Debian.gz

查看已安装软件包内的⽂件及⽬录内容

root@ubuntu-tmplate:/home/ubuntu# dpkg -L nginx
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/nginx
/usr/share/doc/nginx/copyright
/usr/share/doc/nginx/changelog.Debian.gz

dpkg安装某个软件包

# 他会把包解压到某些目录下
root@ubuntu-tmplate:/home/ubuntu# dpkg -i nginx_1.18.0-6ubuntu8_amd64.deb

删除某个软件包

# 删除某个软件包保留配置⽂件
root@ubuntu-tmplate:/home/ubuntu# dpkg -r nginx
(正在读取数据库... 107848当前安装的文件和目录。)
删除nginx(1.14.0-0ubuntu1.7)...


# 删除某个软件包不保留配置⽂件
root@ubuntu-tmplate:/home/ubuntu# dpkg -P nginx
## 或
sudo dpkg --purge code


##   -r|--remove        <软件包名>    ... | -a|--pending              ( 删除软件包(保留其配置信息) )
##   -P|--purge         <软件包名>    ... | -a|--pending              ( 删除一个包(包括配置信息) )

dpkg查看软件包信息

  • 必须指定完整包名
root@ubuntu-tmplate:/home/ubuntu# dpkg -I nginx_1.18.0-6ubuntu8_amd64.deb 
 new Debian package, version 2.0.
 size 3968 bytes: control archive=796 bytes.
    1038 bytes,    18 lines      control              
      64 bytes,     1 lines      md5sums              
 Package: nginx
 Version: 1.18.0-6ubuntu8
 Architecture: amd64
 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
 Installed-Size: 48
 Depends: nginx-core (<< 1.18.0-6ubuntu8.1~) | nginx-full (<< 1.18.0-6ubuntu8.1~) | nginx-light (<< 1.18.0-6ubuntu8.1~) | nginx-extras (<< 1.18.0-6ubuntu8.1~), nginx-core (>= 1.18.0-6ubuntu8) | nginx-full (>= 1.18.0-6ubuntu8) | nginx-light (>= 1.18.0-6ubuntu8) | nginx-extras (>= 1.18.0-6ubuntu8)
 Breaks: libnginx-mod-http-lua (<< 1.18.0-6ubuntu5)
 Section: httpd
 Priority: optional
 Homepage: https://nginx.net
 Description: small, powerful, scalable web/proxy server
  Nginx ("engine X") is a high-performance web and reverse proxy server
  created by Igor Sysoev. It can be used both as a standalone web server
  and as a proxy to reduce the load on back-end HTTP or mail servers.
  .
  This is a dependency package to install either nginx-core (by default),
  nginx-full, nginx-light or nginx-extras.
 Original-Maintainer: Debian Nginx Maintainers <pkg-nginx-maintainers@alioth-lists.debian.net>

列出本机已经安装的所有软件

root@ubuntu-tmplate:/home/ubuntu# dpkg -l


# 统计一下一共安装了多少包
root@ubuntu-tmplate:/home/ubuntu# dpkg -l | wc -l
578

邮件服务

邮箱开启SMTP

  • 需要邮箱支持SMTP,这个一般都支持

  • 如果是QQ邮箱需要单独开启SMTP,其他邮箱具体联系服务商。

  • 确认是已经打开状态,如果是未开启状态只要点击开启并根据提示进行相关验证即可

  • QQ邮箱在第三方平台发送邮件不能直接使用QQ邮箱的登录密码,需要使用单独提供的授权码才可以登录

  • 安装提示使用绑定的手机发送配置邮件客户端到1069070069,然后点击我已发送

# 登录qq邮箱: mail.qq.com


## 进入邮箱设置
xxxxxxxxx<xxxxxxxxx@qq.com>
邮箱首页 | 设置 - 换肤                          (点击设置)



### 邮箱设置

#### 账户                                     (点击账户)

##### POP3/IMAP/SMTP/Exchange/CardDAV/CalDAV服务

###### 开启服务:

####### POP3/SMTP服务 (如何使用 Foxmail 等软件收发邮件?)     已开启 |  关闭                            (需要先开启POP3/SMTP功能,先把这个打开,这个开启可能要收一个验证码之类的,开启之后在生成一个授权码)


######## 温馨提示:在第三方登录QQ邮箱,可能存在邮件泄露风险,甚至危害Apple ID安全,建议使用QQ邮箱手机版登录。
######### 继续获取授权码登录第三方客户端邮箱 。 生成授权码              (点击生成授权码,这个授权码是用来在你的zabbix上登录邮箱去发送邮件的,他不是通过你的qq账号密码去登录的,而是通过一个单独的授权码,所以说zabbix需要能够访问你的qq邮箱,当然这个是你的邮件服务器,其实是通过SMTP去调用邮件服务器去发送邮件,SMTP是邮件的发送协议,pop3是用来收邮件的)


########## 短信验证                                             (打开之后要生成一个授权码)
########### 请先用密保手机 xxx******xx 发短信,然后点“我已发送”按钮                     (需要用你绑定的收集号给1069 0700 69这个号码发送 配置邮件客户端 这么几个汉字)

############ 发短信:配置邮件客户端
############ 到号码:1069 0700 69

############# 我已发送                                          (发送完点 我已发送 进行认证之后他就是给你生成一个授权码)

############## 在第三方客户端登录时,密码框请输入以下授权码:       (将页面生成后返回的授权码妥善保存好,后期会使用此授权码进行登录验证)

############### oagdtbcxlsmvbgaf                                (这个就是你的授权码)
############### 提示:你可拥有多个授权码,所以无需记住该授权码,也不要告诉其他人。

安装邮件服务

# 安装mailx (没有mailx这个包,提示了两个包,都测试安装以下)
root@node2:/home/ubuntu# apt -y install mailx
Reading package lists... Done     (# 阅读包裹清单...完成)
Building dependency tree          (# 构建依赖树)
Reading state information... Done       (# 读取状态信息...完成)
Package mailx is a virtual package provided by:     (# 包 mailx 是由以下提供的虚拟包:)
  mailutils 1:3.7-2.1
  bsd-mailx 8.1.2-0.20180807cvs-1
You should explicitly select one to install.      (# 您应该明确选择一个进行安装。)

E: Package 'mailx' has no installation candidate      (3 E: 包 'mailx' 没有安装候选)
安装mailutils或bsd-mailx
  • 暂时不会用
root@node2:/home/ubuntu# apt -y install mailutils

或

root@mimabaohu:/home/ubuntu# apt -y install bsd-mailx



# Package configuration       (Package 配置)

##  Postfix Configuration     (Postfix 配置)




###  Please select the mail server configuration type that best meets your needs.       (请选择最符合您需求的邮件服务器配置类型。)

###  No configuration:      (无配置:)
#### Should be chosen to leave the current configuration unchanged.       (应选择保持当前配置不变。)

### Internet site:      (互联网网站:)
#### Mail is sent and received directly using SMTP.     (使用 SMTP 直接发送和接收邮件。)

### Internet with smarthost:     (使用智能主机上网:)
#### Mail is received directly using SMTP or by running a utility such as fetchmail. Outgoing mail is sent using a smarthost.     (使用 SMTP 或通过运行实用程序(例如 fetchmail)直接接收邮件。 外发邮件是使用智能主机发送的。)


### Satellite system:     (卫星系统:)
#### All mail is sent to another machine, called a 'smarthost', for delivery.      (所有邮件都发送到另一台称为“智能主机”的机器上进行投递。)


### Local only:       (仅限本地:)
#### The only delivered mail is the mail for local users. There is no network.      (唯一发送的邮件是本地用户的邮件。 没有网络。)


###  General type of mail configuration:      (邮件配置的一般类型:)

#### No configuration                                    
#### Internet Site                            (选择 互联网网站)        
#### Internet with smarthost                             
#### Satellite system                                                                     
#### Local only   

##### <ok>     <Cancel>                        (选择ok)





### The "mail name" is the domain name used to "qualify" _ALL_ mail addresses without a domain name. This includes mail to and from <root>: please do   not make your machine send out mail from root@example.org unless root@example.org has told you to.        (“邮件名称”是用于“限定”没有域名的 _ALL_ 邮件地址的域名。 这包括往来于 <root> 的邮件:请不要让你的机器从 root@example.org 发送邮件,除非 root@example.org 已经告诉你了)


### This name will also be used by other programs. It should be the single, fully qualified domain name (FQDN).     (此名称也将被其他程序使用。 它应该是单一的、完全限定的域名 (FQDN)。)


### Thus, if a mail address on the local host is foo@example.org, the correct value for this option would be example.org.       (因此,如果本地主机上的邮件地址是 foo@example.org,则此选项的正确值将是 example.org。)

### System mail name:       (系统邮件名称:)

#### ubuntumail                 (此名称唯一限定,写个Ubuntu吧,测试)


###### <ok>     <Cancel>                        (选择ok)


MAN手册

  • 参考地址: https://blog.csdn.net/yytak/article/details/89437932

  • man章节区别

    • man 是系统的手册分页程序。指定给 man 的 页 选项通常是程序、工具或函数名。程序将显示找到的相关 手册页。如果指定了 章节,man 将只在手册的指定 章节 搜索。并只显示找到的第一个 页,即使多个 章节 中都有这个 页面。
手册的 章节 号及其包含的手册页类型

1 可执行程序或 shell 命令

2 系统调用(内核提供的函数)

3 库调用(程序库中的函数)

4 特殊文件(通常位于 /dev)

5 文件格式和规范,如 /etc/passwd

6 游戏

7 杂项(包括宏包和规范,如 man(7), groff(7))

8 系统管理命令(通常只针对 root 用户)

9 内核例程 [非标准


中文MAN手册

  • 中文支持,可能不是很全,但是基础命令的中文man手册大部分都有
安装man手册
root@mimabaohu:/home/ubuntu# apt update


# 如果有man手册可以忽略
root@mimabaohu:/home/ubuntu# apt -y install manpages-dev
仓库安装
  • 需要系统中文环境
安装中文支持
root@mimabaohu:/home/ubuntu# apt update


# 安装后打开即为中文man手册 (需要安装系统中文环境)
root@mimabaohu:/home/ubuntu# apt install manpages-zh


源码安装
# 下载源码包v1.6.3.4版本,下载最新版本可在github中查看
root@mimabaohu:/home/ubuntu# wget https://github.com/man-pages-zh/manpages-zh/archive/refs/tags/v1.6.3.4.tar.gz


# 解压源码包
root@mimabaohu:/home/ubuntu# tar xf v1.6.3.4.tar.gz 
root@mimabaohu:/home/ubuntu# ll
total 1844
drwxr-xr-x 4 ubuntu ubuntu    4096 Jun 22 07:50 ./
drwxr-xr-x 3 root   root      4096 May 16 09:57 ../
drwxrwxr-x 6 root   root      4096 May  9  2020 manpages-zh-1.6.3.4/
-rw-r--r-- 1 root   root   1849853 Jun 22 07:49 v1.6.3.4.tar.gz


# 切换目录
root@mimabaohu:/home/ubuntu# cd manpages-zh-1.6.3.4/


# 解决依赖环境 (opencc需要1+版本之上)
root@mimabaohu:/home/ubuntu/manpages-zh-1.6.3.4# apt -y install autoconf automake  python3 opencc make


# 编译安装
root@mimabaohu:/home/ubuntu/manpages-zh-1.6.3.4# ./configure  --prefix=/apps/manpages-zh && make && make install


# 为了不抵消man,我们新建cman命令作为中文查询
root@mimabaohu:/home/ubuntu/manpages-zh-1.6.3.4# echo "alias cman='man -M /apps/manpages-zh/share/man/zh_CN/' " >> ~.bash_profile
root@mimabaohu:/home/ubuntu/manpages-zh-1.6.3.4# source ~.bash_profile

# 尝试是否可以TAB出来cman命令
root@mimabaohu:/home/ubuntu/manpages-zh-1.6.3.4# cm
cman  cmp  

# 测试cman手册
root@mimabaohu:/home/ubuntu/manpages-zh-1.6.3.4# cman ls

ubuntu系统安装中文语言环境

  • 安装并设置中文简体语言环境
# 安装简体中文语言环境,把中文的环境全安装上,要不然选不上中文,无论是编译安装的还是apt安装的
root@mimabaohu:/apps/zabbix_server# apt install language-pack-zh*



# 增加中文语言环境变量
root@mimabaohu:/apps/zabbix_server# vim /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

LANG="zh_CN.UTF-8"        # 添加这条



# 重新设置本地配置
root@mimabaohu:/home/ubuntu# dpkg-reconfigure locales
## Package configuration    (包配置)

### Configuring locales     (配置语言环境)

#### Locales are a framework to switch between multiple languages and allow users to use their language, country,  characters, collation order, etc.    (语言环境是一个在多种语言之间切换的框架,允许用户使用他们的语言、国家、字符、排序规则等。)

#### Please choose which locales to generate. UTF-8 locales should be chosen by default, particularly for new  installations. Other character sets may be useful for backwards compatibility with older systems and software.       (请选择要生成的语言环境。 默认情况下应选择 UTF-8 语言环境,特别是对于新安装。 其他字符集可能有助于向后兼容旧系统和软件。)


#### Locales to be generated:       (要生成的语言环境:)


#####  [ * ] zh_CN.UTF-8 UTF-8      (在最下面,空格选择这个,然后按回车键)

###### Many packages in Debian use locales to display text in the correct language for the user. You can choose a  default locale for the system from the generated locales.        (Debian 中的许多软件包都使用区域设置来为用户以正确的语言显示文本。 您可以从生成的语言环境中为系统选择默认语言环境。)


###### This will select the default language for the entire system. If this system is a multi-user system where not  all users are able to speak the default language, they will experience difficulties.       (这将为整个系统选择默认语言。 如果该系统是多用户系统,其中并非所有用户都能说默认语言,他们将遇到困难。)


###### Default locale for the system environment:   (系统环境的默认语言环境:)


####### zh_CN.UTF-8     (选择这个在按回车,他会自己配置中文,这样就可以在zabbix web中选择中文了)


 ### <Ok>                                    <Cancel>       (<确定>      <取消>)      (这些是点不了的,使用tab切换如果点不了就按回车,把ubuntu重启就变成中文了,但是man手册不会改变)




# 重启系统
reboot

ubuntu20桌面版安装软件

安装VScode

安装百度网盘

# 创建安装目录
root@ubuntu:/home/ubuntu# mkdir -p /usr/local/src/baidunetdisk

# 切换目录
root@ubuntu:/home/ubuntu# cd /usr/local/src/baidunetdisk/

# 下载百度网盘deb包
root@ubuntu:/usr/local/src/baidunetdisk# wget https://issuecdn.baidupcs.com/issue/netdisk/LinuxGuanjia/3.5.0/baidunetdisk_3.5.0_amd64.deb


# 查看安装包文件
root@ubuntu:/usr/local/src/baidunetdisk# dpkg -c baidunetdisk_3.5.0_amd64.deb 


# 安装百度网盘
root@ubuntu:/usr/local/src/baidunetdisk# dpkg -i baidunetdisk_3.5.0_amd64.deb 

# 启动百度网盘(没有找到命令启动,但是有百度网盘图标可以点击启动)

安装qq

# 创建安装目录
root@ubuntu:~# mkdir -p /usr/local/src/qq

# 切换目录
root@ubuntu:~# cd /usr/local/src/qq

# 下载qq的deb包
root@ubuntu:/usr/local/src/qq# wget https://down.qq.com/qqweb/LinuxQQ/linuxqq_2.0.0-b2-1089_amd64.deb

# 查看安装包文件
root@ubuntu:/usr/local/src/qq# dpkg -c linuxqq_2.0.0-b2-1089_amd64.deb
-rwxr-xr-x root/root  29108616 2021-03-18 09:42 ./usr/local/bin/qq        # 启动文件


# 启动qq (可以使用命令行启动,或者点击图图标启动)  (2.0.0-b2-1089版本好像只能扫码登陆,不能输入账号密码登陆)
root@ubuntu:/usr/local/src/qq# qq

# 安装qq
root@ubuntu:/usr/local/src/qq# dpkg -i linuxqq_2.0.0-b2-1089_amd64.deb
posted @ 2021-05-16 17:26  给文明以岁月  阅读(2947)  评论(0编辑  收藏  举报