zzupdate:单条命令升级 Ubuntu 18.04 LTS

简介:

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 桌面安装程序映像

注意:

  1. 不要忘记备份重要数据。如果升级出现问题,我们将重新安装并恢复数据。
  2. 安装所需时间取决于您的网络状况和安装的程序。
zzupdate 是什么?

我们可以只通过一条命令使用 zzupdate 工具中将 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 连接断开后继续运行

如何配置 zzupdate(可选)

默认情况下,zzupdate 可以开箱即用,不需要配置任何东西。当然,如果您想要自己配置一些内容也是可以的。复制提供的示例配置文件 zzupdate.default.confzzupdate.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

原文发布时间为:2018-05-27
本文作者:Prakash Subramanian
本文来自云栖社区合作伙伴“ Linux中国开源社区”,了解相关信息可以关注“ Linux中国开源社区”。
相关文章
|
Ubuntu 搜索推荐 Linux
详解Ubuntu的strings与grep命令:Linux开发的实用工具。
这就是Ubuntu中的strings和grep命令,透明且强大。我希望你喜欢这个神奇的世界,并能在你的Linux开发旅程上,通过它们找到你的方向。记住,你的电脑是你的舞台,在上面你可以做任何你想做的事,只要你敢于尝试。
559 32
|
Ubuntu 安全 Linux
CentOS与Ubuntu中防火墙配置命令集汇
有了这些,你就能遨游在 CentOS 和 Ubuntu 的海洋中,频繁地改变你的防火墙设置,快速地应对各种安全威胁,同时也能保证你的系统可以正常工作。出发吧,勇敢的编程者,随着这些命令集的涌动,扬帆起航,走向安全的网络世界!
456 5
|
Ubuntu 安全 调度
在Ubuntu下安装Debian包:dpkg与apt命令的深度解构。
安装Debian包的知识,就像掌握了海上的航行技术,虽然起初会让人感到陌生甚至困惑,但只要你积累熟练,就能在Ubuntu的世界里畅游无阻。就像每一位成功的航海家,掌握好这些工具,去探索属于你的Ubuntu新世界吧!
620 21
|
Ubuntu Linux
Ubuntu中dpkg和apt命令:debian包安装详解
希望这让你对于Ubuntu中的dpkg和apt命令有了更为清晰的理解。下次你面对软件包安装的问题,就可以轻松应对,优雅地在你的Linux系统中游刃有余了。
1731 10
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
1782 25
|
Ubuntu NoSQL Linux
《docker基础篇:3.Docker常用命令》包括帮助启动类命令、镜像命令、有镜像才能创建容器,这是根本前提(下载一个CentOS或者ubuntu镜像演示)、容器命令、小总结
《docker基础篇:3.Docker常用命令》包括帮助启动类命令、镜像命令、有镜像才能创建容器,这是根本前提(下载一个CentOS或者ubuntu镜像演示)、容器命令、小总结
754 6
《docker基础篇:3.Docker常用命令》包括帮助启动类命令、镜像命令、有镜像才能创建容器,这是根本前提(下载一个CentOS或者ubuntu镜像演示)、容器命令、小总结
|
Ubuntu
ubuntu和debian 的安装包dpkg管理命令对安装包进行安装,查询,卸载
Ubuntu dpkg 软件包管理命令概览:安装、卸载、查看和配置软件包。包括解决依赖、强制卸载、列出及过滤已安装包、查看包详情等操作。
934 10
|
Ubuntu 安全 Linux
基于Ubuntu24.04原内核6.8.0升级到6.9.0
通过上述步骤,我们在Ubuntu 24.04系统上成功地将内核从6.8.0升级到了6.9.0。升级内核有助于提高系统的安全性和性能,但也可能带来兼容性问题。因此,在升级前备份重要数据,并确保新内核支持所需的所有硬件和软件。通过合理的验证和测试,可以确保系统在新内核上稳定运行。
2690 6
|
Ubuntu 网络协议 关系型数据库
超聚变服务器2288H V6使用 iBMC 安装 Ubuntu Server 24.04 LTS及后续系统配置
【11月更文挑战第15天】本文档详细介绍了如何使用iBMC在超聚变服务器2288H V6上安装Ubuntu Server 24.04 LTS,包括连接iBMC管理口、登录iBMC管理界面、配置RAID、安装系统以及后续系统配置等步骤。
5058 4
|
Ubuntu Linux 网络安全
Ubuntu 22.04 LTS有哪些新特性
Ubuntu 22.04 LTS有哪些新特性