{"id":3621,"date":"2023-11-20T10:37:00","date_gmt":"2023-11-20T02:37:00","guid":{"rendered":"https:\/\/www.servergigabit.com\/guide\/?post_type=kb&#038;p=3621"},"modified":"2026-03-16T12:55:33","modified_gmt":"2026-03-16T04:55:33","slug":"upgrade-debian-or-ubuntu-server","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/upgrade-debian-or-ubuntu-server","title":{"rendered":"Debian or Ubuntu Server: 5 Powerful Steps to Upgrade"},"content":{"rendered":"<header class=\"entry-header \">\n<h1><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-3622\" src=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-300x169.jpeg\" alt=\"Debian or Ubuntu Server\" width=\"667\" height=\"376\" srcset=\"https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-300x169.jpeg 300w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-1024x576.jpeg 1024w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-768x432.jpeg 768w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-1536x864.jpeg 1536w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-2048x1152.jpeg 2048w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-370x208.jpeg 370w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-1230x692.jpeg 1230w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-800x450.jpeg 800w, https:\/\/www.servergigabit.com\/guide\/wp-content\/uploads\/2023\/11\/1-390x219.jpeg 390w\" sizes=\"(max-width: 667px) 100vw, 667px\" \/><\/h1>\n<\/header>\n<div class=\"entry-content clear\">\n<p data-sourcepos=\"7:1-7:217\">Server Gigabit provides the latest versions of various popular <a href=\"https:\/\/www.servergigabit.com\/linux-vps-hosting\/\">Linux<\/a> operating systems. This guide will walk you through the process of upgrading your server from an older version to the latest Debian or Ubuntu Server.<\/p>\n<p data-sourcepos=\"9:1-9:19\">Important Note:<\/p>\n<ol data-sourcepos=\"11:1-16:0\">\n<li data-sourcepos=\"11:1-12:0\">\n<p data-sourcepos=\"11:4-11:182\"><strong>Backup:<\/strong> Before proceeding with the upgrade, ensure you have a local backup of all critical files. The upgrade process might encounter issues, rendering your server inoperable.<\/p>\n<\/li>\n<li data-sourcepos=\"13:1-14:0\">\n<p data-sourcepos=\"13:4-13:152\"><strong>Snapshot for VPS with 100% SSD:<\/strong> If you&#8217;re upgrading a VPS with 100% SSD storage, creating a snapshot beforehand will suffice for backup purposes.<\/p>\n<\/li>\n<li data-sourcepos=\"15:1-16:0\">\n<p data-sourcepos=\"15:4-15:288\"><strong>Customization and Software:<\/strong> The upgrade process can vary depending on the level of customization and the amount of software installed on your system. A higher number of additional software packages increases the likelihood of package conflicts, which may require manual resolution.<\/p>\n<\/li>\n<\/ol>\n<h2 data-sourcepos=\"110:1-110:14\"><strong>Steps to Upgrade Debian or Ubuntu Server<\/strong><\/h2>\n<h3 data-sourcepos=\"17:1-17:23\"><strong>Step 1: Preparation<\/strong><\/h3>\n<p><strong>Root Privileges:<\/strong>\u00a0If you&#8217;re unsure about your administrative privileges, execute the following command at the beginning of each session to gain root access:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">sudo -i\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"25:1-25:123\">This command will grant you root-level privileges without the need to prefix every command with &#8220;sudo&#8221; on the command line.<\/p>\n<p><strong>Update Packages:<\/strong>\u00a0Before proceeding, ensure your system has all pending updates for its software packages. If you haven&#8217;t installed updates recently, this might take some time.<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt-get update &amp;&amp; apt-get upgrade -y\r\napt-get autoremove\r\n<\/code><\/pre>\n<\/div>\n<p><strong>Remove Unnecessary Packages:<\/strong>\u00a0Remove any packages that were installed due to dependencies but are no longer needed.<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt-get autoremove\r\n<\/code><\/pre>\n<\/div>\n<h3 data-sourcepos=\"40:1-40:39\"><strong>Step 2: Adjusting apt.conf (Debian)<\/strong><\/h3>\n<p data-sourcepos=\"42:1-42:30\">(Applicable to<a href=\"https:\/\/www.debian.org\/\" rel=\"nofollow noopener\" target=\"_blank\"> Debian<\/a> systems)<\/p>\n<p><strong>Replace &#8220;stretch&#8221; with &#8220;buster&#8221;:<\/strong>\u00a0The following commands will replace all instances of &#8220;stretch&#8221; with &#8220;buster&#8221; in any repository entry within the apt.conf configuration files.<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">sed -i 's\/stretch\/buster\/g' \/etc\/apt\/sources.list\r\nsed -i 's\/stretch\/buster\/g' \/etc\/apt\/sources.list.d\/*\r\n<\/code><\/pre>\n<\/div>\n<p><strong>Verify Configuration:<\/strong>\u00a0Usually, there shouldn&#8217;t be any additional package sources configured. Your sources list should\u00a0<span class=\"citation-0\">have the following configuration:<\/span><\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\"><span class=\"citation-0 citation-end-0\">cat \/etc\/apt\/sources.list\r\ndeb http:\/\/asi-fs-n.contabo.net\/debian buster main non-free contrib\r\ndeb http:\/\/security.debian.org\/debian-security buster\/updates main contrib non-free\r\ndeb-src http:\/\/security.debian.org\/debian-security buster\/updates main contrib non-free\r\ndeb http:\/\/asi-fs-n.contabo.net\/debian buster-updates main contrib non-free<\/span>\r\n<\/code><\/pre>\n<\/div>\n<h3 data-sourcepos=\"61:1-61:32\"><strong>Step 3: Starting the Upgrade<\/strong><\/h3>\n<h5 data-sourcepos=\"63:1-63:21\"><strong>a) Debian Upgrade<\/strong><\/h5>\n<p><strong>Clean and Update Packages:<\/strong>\u00a0Start the upgrade process by cleaning and updating the package repositories.<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt clean &amp;&amp; apt update\r\n<\/code><\/pre>\n<\/div>\n<p><strong>Perform Upgrade and Dist-Upgrade:<\/strong>\u00a0Upgrade and dist-upgrade the installed packages.<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt upgrade -y\r\napt dist-upgrade -y\r\n<\/code><\/pre>\n<\/div>\n<p><strong>Autoremove Unused Packages:<\/strong>\u00a0Remove any unused packages that were automatically installed during the upgrade process.<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt autoremove\r\n<\/code><\/pre>\n<\/div>\n<p><strong>Verify Upgrade:<\/strong>\u00a0Verify the successful upgrade by checking the operating system release information.<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">cat \/etc\/os-release\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"90:1-90:64\">The expected output should indicate the upgraded Debian version.<\/p>\n<h5 data-sourcepos=\"92:1-92:21\"><strong>b) Ubuntu Upgrade<\/strong><\/h5>\n<p data-sourcepos=\"94:1-94:212\"><a href=\"https:\/\/ubuntu.com\/\" rel=\"nofollow noopener\" target=\"_blank\">Ubuntu<\/a> provides a dedicated tool, &#8220;do-release-upgrade,&#8221; to simplify the upgrade process to the next available LTS version. For instance, it will upgrade from 14.04 LTS to 16.04 LTS or from 16.04 LTS to 18.04 LTS.<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">do-release-upgrade\r\n<\/code><\/pre>\n<\/div>\n<p data-sourcepos=\"100:1-100:121\">If the &#8220;do-release-upgrade&#8221; command is not found, indicating the tool is missing, install it using the following command:<\/p>\n<div class=\"code-block ng-star-inserted\">\n<pre><code class=\"code-container no-decoration-radius\" role=\"text\">apt-get install update-manager-core\r\n<\/code><\/pre>\n<\/div>\n<h3 data-sourcepos=\"106:1-106:26\"><strong>Step 4: Restart Server<\/strong><\/h3>\n<p data-sourcepos=\"108:1-108:141\">To apply the newly installed kernel, restart your server. Upon reboot, you&#8217;ll be running the latest version of Debian (stable) or Ubuntu LTS.<\/p>\n<h2 data-sourcepos=\"110:1-110:14\"><strong>Conclusion<\/strong><\/h2>\n<p data-sourcepos=\"112:1-112:114\">If you encounter any issues or have further inquiries, Contabo&#8217;s customer support team is available to assist you.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Server Gigabit provides the latest versions of various popular Linux operating systems. This guide will walk you through the process of upgrading your server from an older version to the latest Debian or Ubuntu Server. Important Note: Backup: Before proceeding with the upgrade, ensure you have a local backup of all critical files. The upgrade process might encounter issues, rendering&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[1099],"kbtag":[1202,1109],"class_list":["post-3621","kb","type-kb","status-publish","hentry","kbtopic-tutorials","kbtag-debian","kbtag-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=3621"}],"version-history":[{"count":7,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3621\/revisions"}],"predecessor-version":[{"id":6300,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/3621\/revisions\/6300"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=3621"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=3621"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=3621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}