前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >如何升级 Debian 9 (Stretch) 到 Debian 10 (Buster)

如何升级 Debian 9 (Stretch) 到 Debian 10 (Buster)

作者头像
DPCloudX
修改2019-07-26 17:43:55
1.8K0
修改2019-07-26 17:43:55
举报
文章被收录于专栏:bebianbebian

Buster Full Upgrade

Before we move on with the upgrade, let's fully upgrade our current Debian Jessie system:

代码语言:javascript
复制
# apt-get update
# apt-get upgrade
# apt-get dist-upgrade

If everything went smoothly, perform database sanity and consistency checks for partially installed, missing and obsolete packages:

代码语言:javascript
复制
# dpkg -C

If no issues are reported, check what packages are held back:

代码语言:javascript
复制
# apt-mark showhold

PackagesOn Holdwill not be upgraded, which may cause inconsistencies after Buster upgrade. Before you move to the next part, it is recommended to fix all issues produced by both above commands. The following command might be of a further assistance:

代码语言:javascript
复制
# dpkg --audit

Update Package Repository to Debian Buster

Now, that we have a current system fully upgraded, it is time to re-synchronize the package index files with new Debian Buster sources. This is done by editing/etc/apt/sources.listfile to includeDebianstretchpackage repository. First, make a backup the current/etc/apt/sources.list:

代码语言:javascript
复制
# cp /etc/apt/sources.list /etc/apt/sources.list_backup

Executeapt edit-sourcesor use your favourite text editor e.g.,VIMto modify a current/etc/apt/sources.listfile to include stretch repositories. Simply update keywordstretchtobuster.

Example:

代码语言:javascript
复制
FROM STRECTH:
deb http://httpredir.debian.org/debian stretch main
deb http://httpredir.debian.org/debian stretch-updates main
deb http://security.debian.org stretch/updates main

TO BUSTER:
deb http://httpredir.debian.org/debian buster main
deb http://httpredir.debian.org/debian buster-updates main
deb http://security.debian.org buster/updates main

Alternatively, use asedcommand to automate this tedious task:

代码语言:javascript
复制
# sed -i 's/stretch/buster/g' /etc/apt/sources.list

Once the above/etc/apt/sources.listfile edit is completed, useapt-getcommand to update packages index:

代码语言:javascript
复制
# apt update

Upgrade to Debian Buster Simulation

Before we hit the UPGRADE button, let's useaptcommand to see a preview of what we are facing. To do this executeapt list --upgradablecommand in order to get a quick survey of the number of packages to be installed, updated and removed without affecting the system.

代码语言:javascript
复制
# apt list --upgradable

Upgrade to Debian Buster

We have come to the most exciting part, which is the actual Stretch upgrade to Debian Buster system. During the upgrade you may be asked:

There are services installed on your system which need to be restarted when certain libraries, such as libpam, libc, and libssl, are upgraded. Since these restarts may cause interruptions of service for the system, you will normally be prompted on each upgrade for the list of services you wish to restart. You can choose this option to avoid being prompted; instead, all necessary restarts will be done for you automatically so you can avoid being asked questions on each library upgrade. Restart services during package upgrades without asking?

The choice is about whether you wish the system to restart your services automatically during the system upgrade or you wish to do it manually or after the system is fully upgrade to Buster. When ready, execute the bellow commands to commence the Debian Buster upgrade process:

代码语言:javascript
复制
# apt-get upgrade
# apt-get dist-upgrade

At this stage you should have your Stretch Debian Linux system fully upgraded to Debian Buster 10. Follow, this guide tocheck your current Debian version. Once again check for obsolete packages so there are no surprises down the track:

代码语言:javascript
复制
# aptitude search '~i(!~ODebian)'

Congratulations to your fully upgraded Debian 9 Stretch Linux system.

代码语言:javascript
复制
apt dist-upgrade

现在您可以从Debian系统中删除过时/不需要的软件包。

代码语言:javascript
复制
apt autoremove

apt clean

最后,重新启动系统。

代码语言:javascript
复制
shutdown -r now

检查您的Debian版本。

代码语言:javascript
复制
lsb_release -a

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Buster Full Upgrade
  • Update Package Repository to Debian Buster
  • Upgrade to Debian Buster Simulation
  • Upgrade to Debian Buster
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档