介绍操作系统的最新长期支持(LTS)版本18.04(2018年4月26日发布)

日期: 栏目:文章分享 浏览:426 评论:0

介绍

该操作系统的最新长期支持 (LTS) 版本 18.04( ) 于 2018 年 4 月 26 日发布。本教程将说明如何将 16.04 或更高版本的系统升级到 1 8.04.

警告:与操作系统主要版本之间的几乎所有升级一样,此过程存在系统故障、数据丢失或软件配置损坏的风险。强烈建议进行完整备份和测试后升级。为避免这些问题Chrome 自动升级后,本地项目都无法访问,我们建议将项目直接迁移到新的 18.04 服务器,而不是升级。

准备

本教程假设您使用的是配置了 sudo 的非 root 用户 16.04 或更高版本的系统。没有服务器的同学可以在这里购买,但我个人建议大家使用免费的腾讯云开发者实验室进行测试,学习安装后再购买服务器。

第一步,备份系统

在尝试对任何系统进行重大升级之前,您应该确保在升级失败时不会丢失数据。最好的方法是备份整个文件系统。如果做不到这一点Chrome 自动升级后,本地项目都无法访问,请确保您备份了由用户主目录、自定义配置文件和关系数据库等服务存储的数据。在腾讯云 CVM 上,一种方法是关闭系统并创建快照(关闭电源确保文件系统一致)。确认更新成功后,您可以删除快照,不再收取存储费用。

第 2 步:更新当前安装的软件包

在开始版本升级之前,将当前版本中的所有包更新到最新版本是最安全的。首先更新包列表:

sudo apt-get update

接下来,将安装的软件包升级到最新版本:

sudo apt-get upgrade

您将看到升级列表并被提示继续。回答 y 表示是,然后按 Enter。

此过程可能需要一些时间。完成后,使用 apt-get 的 dist-,它将执行任何其他涉及更改依赖项、根据需要添加或删除新包的升级。

sudo apt-get dist-upgrade

同样,在提示继续时回答 y,然后等待升级完成。现在您已经安装了最新的软件包,您可以使用 do-- to 18.04。

页面访问升级自动跳转中心_Chrome 自动升级后,本地项目都无法访问_关闭chrome自动升级

第三步,使用do--tool升级

可以通过更改 Apt /etc/apt/.list(指定软件包存储库)和 apt-get dist(用于执行升级本身)来升级版本。但是提供了一个工具do--,这使得升级更安全、更容易。

do-- 处理检查新版本、更新 .list 和一堆其他任务。

第一次运行做--:

sudo do-release-upgrade

如果新版本还没有正式发布,可能会得到如下输出:

Checking for a new Ubuntu release
No new release found

如果是这种情况,请添加 -d 选项以升级到开发版本:

Chrome 自动升级后,本地项目都无法访问_页面访问升级自动跳转中心_关闭chrome自动升级

sudo do-release-upgrade -d

如果您通过 SSH 连接到系统,系统将询问您是否要继续。对于虚拟机或托管服务器,您应该记住,丢失 SSH 连接是一种风险,尤其是在您没有其他方法可以远程连接到系统控制台的情况下。请记住,主要的操作系统升级只有在您可以直接物理访问机器时才最安全。

在提示符下,键入 y 并按 Enter 继续:

Reading cache
​
Checking package manager
​
Continue running under SSH?
​
This session appears to be running under ssh. It is not recommended
to perform a upgrade over ssh currently because in case of failure it
is harder to recover.
​
If you continue, an additional ssh daemon will be started at port
'1022'.
Do you want to continue?
​
Continue [yN] y

接下来,您将被告知 do-- 正在端口 1022 上启动一个新的 sshd 实例:

Starting additional sshd
​
To make recovery in case of failure easier, an additional sshd will
be started on port '1022'. If anything goes wrong with the running
ssh you can still connect to the additional one.
If you run a firewall, you may need to temporarily open this port. As
this is potentially dangerous it's not done automatically. You can
open the port with e.g.:
'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT'
​
To continue please press [ENTER]

按 Enter。接下来,您可能会收到未找到镜像条目的警告。在腾讯云系统上,忽略此警告并继续升级是安全的,因为 18.04 的本地镜像实际上是可用的。输入 y:

Updating repository information
​
No valid mirror found
​
While scanning your repository information no mirror entry for the
upgrade was found. This can happen if you run an internal mirror or
if the mirror information is out of date.
​
Do you want to rewrite your 'sources.list' file anyway? If you choose
'Yes' here it will update all 'xenial' to 'bionic' entries.
If you select 'No' the upgrade will cancel.
​
Continue [yN] y

Chrome 自动升级后,本地项目都无法访问_页面访问升级自动跳转中心_关闭chrome自动升级

下载新的包列表并计算更改,系统会询问您是否要开始升级。再次输入 y 继续:

Do you want to start the upgrade?
​
​
6 installed packages are no longer supported by Canonical. You can
still get support from the community.
​
9 packages are going to be removed. 104 new packages are going to be
installed. 399 packages are going to be upgraded.
​
You have to download a total of 232 M. This download will take about
46 seconds with your connection.
​
Installing the upgrade can take several hours. Once the download has
finished, the process cannot be canceled.
​
 Continue [yN]  Details [d]y

系统现在将检索、解压缩并安装新软件包。即使您的系统处于快速连接状态,也需要一段时间。

在安装过程中,您可能会收到包含各种问题的交互式对话框。例如,可能会询问您是否要在需要时自动重新启动服务:

在这种情况下,回答“是”。在其他情况下,可能会询问您是否要替换修改后的配置文件。这通常是一个判断电话,可能需要有关本教程范围之外的特定软件的知识。

安装新软件包后,系统将询问您是否准备好删除过时的软件包。在没有自定义配置的库存系统上,在此处输入 y。在您大量修改过的系统上,您可能需要键入 d 并检查要删除的软件包列表,以防它包含您以后需要重新安装的任何内容。

Remove obsolete packages?
​
​
53 packages are going to be removed.
​
 Continue [yN]  Details [d]y

最后,一切顺利,您将被告知升级已完成,需要重新启动。输入 y 继续:

关闭chrome自动升级_Chrome 自动升级后,本地项目都无法访问_页面访问升级自动跳转中心

System upgrade is complete.
​
Restart required
​
To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.
​
Continue [yN] y

在 SSH 会话中,您可能会看到类似以下内容,您的 SSH 会话将在服务器端终止。:

Connection to 203.0.113.241 closed by remote host.
Connection to 203.0.113.241 closed.

等待服务器重新启动,然后重新连接。登录后,您应该会收到一条消息,

Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-19-generic x86_64)

综上所述

你现在已经学会了升级。您可能希望查看新系统的服务和已部署应用程序的必要配置更改。更多Linux教程,请前往腾讯云+社区了解更多。

参考:“如何做 18.04”

标签:

评论留言

我要留言

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。发布前请先查看评论规则:点我查看