9

升级Debian到Scretch

 3 years ago
source link: https://note.qidong.name/2017/06/27/debian-upgrade-scretch/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

升级Debian到Scretch

2017-06-27 14:55:47 +08  字数:890  标签: Linux

2017年6月17日,Debian 9.0,代号Stretch,正式发布

Stretch专门献给于2015年12月28日在美国离奇死亡的项目创始人Ian Murdock

Debian 9 is dedicated to the project’s founder Ian Murdock, who passed away on 28 December 2015.

从Jessie到Stretch,从8到9, 除了与大多数普通用户无关的新增架构mips64el, 没有根本性的改变。

主要是软件更新,然而这也就足够了。

更新的原理

Debian的更新,本质上是对内核、软件、依赖库的更新。

从可靠的Debian源的Stretch里,下载相关软件包,安装到当前电脑上 ——这样就算更新完成了。

另一种方案是下载DVD镜像,mnt到本地,做成本地源。 网络不稳定的情况下,适合用这种办法,这里不做介绍。

更新源

为了确保得到Stretch的稳定内容,推荐使用官方中国源。

deb ftp://ftp.cn.debian.org/debian/ stretch main #contrib non-free
deb-src ftp://ftp.cn.debian.org/debian/ stretch main #contrib non-free

用以上内容替换原/etc/apt/sources.list,并且确保下面的apt的更新成功完成。

sudo apt-get update

切换到真正的终端

Ctrl+Alt+F2,可以切换到终端TTY2上去。

使用真正的终端,而非Terminal这种终端仿真器, 是为了让过程更可靠,重启也更方便。

否则,更新过程可能会卡得你痛不欲生!

更新软件包

推荐先做小更(Minimal system upgrade),再做大更(the main part of the upgrade)。

sudo apt-get upgrade

期间,因网络问题,upgrade执行时发生部分包丢失。

E: Unable to fetch some archives, maybe run apt-get update or try with –fix-missing?

使用--fix-missing参数重新执行,可以解决该问题。

成功完成后,再执行大更。

sudo apt-get dist-upgrade

(可能也会有--fix-missing的问题。)

取决于网络,以上两个过程,可能会消耗数小时。

手动更新内核

sudo apt-get install linux-image-amd64

当然,对高手来说,也可以选择自行编译一个Linux Kernel。

重启,然后检验

sudo reboot

重新登录后,执行:

$ uname -a
Linux debian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2 (2017-06-12) x86_64 GNU/Linux

新版本的Debian,虽然大的变化没有,但是在小的细节方面,还是有很多改进。

当然,也有一些小麻烦,比如Vim可能需要重新编译一下。

参考

推荐使用官方的更新文档:Release Notes for Debian 9 (stretch), 64-bit PC

本文主要参考其中的Chapter 4. Upgrades from Debian 8 (jessie)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK