# Debian Upgrade auf neuen Release

Quelle: [https://www.cyberciti.biz/faq/update-upgrade-debian-9-to-debian-10-buster/](https://www.cyberciti.biz/faq/update-upgrade-debian-9-to-debian-10-buster/)

## Upgrade Debian 9 to Debian 10 Buster

The procedure is as follows:

1. Backup your system.
2. Update existing packages and reboot the Debian 9.x system.
3. Edit the file <kbd>/etc/apt/sources.list</kbd> using a text editor and replace each instance of <kbd>**stretch**</kbd> with <kbd>**buster**</kbd>.
4. Update the packages index on Debian Linux, run: <kbd>**sudo apt update**</kbd>
5. Prepare for the operating system upgrade, run: <kbd>**sudo apt upgrade**</kbd>
6. Finally, update Debian 9 to Debian 10 buster by running: <kbd>**sudo apt full-upgrade**</kbd>
7. Reboot the Linux system so that you can boot into Debian 10 Buster
8. Verify that everything is working correctly.

Let us see all command in details.

## Step 1. Backup your system

It is crucial to backup all data and system configurations. Cloud-based VMs can be quickly backup and restore using snapshots. I use [rsnapshot](https://www.cyberciti.biz/faq/linux-rsnapshot-backup-howto/), which is the perfect solution for making backups on the local or remote servers. [Check os version in Linux](https://www.cyberciti.biz/faq/how-to-check-os-version-in-linux-command-line/):  
`lsb_release -a`  
Sample outputs:

```
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.9 (stretch)
Release:	9.9
Codename:	stretch
```

Note down the [Linux kernel version](https://www.cyberciti.biz/faq/find-print-linux-unix-kernel-version/) too:  
`uname -mrs`  
Sample outputs:

```
Linux 4.9.0-9-amd64 x86_64
```

## Step 2. Update installed packages

Type the following [apt command](https://www.cyberciti.biz/faq/ubuntu-lts-debian-linux-apt-command-examples/ "See Linux/Unix apt command examples for more info") or [apt-get command](https://www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html "See Linux/Unix apt-get command examples for more info"):  
`sudo apt update<br></br> sudo apt upgrade<br></br> sudo apt full-upgrade<br></br> sudo apt --purge autoremove`  
OR  
`sudo apt-get update<br></br> sudo apt-get upgrade<br></br> sudo apt-get full-upgrade<br></br> sudo apt-get --purge autoremove`  
[Reboot the Debian 9.x stretch](https://www.cyberciti.biz/faq/howto-reboot-linux/) to apply the kernel and other updates:  
`sudo reboot`

## Step 3. Update /etc/apt/sources.list file

Before starting the upgrade you must reconfigure APT’s source-list files. To view current settings using the [cat command](https://www.cyberciti.biz/faq/linux-unix-appleosx-bsd-cat-command-examples/ "See Linux/Unix cat command examples for more info"):  
`cat /etc/apt/sources.list`  
Sample outputs:

<div id="bkmrk-deb-http%3A%2F%2Fcdn-aws.d"><table><tbody><tr><td class="code">```
deb http://cdn-aws.deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main
deb http://cdn-aws.deb.debian.org/debian stretch-updates main
```

</td></tr></tbody></table>

</div>The stretch indicates that we are using an older version. Hence, we must change all the references in this file from Stretch to Buster using a text editor such as vim:  
`vi /etc/apt/sources.list`  
I prefer to use sed tool, but first backup all config files using the [cp command](https://www.cyberciti.biz/faq/cp-copy-command-in-unix-examples/ "See Linux/Unix cp command examples for more info"):  
`sudo cp -v /etc/apt/sources.list /root/<br></br> sudo cp -rv /etc/apt/sources.list.d/ /root/<br></br> sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list<br></br> sudo sed -i 's/stretch/buster/g' /etc/apt/sources.list.d/*<br></br> ### see updated file now ###<br></br> cat /etc/apt/sources.list `

<figure aria-describedby="caption-attachment-148066" class="wp-caption aligncenter" id="bkmrk-apt-source-list-file" style="width: 599px;">![How To Upgrade Debian 9 Stretch To Linux Debian 10 Buster](https://www.cyberciti.biz/media/new/faq/2019/07/How-To-Upgrade-Debian-9-Stretch-To-Linux-Debian-10-Buster.png)<figcaption class="wp-caption-text" id="caption-attachment-148066">APT source-list files updated to use buster</figcaption></figure>### Updating the package list

Simply run:  
`sudo apt update`  
![Updating the package list](https://www.cyberciti.biz/media/new/faq/2019/07/Updating-the-package-list.png)

## Step 4. Minimal system upgrade

A two-part process is necessary to avoid the removal of large numbers of packages that you want to keep. Therefore, first run the following:  
`sudo apt upgrade`  
![Debian 9 to Debian 10 Minimal system upgrade](https://www.cyberciti.biz/media/new/faq/2019/07/Debian-9-to-Debian-10-Minimal-system-upgrade.png)  
Just follow on-screen instructions. During the upgrade process, you may get various questions, like “Do you want to restart the service? ” OR “keep or erase config options” and so on.  
![Restart services during package upgrades without asking](https://www.cyberciti.biz/media/new/faq/2019/07/Restart-services-during-package-upgrades-without-asking.png)  
And:  
![What do you want to do about modified config file](https://www.cyberciti.biz/media/new/faq/2019/07/What-do-you-want-to-do-about-modified-config-file.png)

## Step 5. Upgrading Debain 9 to Debian 10

In addition, minimum upgrades we need to do full upgrades to finish the whole Debian 9 to Debian 10 update process. This is the main part of the upgrade. In other words, execute the following command to perform a complete upgrade of the system, installing the newest available versions of all packages, and resolving all possible dependency:  
`sudo apt full-upgrade`  
![How to upgrade Debian 9 to Debian 10 Buster using the CLI](https://www.cyberciti.biz/media/new/faq/2019/07/How-to-upgrade-Debian-9-to-Debian-10-Buster-using-the-CLI.png)  
[Reboot the Linux system](https://www.cyberciti.biz/faq/ssh-restart-linux-system-reboot-command/) to boot into Debian Linux 10 buster, issue:  
`sudo reboot`

## Step 6. Verification

It is time to confirm the upgrade. Run:  
`uname -r<br></br> lsb_release -a`  
Sample outputs:

```
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster
```

Finally, clean up outdated packages using the [apt command](https://www.cyberciti.biz/faq/ubuntu-lts-debian-linux-apt-command-examples/ "See Linux/Unix apt command examples for more info")/[apt-get command](https://www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html "See Linux/Unix apt-get command examples for more info"):  
`sudo apt --purge autoremove`  
![How to Upgrade Debian 9 Stretch to Debian 10 Buster](https://www.cyberciti.biz/media/new/faq/2019/07/How-to-Upgrade-Debian-9-Stretch-to-Debian-10-Buster.png)

## Conclusion

And there you have it. We have successfully upgraded to Debian Linux 10. Debian project also posted an in-depth guide [here](https://www.debian.org/releases/buster/amd64/release-notes/ch-upgrading.en.html) that explains other issues one might face during installation.