zzupdate:單條命令升級 Ubuntu 18.04 LTS
來自專欄 Linux
Ubuntu 18.04 版本已經發布,並得到各個社區的一致好評,因為 Ubuntu 18.04 可能是 Ubuntu 多年來最令人興奮的版本。
通常情況下,Ubuntu 及其衍生版可以使用命令從一個版本升級到最新版本或者其它版本,這也是官方推薦的升級方式。
Ubuntu 18.04 特性/亮點
這次更新包含大量改進和新功能,這裡只列舉的幾個主要的。如果您想要更詳細的更新信息,請訪問 Ubuntu 18.04 官方 頁面。
- 使用 Linux 4.15 內核,提供了從上游繼承的新功能
- 它具有最新版本的 GNOME 3.28
- 它提供了與 RHEL 相似的最簡安裝選項,該選項可安裝只包含一個 web 瀏覽器和核心系統程序的基本桌面環境
- 對於新安裝,交換文件將取代默認的交換分區
- 您可以啟用 Livepatch 安裝內核更新而無需重新啟動
- 筆記本電腦在使用電池供電時會在無操作 20 分鐘後自動待機
- 不再提供 32 位的 Ubuntu 桌面安裝程序映像
注意:
- 不要忘記備份重要數據。如果升級出現問題,我們將重新安裝並恢複數據。
- 安裝所需時間取決於您的網路狀況和安裝的程序。
zzupdate 是什麼?
我們可以只通過一條命令使用 zzupdate 工具中將 Ubuntu PC/Server 從一個版本升級到另一個版本。它是一個自由開源工具,使用它不需要任何腳本知識,因為它只需要配置文件即可運行。
工具中提供兩個默認 shell 文件。setup.sh
自動安裝、更新代碼,將腳本轉換為一個簡單的 zzupdate shell 命令。zzupdate.sh
將執行版本間的升級。
如何安裝 zzupdate?
要安裝 zzupdate
,只需執行以下命令:
$ curl -s https://raw.githubusercontent.com/TurboLabIt/zzupdate/master/setup.sh | sudo sh..Installing...-------------Cloning into zzupdate...remote: Counting objects: 57, done.remote: Total 57 (delta 0), reused 0 (delta 0), pack-reused 57Unpacking objects: 100% (57/57), done.Checking connectivity... done.Already up-to-date.Setup completed!----------------See https://github.com/TurboLabIt/zzupdate for the quickstart guide.
將 Ubuntu 系統從一個版本升級到另一個版本,您不需要輸入很多命令,也不需要重新啟動,只需要運行下面的 zzupdate
命令並坐下喝杯咖啡就可以了。
請注意,當您遠程升級系統時,建議您使用以下的工具來幫助您在任何斷開連接時重新連接會話。
建議閱讀: 如何讓一個進程/命令在 SSH 連接斷開後繼續運行
如何配置 zzupdate(可選)
默認情況下,zzupdate
可以開箱即用,不需要配置任何東西。當然,如果您想要自己配置一些內容也是可以的。複製提供的示例配置文件 zzupdate.default.conf
到 zzupdate.conf
,並在 zzupdate.conf
中配置您的首選項。
$ sudo cp /usr/local/turbolab.it/zzupdate/zzupdate.default.conf /etc/turbolab.it/zzupdate.conf
打開文件,默認配置如下。
$ sudo nano /etc/turbolab.it/zzupdate.confREBOOT=1REBOOT_TIMEOUT=15VERSION_UPGRADE=1VERSION_UPGRADE_SILENT=0COMPOSER_UPGRADE=1SWITCH_PROMPT_TO_NORMAL=0
REBOOT=1
:系統在更新完成後自動重啟REBOOT_TIMEOUT=15
:重啟的默認超時值VERSION_UPGRADE=1
:執行從一個版本到另一個版本的版本升級VERSION_UPGRADE_SILENT=0
:禁用自動升級COMPOSER_UPGRADE=1
:自動升級SWITCH_PROMPT_TO_NORMAL=0
:如果值為0
,將尋找相同種類的版本升級。例如您正在運行 LTS 的版本,那麼將尋找 LTS 的版本升級,而不是用於正常版本升級。如果值為1
,那麼無論您是運行 LTS 還是正常版本,都會查找最新版本
我現在正在使用 Ubuntu 17.10 ,查看一下詳細信息。
$ cat /etc/*-releaseDISTRIB_ID=UbuntuDISTRIB_RELEASE=17.10DISTRIB_CODENAME=artfulDISTRIB_DESCRIPTION="Ubuntu 17.10"NAME="Ubuntu"VERSION="17.10 (Artful Aardvark)"ID=ubuntuID_LIKE=debianPRETTY_NAME="Ubuntu 17.10"VERSION_ID="17.10"HOME_URL="https://www.ubuntu.com/"SUPPORT_URL="https://help.ubuntu.com/"BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"VERSION_CODENAME=artfulUBUNTU_CODENAME=artful
要升級 Ubuntu 到最新版本,只需要執行以下命令:
$ sudo zzupdateO===========================================================O zzupdate - Wed May 2 17:31:16 IST 2018O===========================================================OSelf-update and update of other zzScript----------------------------------------..0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.Updating...----------Already up-to-date.Setup completed!----------------See https://github.com/TurboLabIt/zzupdate for the quickstart guide.Channel switching is disabled: using pre-existing setting---------------------------------------------------------Cleanup local cache-------------------Update available packages informations--------------------------------------Hit:1 https://download.docker.com/linux/ubuntu artful InReleaseIgn:2 http://dl.google.com/linux/chrome/deb stable InReleaseHit:3 http://security.ubuntu.com/ubuntu artful-security InReleaseHit:4 http://in.archive.ubuntu.com/ubuntu artful InReleaseHit:5 http://dl.google.com/linux/chrome/deb stable ReleaseHit:6 http://in.archive.ubuntu.com/ubuntu artful-updates InReleaseHit:7 http://in.archive.ubuntu.com/ubuntu artful-backports InReleaseHit:9 http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu artful InReleaseHit:10 http://ppa.launchpad.net/papirus/papirus/ubuntu artful InReleaseHit:11 http://ppa.launchpad.net/twodopeshaggy/jarun/ubuntu artful InRelease..UPGRADE PACKAGES----------------Reading package lists...Building dependency tree...Reading state information...Calculating upgrade...The following packages were automatically installed and are no longer required:..Interactively upgrade to a new release, if any----------------------------------------------Reading cacheChecking package managerReading package lists... DoneBuilding dependency treeReading state information... DoneIgn http://dl.google.com/linux/chrome/deb stable InReleaseHit https://download.docker.com/linux/ubuntu artful InReleaseHit http://security.ubuntu.com/ubuntu artful-security InReleaseHit http://dl.google.com/linux/chrome/deb stable ReleaseHit http://in.archive.ubuntu.com/ubuntu artful InReleaseHit http://in.archive.ubuntu.com/ubuntu artful-updates InReleaseHit http://in.archive.ubuntu.com/ubuntu artful-backports InReleaseHit http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu artful InReleaseHit http://ppa.launchpad.net/papirus/papirus/ubuntu artful InReleaseHit http://ppa.launchpad.net/twodopeshaggy/jarun/ubuntu artful InReleaseFetched 0 B in 6s (0 B/s)Reading package lists... DoneBuilding dependency treeReading state information... Done
我們需要按下回車鍵禁用第三方倉庫以繼續升級。
Updating repository informationThird party sources disabledSome third party entries in your sources.list were disabled. You canre-enable them after the upgrade with the software-properties toolor your package manager.To continue please press [ENTER]..Get:35 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [2,180 B]Get:36 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [1,644 B]Fetched 38.2 MB in 6s (1,276 kB/s)Checking package managerReading package lists... DoneBuilding dependency treeReading state information... DoneCalculating the changesCalculating the changes
開始下載 Ubuntu 18.04 LTS
軟體包,所需時間取決於您的網路狀況,一般情況下這將需要幾分鐘。
Do you want to start the upgrade?63 installed packages are no longer supported by Canonical. You canstill get support from the community.4 packages are going to be removed. 175 new packages are going to beinstalled. 1307 packages are going to be upgraded.You have to download a total of 999 M. This download will take about12 minutes with your connection.Installing the upgrade can take several hours. Once the download hasfinished, the process cannot be canceled.Continue [yN] Details [d]yFetchingGet:1 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 base-files amd64 10.1ubuntu2 [58.2 kB]Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 debianutils amd64 4.8.4 [85.7 kB]Get:3 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 bash amd64 4.4.18-2ubuntu1 [614 kB]Get:4 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 locales all 2.27-3ubuntu1 [3,612 kB]..Get:1477 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 liblouisutdml-bin amd64 2.7.0-1 [9,588 B]Get:1478 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 libtbb2 amd64 2017~U7-8 [110 kB]Get:1479 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 libyajl2 amd64 2.1.0-2build1 [20.0 kB]Get:1480 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 usb-modeswitch amd64 2.5.2+repack0-2ubuntu1 [53.6 kB]Get:1481 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 usb-modeswitch-data all 20170806-2 [30.7 kB]Get:1482 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 xbrlapi amd64 5.5-4ubuntu2 [61.8 kB]Fetched 999 MB in 6s (721 kB/s)
安裝新軟體包時,很少有服務需要重新啟動。 點擊 Yes
按鈕,它會自動重啟所需的服務。
UpgradingInhibiting until Ctrl+C is pressed...Preconfiguring packages ...Preconfiguring packages ...Preconfiguring packages ...Preconfiguring packages ...(Reading database ... 441375 files and directories currently installed.)Preparing to unpack .../base-files_10.1ubuntu2_amd64.deb ...Warning: Stopping motd-news.service, but it can still be activated by: motd-news.timerUnpacking base-files (10.1ubuntu2) over (9.6ubuntu102) ...Setting up base-files (10.1ubuntu2) ...Installing new version of config file /etc/debian_version ...Installing new version of config file /etc/issue ...Installing new version of config file /etc/issue.net ...Installing new version of config file /etc/lsb-release ...motd-news.service is a disabled or a static unit, not starting it.(Reading database ... 441376 files and directories currently installed.)..Progress: [ 80%]Progress: [ 85%]Progress: [ 90%]Progress: [ 95%]
現在刪除舊版的、系統不再需要的包。點擊 y
以刪除。
Searching for obsolete software ing package lists... 97% ding package lists... 98%Reading package lists... DoneBuilding dependency treeReading state information... DoneReading state information... 23%Reading state information... 47%Reading state information... 71%Reading state information... 94%Reading state information... DoneRemove obsolete packages?88 packages are going to be removed.Continue [yN] Details [d]y...doneRemoving perlmagick (8:6.9.7.4+dfsg-16ubuntu6) ...Removing snapd-login-service (1.23-0ubuntu1) ...Processing triggers for libc-bin (2.27-3ubuntu1) ...Processing triggers for man-db (2.8.3-2) ...Processing triggers for dbus (1.12.2-1ubuntu1) ...Fetched 0 B in 0s (0 B/s)
升級成功,需要重啟系統。點擊 y
以重啟系統。
System upgrade is complete.Restart requiredTo finish the upgrade, a restart is required.If you select y the system will be restarted.Continue [yN]y
注意: 少數情況下,會要求您確認配置文件替換以繼續安裝。
查看升級後的系統詳情:
$ cat /etc/*-releaseDISTRIB_ID=UbuntuDISTRIB_RELEASE=18.04DISTRIB_CODENAME=bionicDISTRIB_DESCRIPTION="Ubuntu 18.04 LTS"NAME="Ubuntu"VERSION="18.04 LTS (Bionic Beaver)"ID=ubuntuID_LIKE=debianPRETTY_NAME="Ubuntu 18.04 LTS"VERSION_ID="18.04"HOME_URL="https://www.ubuntu.com/"SUPPORT_URL="https://help.ubuntu.com/"BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"VERSION_CODENAME=bionicUBUNTU_CODENAME=bionic
via: https://www.2daygeek.com/zzupdate-single-command-to-upgrade-ubuntu-18-04/
作者:PRAKASH SUBRAMANIAN 選題:lujun9972 譯者:XiatianSummer 校對:wxy
本文由 LCTT 原創編譯,Linux中國 榮譽推出
推薦閱讀:
※Ubuntu 17.10(AA)發布
※怎樣刪除efi分區的Ubuntu引導呢?
※Ubuntu17.10/Ubuntu18.04配置以及美化
※ubuntu可以完全折騰成Kali Linux嗎?
※軟體該不該自繪界面而不用系統默認的界面?