Today I decided to upgrade my Proxmox server as the Proxmox team recently released version 8.x, which is based on Debian 12 (Bookworm). This also reminded me that I should upgrade my Turnkey Debian LXCs. I will use this post to document the process and how to fix some bugs I encountered.
Proxmox
Upgrading Proxmox 7.x to Proxmox 8.x
As usual, the first step before diving into an upgrade is to make sure you have a backup of your virtual machines and containers. I like to use Proxmox’s built-in backup feature to back up my virtual machines and containers.
Once you have backed up your virtual machines and containers, you can start the upgrade process. You must first ensure that you are running the latest version of Proxmox 7.x with the latest packages. You can do this by running the following commands:
apt update
apt dist-upgrade
Now that you are running the latest version of Proxmox 7.x, you can start the upgrade process to Proxmox 8.x. Since the new version is based on Debian 12, you will need to change the sources.list file to point to the new Debian 12 repositories. You can do this by executing:
sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
Your sources.list
file should now look like this:
deb http://ftp.es.debian.org/debian bookworm main contrib
deb http://ftp.es.debian.org/debian bookworm-updates main contrib
# Proxmox VE pve-no-subscription repository provided by proxmox.com,
# NOT recommended for production use
deb http://download.proxmox.com/debian/pve bookworm pve-no-subscription
# security updates
deb http://security.debian.org bookworm-security main contrib
If you have files in the /etc/apt/sources.list.d/
directory, you will need to change them as well. You can replace bullseye
with bookworm
in all the files in that directory by running the following command:
find /etc/apt/sources.list.d/ -type f -exec sed -i 's/bullseye/bookworm/g' {} \;
Now that you have changed the sources.list file, you can run refresh the package index and upgrade your system with:
apt update
apt dist-upgrade
During the upgrade process, you will be asked whether you want to keep the current version of the configuration files or install the new version. You will need to check the differences between the two versions and decide which one you want to keep. As a general rule, you should keep the current version of the configuration files if you have manually made any changes to them. If you have not made any changes to the configuration files, you should install the new version.
Once the upgrade process is complete, you can check for potential issues by running:
pve7to8
If you notice any problems, you must fix them before continuing. If you do not see any problems, you can restart the system with reboot
.
If everything went well, you should now be running Proxmox 8.x. Now you can purge orphan dependencies by running the following command:
apt autoremove --purge
Fix stuck on boot
In my case, the upgrade process went fine, but when I rebooted the system, it got stuck at startup with the following line:
Loading Linux 6.2.16-8-pve ...
Fortunately, I have found a solution on Proxmox forum, to solve this problem, once your system gets to the GRUB menu, choose the Advanced options for Proxmox VE
option and select a previous kernel version that boots, after logging in, try to execute the following command:
apt install pve-kernel-6.2.16-8 # replace 6.2.16-8 with the kernel version that is causing the issue
If you get a message saying that the package could not be installed, try reading the error message which should tell you which folder is causing the problem (it should be something in /var/lib
). Try moving the folder to another location and try installing the package again. Once the package is installed, you can reboot the system and it should boot normally.
Turnkey Debian
Upgrading Turnkey Debian 10.x to Turnkey Debian 11.x
Update your system to the latest version of Turnkey Debian 10.x and remove unnecessary packages by running the following commands:
sudo apt update
sudo apt upgrade
sudo apt --purge autoremove
Download the Turnkey repository key by running the following command:
CODENAME=bullseye
key_dir=/usr/share/keyrings
base_url=https://raw.githubusercontent.com/turnkeylinux/common/master/overlays/bootstrap_apt
repos=(main security testing)
for repo in ${repos[@]}; do
local_path=$key_dir/tkl-$CODENAME-$repo
keyring=$local_path.gpg
keyfile=$local_path.asc
key_url=${base_url}${keyfile}
wget -O $keyfile $key_url
gpg --no-default-keyring --keyring $keyring --import $keyfile
rm $keyfile
done
Change the sources.list file to point to the new Turnkey Debian 11.x repositories by running:
sudo find /etc/apt/sources.list.d/ -type f -exec sed -i 's/buster/bullseye/g' {} \;
You will need to change some lines of /etc/apt/sources.list.d/security.sources.list
, mainly the bullseye/updates
instances to bullseye-security
. You can do this by executing the following command:
sudo sed -i 's/bullseye\/updates/bullseye-security/g' /etc/apt/sources.list.d/security.sources.list
It should look like this after the change:
deb [signed-by=/usr/share/keyrings/tkl-bullseye-security.gpg] http://archive.turnkeylinux.org/debian bullseye-security main
deb http://security.debian.org/ bullseye-security main
deb http://security.debian.org/ bullseye-security contrib
#deb http://security.debian.org/ bullseye-security non-free
Now to refresh the package index you can run the following command:
sudo apt update
If everything went well, run the following command to upgrade your existing packages without installing new packages:
sudo apt upgrade --without-new-pkgs
As with the Proxmox upgrade, you will be asked if you want to keep the current version of the configuration files or if you want to install the new version.
Once the minimal upgrade process is complete, run the following command to upgrade your system to the latest version of Turnkey Debian
sudo apt full-upgrade
After the upgrade process is complete, you will need to reboot your system and you should now be running Debian 11.x. You can check your current Debian version by running the following command:
lsb_release -a
Which should output something like this:
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codenme: bullseye
If everything seems to be working fine, you can purge orphan dependencies by running:
sudo apt --purge autoremove -y
Fix unsafe path transition error
If you are getting the following error when trying to upgrade your system:
Detected unsafe path transition / -> /var during canonicalization of /var/cache.
dpkg: dependency problems prevent configuration of libpam-systemd:amd64:
libpam-systemd:amd64 depends on systemd (= 247.3-7+deb11u2); however:
Package systemd is not configured yet.
This may be caused if the root doesn’t own /
, /var
or /dev
, if that is the case, you can fix it by running the following command:
sudo chown root:root / # fix root
Fix Connection timed out and Transport endpoint is not connected errors
If you are getting the following errors when trying to upgrade your system:
Failed to get load state of systemd-networkd.socket: Connection timed out
Failed to try-restart systemd-networkd.service: Transport endpoint is not connected
Try running the following commands:
sudo mv /etc/acpi/events /etc/acpi/events.bak
sudo kill -HUP 1