歡迎光臨
每天分享高質量文章

zzupdate:單條命令升級 Ubuntu 18.04 LTS | Linux 中國

我們可以只通過一條命令使用 zzupdate 工具中將 Ubuntu PC/Server 從一個版本升級到另一個版本。
— Prakash Subramanian


致謝
編譯自 | https://www.2daygeek.com/zzupdate-single-command-to-upgrade-ubuntu-18-04/ 
 作者 | Prakash Subramanian
 譯者 | XiatianSummer ? ? 共計翻譯:2 篇 貢獻時間:154 天

Ubuntu 18.04 版本已經釋出,並得到各個社群的一致好評,因為 Ubuntu 18.04 可能是 Ubuntu 多年來最令人興奮的版本。

通常情況下,Ubuntu 及其衍生版可以使用命令從一個版本升級到最新版本或者其它版本,這也是官方推薦的升級方式。

Ubuntu 18.04 特性/亮點

這次更新包含大量改進和新功能,這裡只列舉的幾個主要的。如果您想要更詳細的更新資訊,請訪問 Ubuntu 18.04 官方[1] 頁面。

◈ 使用 Linux 4.15 核心,提供了從上游繼承的新功能
◈ 它具有最新版本的 GNOME 3.28
◈ 它提供了與 RHEL 相似的最簡安裝選項,該選項可安裝只包含一個 web 瀏覽器和核心繫統程式的基本桌面環境
◈ 對於新安裝,交換檔案將取代預設的交換分割槽
◈ 您可以啟用 Livepatch 安裝核心更新而無需重新啟動
◈ 膝上型電腦在使用電池供電時會在無操作 20 分鐘後自動待機
◈ 不再提供 32 位的 Ubuntu 桌面安裝程式映像

註意:

☉ 不要忘記備份重要資料。如果升級出現問題,我們將重新安裝並恢復資料。
☉ 安裝所需時間取決於您的網路狀況和安裝的程式。

zzupdate 是什麼?

我們可以只通過一條命令使用 zzupdate[2] 工具中將 Ubuntu PC/Server 從一個版本升級到另一個版本。它是一個自由開源工具,使用它不需要任何指令碼知識,因為它只需要配置檔案即可執行。

工具中提供兩個預設 shell 檔案。setup.sh 自動安裝、更新程式碼,將指令碼轉換為一個簡單的 zzupdate shell 命令。zzupdate.sh 將執行版本間的升級。

如何安裝 zzupdate?

要安裝 zzupdate,只需執行以下命令:

  1. $ curl -s https://raw.githubusercontent.com/TurboLabIt/zzupdate/master/setup.sh | sudo sh

  2. .

  3. .

  4. Installing...

  5. -------------

  6. Cloning into 'zzupdate'...

  7. remote: Counting objects: 57, done.

  8. remote: Total 57 (delta 0), reused 0 (delta 0), pack-reused 57

  9. Unpacking objects: 100% (57/57), done.

  10. Checking connectivity... done.

  11. Already up-to-date.

  12. Setup completed!

  13. ----------------

  14. See https://github.com/TurboLabIt/zzupdate for the quickstart guide.

將 Ubuntu 系統從一個版本升級到另一個版本,您不需要輸入很多命令,也不需要重新啟動,只需要執行下麵的 zzupdate 命令並坐下喝杯咖啡就可以了。

請註意,當您遠端升級系統時,建議您使用以下的工具來幫助您在任何斷開連線時重新連線會話。

建議閱讀: 如何讓一個行程/命令在 SSH 連線斷開後繼續執行[3]

如何配置 zzupdate(可選)

預設情況下,zzupdate 可以開箱即用,不需要配置任何東西。當然,如果您想要自己配置一些內容也是可以的。複製提供的示例配置檔案 zzupdate.default.conf 到 zzupdate.conf,併在 zzupdate.conf 中配置您的首選項。

  1. $ sudo cp /usr/local/turbolab.it/zzupdate/zzupdate.default.conf /etc/turbolab.it/zzupdate.conf

開啟檔案,預設配置如下。

  1. $ sudo nano /etc/turbolab.it/zzupdate.conf

  2. REBOOT=1

  3. REBOOT_TIMEOUT=15

  4. VERSION_UPGRADE=1

  5. VERSION_UPGRADE_SILENT=0

  6. COMPOSER_UPGRADE=1

  7. SWITCH_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 ,檢視一下詳細資訊。

  1. $ cat /etc/*-release

  2. DISTRIB_ID=Ubuntu

  3. DISTRIB_RELEASE=17.10

  4. DISTRIB_CODENAME=artful

  5. DISTRIB_DESCRIPTION="Ubuntu 17.10"

  6. NAME="Ubuntu"

  7. VERSION="17.10 (Artful Aardvark)"

  8. ID=ubuntu

  9. ID_LIKE=debian

  10. PRETTY_NAME="Ubuntu 17.10"

  11. VERSION_ID="17.10"

  12. HOME_URL="https://www.ubuntu.com/"

  13. SUPPORT_URL="https://help.ubuntu.com/"

  14. BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

  15. PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

  16. VERSION_CODENAME=artful

  17. UBUNTU_CODENAME=artful

要升級 Ubuntu 到最新版本,只需要執行以下命令:

  1. $ sudo zzupdate

  2. O===========================================================O

  3. zzupdate - Wed May 2 17:31:16 IST 2018

  4. O===========================================================O

  5. Self-update and update of other zzScript

  6. ----------------------------------------

  7. .

  8. .

  9. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

  10. Updating...

  11. ----------

  12. Already up-to-date.

  13. Setup completed!

  14. ----------------

  15. See https://github.com/TurboLabIt/zzupdate for the quickstart guide.

  16. Channel switching is disabled: using pre-existing setting

  17. ---------------------------------------------------------

  18. Cleanup local cache

  19. -------------------

  20. Update available packages informations

  21. --------------------------------------

  22. Hit:1 https://download.docker.com/linux/ubuntu artful InRelease

  23. Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease

  24. Hit:3 http://security.ubuntu.com/ubuntu artful-security InRelease

  25. Hit:4 http://in.archive.ubuntu.com/ubuntu artful InRelease

  26. Hit:5 http://dl.google.com/linux/chrome/deb stable Release

  27. Hit:6 http://in.archive.ubuntu.com/ubuntu artful-updates InRelease

  28. Hit:7 http://in.archive.ubuntu.com/ubuntu artful-backports InRelease

  29. Hit:9 http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu artful InRelease

  30. Hit:10 http://ppa.launchpad.net/papirus/papirus/ubuntu artful InRelease

  31. Hit:11 http://ppa.launchpad.net/twodopeshaggy/jarun/ubuntu artful InRelease

  32. .

  33. .

  34. UPGRADE PACKAGES

  35. ----------------

  36. Reading package lists...

  37. Building dependency tree...

  38. Reading state information...

  39. Calculating upgrade...

  40. The following packages were automatically installed and are no longer required:

  41. .

  42. .

  43. Interactively upgrade to a new release, if any

  44. ----------------------------------------------

  45. Reading cache

  46. Checking package manager

  47. Reading package lists... Done

  48. Building dependency tree

  49. Reading state information... Done

  50. Ign http://dl.google.com/linux/chrome/deb stable InRelease

  51. Hit https://download.docker.com/linux/ubuntu artful InRelease

  52. Hit http://security.ubuntu.com/ubuntu artful-security InRelease

  53. Hit http://dl.google.com/linux/chrome/deb stable Release

  54. Hit http://in.archive.ubuntu.com/ubuntu artful InRelease

  55. Hit http://in.archive.ubuntu.com/ubuntu artful-updates InRelease

  56. Hit http://in.archive.ubuntu.com/ubuntu artful-backports InRelease

  57. Hit http://ppa.launchpad.net/notepadqq-team/notepadqq/ubuntu artful InRelease

  58. Hit http://ppa.launchpad.net/papirus/papirus/ubuntu artful InRelease

  59. Hit http://ppa.launchpad.net/twodopeshaggy/jarun/ubuntu artful InRelease

  60. Fetched 0 B in 6s (0 B/s)

  61. Reading package lists... Done

  62. Building dependency tree

  63. Reading state information... Done

我們需要按下回車鍵禁用第三方倉庫以繼續升級。

  1. Updating repository information

  2. Third party sources disabled

  3. Some third party entries in your sources.list were disabled. You can

  4. re-enable them after the upgrade with the 'software-properties' tool

  5. or your package manager.

  6. To continue please press [ENTER]

  7. .

  8. .

  9. Get:35 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe i386 Packages [2,180 B]

  10. Get:36 http://in.archive.ubuntu.com/ubuntu bionic-updates/universe Translation-en [1,644 B]

  11. Fetched 38.2 MB in 6s (1,276 kB/s)

  12. Checking package manager

  13. Reading package lists... Done

  14. Building dependency tree

  15. Reading state information... Done

  16. Calculating the changes

  17. Calculating the changes

開始下載 Ubuntu 18.04 LTS 軟體包,所需時間取決於您的網路狀況,一般情況下這將需要幾分鐘。

  1. Do you want to start the upgrade?

  2. 63 installed packages are no longer supported by Canonical. You can

  3. still get support from the community.

  4. 4 packages are going to be removed. 175 new packages are going to be

  5. installed. 1307 packages are going to be upgraded.

  6. You have to download a total of 999 M. This download will take about

  7. 12 minutes with your connection.

  8. Installing the upgrade can take several hours. Once the download has

  9. finished, the process cannot be canceled.

  10. Continue [yN] Details [d]y

  11. Fetching

  12. Get:1 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 base-files amd64 10.1ubuntu2 [58.2 kB]

  13. Get:2 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 debianutils amd64 4.8.4 [85.7 kB]

  14. Get:3 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 bash amd64 4.4.18-2ubuntu1 [614 kB]

  15. Get:4 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 locales all 2.27-3ubuntu1 [3,612 kB]

  16. .

  17. .

  18. Get:1477 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 liblouisutdml-bin amd64 2.7.0-1 [9,588 B]

  19. Get:1478 http://in.archive.ubuntu.com/ubuntu bionic/universe amd64 libtbb2 amd64 2017~U7-8 [110 kB]

  20. Get:1479 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 libyajl2 amd64 2.1.0-2build1 [20.0 kB]

  21. Get:1480 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 usb-modeswitch amd64 2.5.2+repack0-2ubuntu1 [53.6 kB]

  22. Get:1481 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 usb-modeswitch-data all 20170806-2 [30.7 kB]

  23. Get:1482 http://in.archive.ubuntu.com/ubuntu bionic/main amd64 xbrlapi amd64 5.5-4ubuntu2 [61.8 kB]

  24. Fetched 999 MB in 6s (721 kB/s)

安裝新軟體包時,很少有服務需要重新啟動。 點選 Yes 按鈕,它會自動重啟所需的服務。

  1. Upgrading

  2. Inhibiting until Ctrl+C is pressed...

  3. Preconfiguring packages ...

  4. Preconfiguring packages ...

  5. Preconfiguring packages ...

  6. Preconfiguring packages ...

  7. (Reading database ... 441375 files and directories currently installed.)

  8. Preparing to unpack .../base-files_10.1ubuntu2_amd64.deb ...

  9. Warning: Stopping motd-news.service, but it can still be activated by:

  10. motd-news.timer

  11. Unpacking base-files (10.1ubuntu2) over (9.6ubuntu102) ...

  12. Setting up base-files (10.1ubuntu2) ...

  13. Installing new version of config file /etc/debian_version ...

  14. Installing new version of config file /etc/issue ...

  15. Installing new version of config file /etc/issue.net ...

  16. Installing new version of config file /etc/lsb-release ...

  17. motd-news.service is a disabled or a static unit, not starting it.

  18. (Reading database ... 441376 files and directories currently installed.)

  19. .

  20. .

  21. Progress: [ 80%]

  22. Progress: [ 85%]

  23. Progress: [ 90%]

  24. Progress: [ 95%]

現在刪除舊版的、系統不再需要的包。點選 y 以刪除。

  1. Searching for obsolete software

  2. ing package lists... 97%

  3. ding package lists... 98%

  4. Reading package lists... Done

  5. Building dependency tree

  6. Reading state information... Done

  7. Reading state information... 23%

  8. Reading state information... 47%

  9. Reading state information... 71%

  10. Reading state information... 94%

  11. Reading state information... Done

  12. Remove obsolete packages?

  13. 88 packages are going to be removed.

  14. Continue [yN] Details [d]y

  15. .

  16. .

  17. .

  18. done

  19. Removing perlmagick (8:6.9.7.4+dfsg-16ubuntu6) ...

  20. Removing snapd-login-service (1.23-0ubuntu1) ...

  21. Processing triggers for libc-bin (2.27-3ubuntu1) ...

  22. Processing triggers for man-db (2.8.3-2) ...

  23. Processing triggers for dbus (1.12.2-1ubuntu1) ...

  24. Fetched 0 B in 0s (0 B/s)

升級成功,需要重啟系統。點選 y 以重啟系統。

  1. System upgrade is complete.

  2. Restart required

  3. To finish the upgrade, a restart is required.

  4. If you select 'y' the system will be restarted.

  5. Continue [yN]y

註意: 少數情況下,會要求您確認配置檔案替換以繼續安裝。

檢視升級後的系統詳情:

  1. $ cat /etc/*-release

  2. DISTRIB_ID=Ubuntu

  3. DISTRIB_RELEASE=18.04

  4. DISTRIB_CODENAME=bionic

  5. DISTRIB_DESCRIPTION="Ubuntu 18.04 LTS"

  6. NAME="Ubuntu"

  7. VERSION="18.04 LTS (Bionic Beaver)"

  8. ID=ubuntu

  9. ID_LIKE=debian

  10. PRETTY_NAME="Ubuntu 18.04 LTS"

  11. VERSION_ID="18.04"

  12. HOME_URL="https://www.ubuntu.com/"

  13. SUPPORT_URL="https://help.ubuntu.com/"

  14. BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

  15. PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"

  16. VERSION_CODENAME=bionic

  17. UBUNTU_CODENAME=bionic


via: https://www.2daygeek.com/zzupdate-single-command-to-upgrade-ubuntu-18-04/

作者:PRAKASH SUBRAMANIAN[5] 選題:lujun9972 譯者:XiatianSummer 校對:wxy

本文由 LCTT 原創編譯,Linux中國 榮譽推出

贊(0)

分享創造快樂

© 2024 知識星球   網站地圖