OK
In order to optimally design our website and to show appropriate offers we are using cookies. By continuing to use our website you agree that we set cookies. More information
SupportTutorialsDebian & Ubuntu Upgrade

Debian & Ubuntu Upgrade

At Contabo, we always offer you the latest version of many popular Linux operating systems. This tutorial shows you how to upgrade from an old version to the latest Debian (stable) or Ubuntu LTS.

Important:
Before proceeding make sure to have a local backup of all important files, the upgrade might fail and your server becomes inoperable!
In case you are upgrading a VPS with 100% SSD, creating a prior snapshot will be sufficient for backup.
The upgrade really depends on the customization performed on the system and the amount of software installed. The higher the amount of additional software, the higher the risk of package-conflicts which need to be solved manually.

1. Preparation

The system needs to get all pending updates for your software packages, prior to proceeding. If you have not installed updates recently this might take some time.
Packages which were installed due to dependencies and are not needed anymore should be deleted as well.

:~#apt-get update && apt-get upgrade -y
:~#apt-get autoremove

2. Adjusting the apt.conf (Debian)

The following commands will replace "stretch" with "buster" in any repository entry.
In case you manually added additional repositories they might fail, you will have to manually investigate or disable those package sources.

:~#sed -i 's/stretch/buster/g' /etc/apt/sources.list
:~#sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/*

Usually there should be no additional package sources configured and your sources list will have the following configuration:

:~# cat /etc/apt/sources.list
deb http://asi-fs-n.contabo.net/debian buster main non-free contrib
deb http://security.debian.org/debian-security buster/updates main contrib non-free
deb-src http://security.debian.org/debian-security buster/updates main contrib non-free
deb http://asi-fs-n.contabo.net/debian buster-updates main contrib non-free

3. a) Start upgrade (Debian)

The following commands will start the upgrade and will also update the packages.

:~#apt clean && apt update
:~# apt upgrade -y
:~# apt dist-upgrade -y
:~# apt autoremove
:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

3. b) Start upgrade (Ubuntu)

Ubuntu has got a Tool/command for this purpose: "do-release-upgrade" it will update to next available LTS version, so 14.04 LTS to 16.04 or 16.04 LTS to 18.04 LTS.
In case the command was not found and the tool is missing, it can be installed with following command:

:~# apt-get install update-manager-core

4. Restart server

In order to use the recently installed kernel, you will have to reboot your server. After rebooting you are running the latest version of Debian (stable)/ Ubuntu LTS.

In case of any issues or inquiries, our customer support team is available to assist you.

SupportTutorials Debian & Ubuntu Upgrade Posted by Gianni-Donato