How to Perform an In-Box Upgrade on an Ubuntu VPS

In-box upgrades on any operating system can be tricky. You are essentially updating all of the software, including the kernel, while keeping all of the current data. This makes it inherently risky, and some would argue against it and maintain that you should either not do upgrades or only do backups and clean installs.

For Ubuntu systems, the clean install route would be troublesome if you are on the normal release cycle, which is every six months. Having to completely backup your system and reinstall a new image would mean way too much down time. On the other hand, you could opt for an LTS install from the beginning, which stands for “Long Term Support”. These Ubuntu systems are released every 2 years and are sometimes supported up to 5 years.

If you still want to go the in-box upgrade route, you will need to check with your VPS provider for specifics on the kernel. Many virtual private servers have kernels controlled by the VPS system itself, not the OS. For example, your upgrade path might look like this:

  1. sudo do-release-upgrade
  2. halt (to shutdown the VPS)
  3. Install VPS kernel matching your new version
  4. Boot VPS

For specifics, check your VPS provider’s documentation. During the installation, Ubuntu will give you an alternate SSH port, just in case your main SSH server stops working for some reason. For more information about upgrading, see this documentation.