Upgrading from Debian 11 to 12

Christopher Dakin

Introduction

If you wish to upgrade a LogonBox VM to the latest version of Debian, this article contains instructions on how to perform this upgrade from Debian 10 to Debian 11 via a command-line shell.

If you are wanting to upgrade from a version prior to Debian 10, it is recommended you stage the upgrade via Debian 11 first.

Please ensure your LogonBox instance is backed up or has a VM snapshot before performing the below.

Note that this upgrade will also upgrade LogonBox to version 2.4 if you were on an older version.

 

Pre-requisites

  • You must run apt update then apt upgrade to ensure that you have all of the latest packages for Debian 10 before the upgrade.
  • Internet access is required to download the new operating system.
  • Access to the VM console shell or direct SSH access.

 

Procedure

Note: If you are using one of our pre-built cloud VMs (AWS, Google Compute, Oracle), ensure you are running all of the below commands as the root user rather than the hypersocket-idm (or logonbox-wireguard) user.

To do this easily, switch to root first by typing: sudo -s

 

Connect to the VMCentre shell, or via SSH with the root account. Everything in red are typed commands:

  1. Stop the LogonBox service. The command to run depends on the product you have.
    For LogonBox SSPR: systemctl stop hypersocket-idm
    For LogonBox VPN: systemctl stop logonbox-wireguard
  2. rm /etc/apt/sources.list
  3. echo "deb http://deb.debian.org/debian bookworm main non-free-firmware" | tee -a /etc/apt/sources.list
  4. echo "deb http://deb.debian.org/debian-security/ bookworm-security main non-free-firmware" | tee -a /etc/apt/sources.list
  5. echo "deb http://deb.debian.org/debian bookworm-updates main non-free-firmware" | tee -a /etc/apt/sources.list
  6. rm /etc/apt/sources.list.d/hypersocketdebianstable.list
  7. rm /etc/apt/sources.list.d/hypersocketdebianea.list (this file may not exist, just continue).
  8. echo "deb http://hypersocketdebianstable.s3.amazonaws.com umbra main" > /etc/apt/sources.list.d/hypersocketdebianstable.list
  9. echo "#deb http://hypersocketdebianea.s3.amazonaws.com umbra main" > /etc/apt/sources.list.d/hypersocketdebianea.list
  10. apt update (make sure there are no ERRORs, examine any WARNINGs. Any Error on bookworm-updates/main Translation-en is okay).
  11. apt install ca-certificates (installing this package prevents some errors on the main upgrade).
  12. apt install ca-certificates-java (installing this package prevents some errors on the main upgrade).
  13. apt upgrade (There could be up to 450 upgrade packages, and around 60 newly installed. Type Y to start the upgrade).

 

The upgrade can take some time. During the upgrade you may be asked some of the below questions:

  1. Configuring keyboard-configuration, choose the keyboard layout most suitable for you.
  2. Restart services during package upgrades without asking. Choose Yes.
  3. New versions of config files are available, such as grub for example. In general its OK to 'install the package maintainer's version.
  4. If you get prompted to configure grub-pc, select all devices to install grub to /dev/sda /dev/sda1, /dev/sda2 etc with the space bar. Note if you get an error saying that grub couldn't install, you may need to merge the boot partition

 

If you get any messages such as the following after the apt upgrade

Errors were encountered while processing:
Errors were encountered while processing:
hypersocket-vm
hypersocket-vm
hypersocket-vm
hypersocket-vm
hypersocket-vm
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)

then run dpkg --configure -a followed by apt --fix-broken install then apt upgrade again.

 

To complete the upgrade:

  1. apt full-upgrade (this will upgrade and install a few more packages, if you get any errors as per above, run the dist-upgrade again).
  2. Wait a couple of minutes for the LogonBox service to start up, then reboot the system by typing: reboot
  3. Reconnect to the system's terminal again after the reboot and confirm the debian version with: cat /etc/debian_version.
  4. Finally, run apt autoremove to remove any packages that are no longer required.

You should now have a working LogonBox system running on Debian 12 (bookworm).