====== Upgrade Debian 10 to Debian 11 ======
This walk-through explains the steps to upgrade from Debian 10 to Debian 11. Since I had to upgrade my motherboard (after 16 years of operation!) (see [[hw:machines#epione|Machines]]) I could not access the internet before upgrading Debian to //Bullseye//. In my specific case this is because the //B550m// motherboard from Asrock is equipped with a Realtek RTL8111H NIC which is only supported in kernels newer than 4.19, and Debian 10 is still based on Linux kernel 4.19. Several attempts to install a newer Realtek driver failed, therefore I decided to upgrade to Debian 11 offline through an iso image.
===== Steps =====
- Backup essential folders and files
* ''/etc''
* ''/var/lib/dpk''
* ''/var/lib/apt/extended_states''
* output of ''dpkg --get-selections "*"''sudo dpkg --get-selections "*" > selections
* ''/home'' directory and hidden files to prevent some applications from overwriting existing user settings with new defaults
- Download [[https://www.debian.org/CD/http-ftp/|Debian iso]] file and copy it to your host's home directory. Make sure you download the iso containing all desktop environments, or the one matching your installed desktop environment.
- Add the iso file to fstab so it will mount when rebooting. At the bottom of fstab enter the following line:/home/user/debian-11.6.0-amd64-DVD-1.iso /media/cdrom/ iso9660 loop 0 0
- Record the session. It is strongly recommended that you use the /usr/bin/script program to record a transcript of the upgrade session. Then if a problem occurs, you will have a log of what happened, and if needed, can provide exact information in a bug report. To start the recording, type:script -t 2>~/upgrade-bullseye1.time -a ~/upgrade-bullseye1.script
- Do a minimal system upgrade first:sudo apt upgrade --without-new-pkgs
- Avoid libreoffice to be installed. Hold the package:sudo apt-mark hold libreoffice*
- Do the distro upgrade:sudo apt full-upgrade
- Remove the hold:sudo apt-mark unhold libreoffice*Show all packages on hold:sudo apt-mark showhold
- After you have completed the upgrade, you can stop script by typing exit at the prompt. If you have used the -t switch for script you can use the scriptreplay program to replay the whole session:sudo scriptreplay ~/upgrade-bullseyestep.time ~/upgrade-bullseyestep.script
- Remove folders which should but could not be removed during the upgrade
- Remove obsolete packagessudo apt autoremove
- Configure NIC:sudo vim /etc/network/interfacesReplace content with:# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s5
iface enp0s5 inet static
address 192.168.2.236
netmask 255.255.255.0
gateway 192.168.2.254
dns-domain sweet.home
dns-nameservers 192.168.2.254
- Reboot, then check internet is accessible
- Change host namesudo hostnamectl set-hostname
sudo vim /etc/hosts
===== Links =====
* Upgrade without internet [[https://unix.stackexchange.com/questions/680652/how-to-upgrade-debian-10-to-debian-11-without-internet#answers-header|How to upgrade Debian 10 to Debian 11 without internet?]]
* Mount iso [[https://www.cyberciti.biz/tips/how-to-mount-iso-image-under-linux.html|How to mount an ISO image/file under Linux]]
* Mount using fstab:[[https://itekblog.com/mount-iso-using-fstab/|Mount ISO using fstab (Linux tutorial)]]
* Backup [[https://phoenixnap.com/kb/upgrade-debian-10-to-11#ftoc-heading-2|How to Upgrade Debian 10 to Debian 11]]
* Debian [[https://www.debian.org/releases/stable/amd64/release-notes/ch-upgrading.en.html#cdroms|Upgrades from Debian 10 (buster)]]
* Network [[https://www.cyberciti.biz/faq/linux-list-network-interfaces-names-command/|Linux Show / Display Available Network Interfaces]]
* Network [[https://www.cyberciti.biz/faq/add-configure-set-up-static-ip-address-on-debianlinux#attachment_149351|How to set up static IP address on Debian Linux 10/11]]
* Apt sources [[https://techviewleo.com/add-debian-11-bullseye-official-repositories-to-sources-list/|Add Debian 11 Bullseye official repositories to sources.list]]
* Hold packages [[https://askubuntu.com/questions/18654/how-to-prevent-updating-of-a-specific-package|How to prevent updating of a specific package?]]
* Host name [[https://www.cyberciti.biz/faq/how-to-change-hostname-on-debian-10-linux/|Change hostname on Debian]]