
Upgrading your Debian operating system ensures your server runs with the latest security patches, performance enhancements, and software updates. Debian 12 offers up-to-date system driver packages and kernel versions with better stability and performance.
This article explains how to upgrade from Debian 11 to Debian 12 and migrate all existing packages with minimal downtime.
Before you begin:
Deploy a Debian 11 instance on Vultr to test the upgrade process.
Access the instance using SSH as a non-root user with sudo privileges.
Verify that your instance has at least 2GB of available space.
Your output should be similar to the one below:
Upgrading to Debian 12 can corrupt existing server packages that may be incompatible with the new operating system. A snapshot is a point-in-time copy of your instance state and file system used for versioning and backup purposes. Follow the steps below to take a new snapshot and recover your instance in case the upgrade process fails.
Open the Vultr Console.
Click Products and select Compute on the main navigation menu.
Select your target Debian 11 instance to open its management page.
Navigate to the Snapshots tab.
Enter a new snapshot label in the Label field and click Take Snapshot.
Monitor the snapshot's progress and verify the status changes from Pending to Available.
You have created a new snapshot you can use to recover your original instance state in case of any upgrade failures. Use backup tools such as rsync or tar on a physical server to back up your instance data before starting the upgrade process.
Some applications may be incompatible with Debian 12. Follow the steps below to verify the installed applications on your server and ensure compatibility with Debian 12.
View the official application documentation sources: Visit each application's official documentation or releases page to verify it's compatible with Debian 12.
Test in a sandbox environment: Replicate your existing environment on Debian 12 to identify any runtime or configuration issues.
Verify the installed packages: Run the following command to view all installed applications and software packages on your server and export the list to a single .txt file.
View the file contents to verify the installed packages.
Server preparation enables you to upgrade all existing packages for a smooth and successful upgrade. Follow the steps below to update your server packages and prepare for the system upgrade.
Update the server's package information index.
Upgrade all installed packages to the latest versions.
Perform a full upgrade to resolve potential dependency issues and install or remove specific packages.
Remove any orphaned dependency packages to prevent potential conflicts during the upgrade process.
Remove cached packages.
Upgrading from Debian 11 to Debian 12 may take between 30 to 60 minutes depending on the number of packages on your server. Follow the steps below to upgrade from Debian 11 to Debian 12.
View your server's distribution version and verify that it's Debian 11 (bullseye).
Output:
Update the /etc/apt/sources.list file and any files within /etc/apt/sources.list.d/ directory from bullseye (Debian 11) to bookworm (Debian 12).
Update the server's package information index.
Upgrade the server to Debian 12.
Press Space to browse the apt-listchanges: News options and press Y to close the pager. When prompted, reply to each of the following prompts:
Character set to support: Press Enter to use the default keyboard layout.
Restart services during package upgrades without asking?: Select Yes and press Enter to continue with the upgrade process.
What do you want to do about modified configuration file ssh_config?: Select install the package maintainer's version and press Tab to select OK and press Enter.
What do you want to do about modified configuration file grub?: Select install the package maintainer's version, select OK, and press Enter.
Configuration file '/etc/ntpsec/ntp.conf: Enter Y and press Enter to install the NTP package maintainer's version.
Perform a full upgrade of all packages on the server.
The above command upgrades all installed packages to their latest versions, installs new packages, and removes any conflicting or obsolete packages.
Remove any unnecessary packages and clear the package cache.
View your server's distribution version and verify you have upgraded to Debian 12 (bookworm).
Output:
Restart the server to apply all changes.
Follow the steps below to test the upgraded Debian server and verify that all packages run correctly with the latest versions.
View your server distribution version and verify that it's Debian 12 (bookworm).
Output:
Debian 12 (bookworm) is the active operating system version on your server based on the above output.
View the updated Linux kernel version.
Output:
Test access to a common domain such as google.com to verify network connectivity.
Output:
You have upgraded your server from Debian 11 to Debian 12. Upgrading your operating system version ensures that your server receives the latest security patches and updates to improve the system's performance. For more information, visit the Debian upgrade documentation.
0 Comments
Be the first to comment and share your perspective with the community.