How to upgrade Debian 8 Jessie to Debian 9 Stretch

Objective

This article explains a system upgrade procedure from Debian 8 Jessie Linux to Debian 9 Stretch.

What's New

Apart from the up to date Linux kernel, Stretch comes with a considerable amount of new and updated software as well as a number of packages had been rendered obsolete:

This new release of Debian again comes with a lot more software than its predecessor jessie; the distribution includes over 15346 new packages, for a total of over 51687 packages. Most of the software in the distribution has been updated: over 29859 software packages (this is 57% of all packages in jessie). Also, a significant number of packages (over 6739, 13% of the packages in jessie) have for various reasons been removed from the distribution. 
SOURCEdebian.org

Preparations

Given that the Debian is an extremely robust Linux distribution, combined with the fact that there is nothing certain in life, the chances are, that after the upgrade you may end up with a broken system. Therefore, it is necessary to point out that no system upgrade is bulletproof and you should discuss, prepare and possibly test any proper failover or recovery process prior the proposed system upgrade to Debian Stretch. The rule of thumb is, the less software installed on your system, the higher chance for a successful upgrade.

The chances for a successful and fully functional upgrade are decreased by a number of 3rd-party packages installed on your current system. From this reason, remove any obsolete standard repository and 3rd-party software before you attempt the upgrade. The command which might be helpful here is:

# aptitude search '~o'

The above command will list all packages which are no longer in a standard repository list since they were removed; thus they were rendered obsolete, or the packages were installed manually.

Perform a full backup of data and manual configuration files residing on your current system. For example, these may include but not limited to user home directories, databases, websites, etc. In case you run Debian Linux virtually take a snapshot just in case something goes wrong during the Stretch upgrade.

Warning:

MariaDB replaces MySQL database in Debian 9 Stretch. This introduces a new database binary data file format which is not backwards compatible with your current ( Debian 8 Jessie ) database format. During the upgrade your databases will be upgraded automatically. However, when you run into some issues during or after the upgrade, you will not be able revert back! From this reason it is important to backup all your current databases before you proceed with a Debian 9 Stretch upgrade!
REFERENCEdebian.org

Jessie Full Upgrade

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

# 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:

# dpkg -C

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

# apt-mark showhold

Packages On Hold will not be upgraded, which may cause inconsistencies after Stretch upgrade. Before you move to the next part, it is recommended to fix all issues produced by both above commands.

Update Package Repository to Debian Stretch

Now, that we have a current system fully upgraded, it is time to resynchronize the package index files with new Debian Stretch sources. This is done by editing /etc/apt/sources.list file to include Debian stretch package repository. First, make a backup the current /etc/apt/sources.list:

# cp /etc/apt/sources.list /etc/apt/sources.list_backup

Execute apt edit-sources or use your favourite text editor e.g., VIM to modify a current /etc/apt/sources.list file to include stretch repositories. Simply update keyword jessie to stretch.

Example:

deb https://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ stretch main contrib non-free deb https://mirrors.ustc.edu.cn/debian/ stretch-updates main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ stretch-updates main contrib non-free deb https://mirrors.ustc.edu.cn/debian/ stretch-backports main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian/ stretch-backports main contrib non-free deb https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free
deb-src https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free

Alternatively, use a sed command to automate this tedious task:

# sed -i 's/jessie/stretch/g' /etc/apt/sources.list

Once the above /etc/apt/sources.list file edit is completed, use apt-get command to update packages index:

# apt-get update

Upgrade to Debian Stretch Simulation

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

# apt list --upgradable

Upgrade to Debian Stretch

We have come to the most exciting part, which is the actual Jessie upgrade to Debian Stretch 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 Stretch. When ready, execute the bellow commands to commence the Debian Stretch upgrade process:

# apt-get upgrade
# apt-get dist-upgrade

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

# aptitude search '~o'

Congratulations to your fully upgraded Debian 9 Stretch Linux system.

 
 

Debian 8 升级到 9 Debian 9 How to upgrade Debian 8 Jessie to Debian 9 Stretch的更多相关文章

  1. CentOS 通过yum来升级php到php5.6,yum upgrade php 没有更新包怎么办?

    在文章中,我们将展示在centOS系统下如何将php升级到5.6,之前通过yum来安装lamp环境,直接升级的话,提示没有更新包,也就是说默认情况下php5.3.3是最新 1.查看已经安装的php版本 ...

  2. Debian 7 升级内核

    Debian 7(wheezy)的内核是3.2,要想把内核升级到3.16怎么办呢?使用backports源! 一.添加backports源 打开/etc/apt/source.list文件,加入以下: ...

  3. Debian Buster升级后找不到声卡

    昨天将Debian从Stretch升级到了新版巴斯光年(Buster).仍旧是先将source.list中的stretch替换为buster,再执行apt-get的update.upgrade.dis ...

  4. CentOS 通过yum来升级php到php5.6,yum upgrade php 没有更新包

    在文章中,我们将展示在centOS系统下如何将php升级到5.6,之前通过yum来安装lamp环境,直接升级的话,提示没有更新包,也就是说默认情况下php5.3.3是最新 1.查看已经安装的php版本 ...

  5. Debian 7 安装配置总结

    最近几天折腾了一下Debian 7 (gnome桌面DVD版,KDE桌面CD版最后会提到),总的来说收获还是挺大的,对比以前使用ubuntu,debian 7给我的感觉像是一个新生婴儿,不带多余的花俏 ...

  6. 服务器操作系统应该选择 Debian/Ubuntu 还是 CentOS?

    来自 http://www.zhihu.com/question/19599986 服务器操作系统应该选择 Debian/Ubuntu 还是 CentOS? 想选择一个 Linux 发行版作为服务器. ...

  7. 使用apt-mirror建立本地debian仓库源

    先介绍一下环境: 主机:Win7 虚拟机:VirtualBox + Debian7 由于软件源的体积比较大,所以我又给虚拟机添加了一块50GB的虚拟硬盘(给虚拟机添加虚拟硬盘的方法参见:http:// ...

  8. Debian 7 安装 Emacs 24.4

    一. 安装依赖包 sudo apt-get build-dep emacs23 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 下列软件包将被[卸载]: li ...

  9. 安装Debian 7.8 过程,以及该系统的配置过程

    最近,我给自己的电脑安装了Debian操作系统,版本7.8 stable.Debian我相信大家都能了解,它是Ubuntu的基础,Ubuntu是基于Debian的unstable开发的.我安装这个系统 ...

随机推荐

  1. iOS-消除CocoaPods内容警告

    前言 2018年2月26日 农历正月十一 星期一 今天就想更新下博客,内容不多,心情复杂: 突然想吟诗一首: 其实,我是一个善良的人: 其实,我是一枚... 算了,还是说正事吧 消除CocoaPods ...

  2. 简单选择排序实现(Java)

    简单选择排序实现 简单选择排序就是通过n-i次关键字之间的比较,从n-i+1个记录中选出关键字最小的记录,并和第i (1 ≤ i ≤ n)个记录交换. 代码实现: public class Selec ...

  3. POJ 2385

    #include <algorithm> #include <cstdlib> #include <numeric> #include <iostream&g ...

  4. django.db.utils.InternalError: (1050, "Table 'tb_content' already exists")

    在goods应用里面写了tb_content数据表的模型类(不该写在这里的),进行了数据迁移,还导入了数据. 在contents应用里也写了tb_content数据表的模型类(应该写在这里的), 解决 ...

  5. h5预订酒店项目|html5酒店模板|h5酒店webapp开发

    近几天尝试着使用html5+css3+swiper+jqUI+layerMobile等技术开发了一款仿携程.去哪儿.艺龙webapp酒店预订系统,页面图标统一使用iconfont,仿原生app右侧弹窗 ...

  6. 实用的百度下载神奇-proxyee-down

    项目地址: https://github.com/monkeyWie/proxyee-down 一.下载适合你的版本 二.运行软件 三.安装证书 四.重启软件和浏览器(注意是浏览器不是客户端),就能看 ...

  7. ruby 数据sql操作

    ActiveRecord ActiveRecord 是 Rails 的 ORM 元件,負責與資料庫溝通,讓我們可以用物件導向的語法操作資料庫.在”打造 CRUD 應用程式”一章中提到的對應概念如下: ...

  8. 【转】30+有用的CSS代码片段

    来自:WEB资源网 链接:http://webres.wang/31-css-code-snippets-to-make-you-a-better-coder/ 原文:http://www.desig ...

  9. Golang 知识图谱

  10. oracle 比较日期相等

    where to_char(date1, 'yyyymmdd')=to_char(date2,'yyyymmdd'); or where to_date(char1, 'yyyymmdd')=to_d ...