Upgrading from Debian 9 to 10

Christopher Dakin

Introduction

Debian 9 Stretch is still in long term support (LTS) until June 2022, but if you have an older LogonBox install, it is possible to upgrade the OS to a later version to bring the OS inline with our current new VM images.

It is recommended to upgrade one OS step at a time, so this article contains instructions on how to perform this upgrade from Debian 9 to Debian 10 via a command-line shell.

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.3 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 9 before the upgrade.
  • Internet access 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 nervepoint 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/ buster main contrib non-free" | tee -a /etc/apt/sources.list
  4. echo "deb http://security.debian.org/ buster/updates main contrib non-free" | tee -a /etc/apt/sources.list
  5. echo "deb http://deb.debian.org/debian/ buster-updates main contrib non-free" | tee -a /etc/apt/sources.list
  6. echo "deb http://deb.debian.org/debian/ buster-backports main contrib non-free" | tee -a /etc/apt/sources.list
  7. rm /etc/apt/sources.list.d/hypersocketdebianstable.list
  8. rm /etc/apt/sources.list.d/hypersocketdebianea.list (this file may not exist, just continue).
  9. echo "deb http://hypersocketdebianstable.s3.amazonaws.com tachyon main" > /etc/apt/sources.list.d/hypersocketdebianstable.list
  10. echo "#deb http://hypersocketdebianea.s3.amazonaws.com tachyon main" > /etc/apt/sources.list.d/hypersocketdebianea.list
  11. apt update (make sure there are no ERRORs, examine any WARNINGs. Any Error on stretch-updates/main Translation-en is okay).
  12. apt install ca-certificates.
  13. apt upgrade (There could be up to 400 upgrade packages, and around 100 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. Although note that if you do this with sshd_config you will not be able to SSH in as root, so you may wish to keep the local version for sshd_config.
  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:

Errors were encountered while processing:
ca-certificates
ca-certificates-java
hypersocket-vm
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

then simply run apt upgrade again.

 

To complete the upgrade:

  1. apt dist-upgrade (this will upgrade and install a few more packages, if you get any errors as per above, run the dist-upgrade again).
  2. Reboot the system by typing: reboot
  3. Wait a few minutes for the reboot to occur, then reconnect to the system's terminal again.
  4. You can now confirm the debian version with: cat /etc/debian_version
  5. Finally, run apt autoremove to remove any packages that are no longer required.

You should now have a working LogonBox system running on Debian 10 (buster).