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. crop和resize操作区别

    crop:对图像进行剪切 resize:对图像进行伸缩 实践代码 import cv2 bb2d = [30, 30, 72 ,42] image = cv2.imread('car.png') pt ...

  2. POJ 2389

    #include <iostream> #include <algorithm> #include <string> #define MAXN 300 using ...

  3. Label Propagation Algorithm LPA 标签传播算法解析及matlab代码实现

    转载请注明出处:http://www.cnblogs.com/bethansy/p/6953625.html LPA算法的思路: 首先每个节点有一个自己特有的标签,节点会选择自己邻居中出现次数最多的标 ...

  4. js设置全局变量 ajax中赋值

    js设置全局变量,在ajax中给予赋值赋值不上问题解决方案 方案一. //在全局或某个需要的函数内设置Ajax异步为false,也就是同步. $.ajaxSetup({async : false}); ...

  5. JavaMail学习之一-邮件传输协议

    协议:规定好的格式就是协议.就像http协议有请求协议和响应协议,邮件传输也分为发.收邮件的协议. 邮件协议分3种: 发邮件的:SMTP (Simple Mail Transport  Protoca ...

  6. 泛型深入--java泛型的继承和实现、泛型擦除

    泛型实现类: package generic; /** * 泛型父类:子类为“富二代”:子类的泛型要比父类多 * 1,保留父类的泛型-->子类为泛型类 * 2,不保留父类泛型-->子类按需 ...

  7. Math.floor,Math.ceil,Math.rint,Math.round用法

    一.Math.floor函数讲解 floor原意:地板.Math.floor函数是求一个浮点数的地板,就是求一个最接近它的整数,它的值小于或等于这个浮点数.看下面的例子: package com.qi ...

  8. js / jquery 获取和设置 FCK Editor 的值

    开发中遇到 通过 $("#content").val(); 或者 document.getElementById("content"); 并不能获取到 id 为 ...

  9. [CQOI 2018]解锁屏幕

    Description 题库链接 给出平面上 \(n\) 个点,一开始你可以选任何一个点作为起点,接着对于每一个你在的位置,你可以选取一个未走过的点.将路径(线段)上所有的点均选上(包括起点终点),并 ...

  10. elasticsearch java使用

    本文将介绍如何使用java调用elasticsearch的api 1.获取client连接 package com.test.elasticsearch; import java.net.InetAd ...