- Debian與Ubuntu簡介
- Ubuntu Server 版安裝及使⽤
- Ubuntu Server18.04 TLS版本安裝
- Ubuntu Server20.04 TLS版本安裝
- Ubuntu Server系統基礎配置
- Ubuntu軟件包管理
- ubuntu20桌面版安裝軟件
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://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/
Ubuntu歷史發⾏版本
-
Ubuntu 沒有像其它軟件⼀樣有 1.0 版本,是因為其第⼀個版本是發布於2004 年,所以Ubuntu的⽣⽇是2004年的10⽉20⽇。
-
ubuntu的版本號有個固定的特征,其使⽤⼀個形容詞和⼀個動物名稱組成,並且形容詞和名詞的⾸字⺟都是⼀致的,Ubuntu版本的命名規則是根據正式版發布的年⽉命名,Ubuntu 16.04 也就意味着 2016年4⽉發布的Ubuntu,研發⼈員與⽤⼾可從版本號碼就知道正式發布的時間。
-
每兩年的 4 ⽉份,都會推出⼀個⻓期⽀持版本(LTS),其⽀持期⻓達五年,⽽⾮ LTS 版本的⽀持期通常只有半年。
- Ubuntu歷史版本⼀覽表: https://baike.baidu.com/item/ubuntu
名稱格式是一個形容詞一個動物,這樣組成
版本 | 別名 | 發布⽇期 |
---|---|---|
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與雲環境
-
地址:https://cn.ubuntu.com/cloud
- 雲計算的標准操作系統
- 70%的公有雲工作負載和54%的OpenStack雲
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 新增功能
-
由 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 新增功能
-
由Canonical提供9個⽉的⽀持 Linux 5.3內核
-
更新為qemu(v4.0),libvirt(v5.4),mysql(v8.0),postgresql(v11)等
-
新的修復程序集和對Ubuntu Server安裝程序的刷新
-
新的Ubuntu優勢體驗
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的歷史版本更新記錄: https://github.com/moby/moby/blob/master/CHANGELOG.md
企業級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鏡像下載
-
ubuntu server(服務器版): http://cdimage.ubuntu.com/releases/
-
ubuntu desktop(桌⾯版): http://releases.ubuntu.com/
系統鏡像版本區別
-
地址: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 18.04服務器版本和桌⾯版的安裝介紹
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的速率
- 該模式的必要條件:
- 特點:不需要任何特別的switch(交換機)⽀持的通道bonding。在每個slave上根據當前的負載(根據速度計算)分配外出流量。如果正在接受數據的slave出故障了,另⼀個slave接管失敗的slave的MAC地址。
-
第七種模式: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
修改軟件倉庫
-
阿⾥雲倉庫地址:https://opsx.alibaba.com/mirror
-
清華⼤學:https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/
- 在幫助里面選ubuntu版本,他支持很多版本都是LTS的,不要把鏡像源版本配錯了,否者有可能會有安裝包不兼容的問題
- 18.04 LTS
- 在幫助里面選ubuntu版本,他支持很多版本都是LTS的,不要把鏡像源版本配錯了,否者有可能會有安裝包不兼容的問題
# 編輯配置文件,把代碼配置到文件中(把里面官方的源地址全部刪除掉,放入清華大學的鏡像源地址)
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手冊
-
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
源碼安裝
-
github項目地址: https://github.com/man-pages-zh/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