
Debian 11 (Bullseye) is the latest stable release of the Debian Linux operating system, offering an extensive range of updated software packages and five years of support. If you're ready to enhance your server's performance and security, this article provides a step-by-step guide on how to upgrade from Debian 10 to Debian 11 seamlessly.
SSH to the server as a regular user with sudo privileges.
It's good practice to update your existing server packages, security patches, and necessary upgrades before making the switch from Debian 10 to ensure your applications are compatible with Debian 11.
Update the available packages.
Upgrade all the existing packages.
Remove any unnecessary dependency files.
Before upgrading from Debian 10 to Debian 11, make a backup of your current server status in case things go wrong. You can do this by creating a snapshot of your server.
The snapshot process will start, and depending on your server size, it may take between five and ten minutes to complete. When finished, the status changes from pending to available.
Aptitude (Apt) downloads packages from one or more repositories for installation on your server. It finds the correct repositories, available packages, and versions to download in /etc/apt/sources.list. So, you need to replace all Debian 10 codenames with Debian 11 codenames in /etc/apt/sources.list.
Confirm the Debian 10 codename by running the following command. Debian 10 is codenamed buster.
Your output should be:
Change all buster entries in the sources list to bullseye, which is the codename for Debian 11.
Back up the original configuration files to your home directory.
Open /etc/apt/sources.list in your favorite editor.
The current entries should look like this:
Replace those lines with:
Save and close the file.
Update the package list a second time. If you made the changes correctly, there won't be any errors displayed during the update process.
Perform a system upgrade. Use the --without-new-pkgs flag to avoid removing the packages you intend to keep on your server.
You will be prompted to restart specific services or to keep and erase specific config options. Answer yes.
After the apt-listchanges package is installed it will display information about the upgraded packages. Type Q to exit the pager.
Select a console encoding set, and continue with other upgrades.
Now you can safely run a full upgrade to Debian 11 with the following command:
This will run a full upgrade of the server from Debian 10 to Debian 11, resolve possible dependencies changes, install the newest versions of all packages, and remove any obsolete packages. During the system upgrade process, additional prompts may be displayed to restart services and update existing configuration options. Be sure to select appropriate choices to avoid unwanted changes to existing applications.
When a pager indicator : is displayed, type Q to continue.
Type Y when prompted to modify /etc/sysctl.conf.
After the system upgrade is complete, restart your server for changes to take effect.
Your current SSH connection will be dropped.
Wait for a minute for the server to reboot.
Log in through SSH.
Check the current operating system version and verify it shows Debian 11, bullseye.
Output:
Some packages may have been upgraded to newer versions during the upgrade process, but they will still use the same configuration files and ports. Verify your existing apps one by one and also check the error logs depending on your server setup. For instance, check whether Apache2 is installed and running:
To confirm if MySQL is present:
To check your current PHP version:
Several applications may need new versions during the upgrade from Debian 10 to Debian 11. Depending on your installation type, some may have been automatically updated during the process, or you may have to update the latest versions manually. To secure the server, remove any outdated packages.
Confirm if the Uncomplicated Firewall (ufw) is running and set some rules to tighten connections to your server.
To allow a service like HTTP, run:
Congratulations, you have successfully upgraded your server from Debian 10 "Buster" to Debian 11 "Bullseye" and retained existing applications on the server. Typically, you should expect about 15 minutes of downtime.
For more information, see these articles at debian.org.
0 Comments
Be the first to comment and share your perspective with the community.