{"id":1921,"date":"2018-05-30T07:00:40","date_gmt":"2018-05-30T07:00:40","guid":{"rendered":"https:\/\/blog.ssdnodes.com\/blog\/?p=1921"},"modified":"2025-05-18T19:42:03","modified_gmt":"2025-05-18T19:42:03","slug":"upgrading-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.ssdnodes.com\/blog\/upgrading-ubuntu-18-04\/","title":{"rendered":"Tutorial: Upgrading to Ubuntu 18.04 from Ubuntu 16.04"},"content":{"rendered":"<p>The Ubuntu\u2019s latest Long Term Support (LTS) release, Ubuntu 18.04 - Bionic Beaver, was released on April 26, 2018. If you\u2019re running Ubuntu 16.04 LTS - Xenial Xerus, you may want to upgrade to the latest release to test the new features. The process of upgrading from Ubuntu 16.04 to Ubuntu 18.04 is relatively straightforward and should take no more than 30 minutes if you have a good internet connection.<\/p>\n<h2><a id=\"Prerequisites_4\"><\/a>Prerequisites<\/h2>\n<ul>\n<li>You have an Ubuntu 16.04 system with access to a sudo enabled user.<\/li>\n<\/ul>\n<p>You should keep the following things in mind while you do release upgrade of Ubuntu 16.04 to Ubuntu 18.04.<\/p>\n<ul>\n<li>Backup all critical data from the system to a remote location using a utility program like <code>rsync<\/code>. Even better, take a complete snapshot of your system.<\/li>\n<li>Make sure the SSH connection does not drop while the upgrade process is running. You can use a small utility program called <code>screen<\/code> to prevent the session from \u201ctiming out\u201d or disconnecting. If there is any SSH connectivity failure during the upgrade process, you can reconnect to the session using <code>screen<\/code>.<\/li>\n<li>Don\u2019t run the upgrade procedures in a production system. If you are keen to upgrade in a production system, first test all your software and apps against the upgrade in a staging environment.<\/li>\n<\/ul>\n<h1><a id=\"Step_1_Update_the_installed_packages_14\"><\/a>Step 1. Update the installed packages<\/h1>\n<p>Before you begin the release upgrade process, update all your existing packages to the latest versions.<\/p>\n<p>Issue the following command to check the current release version of your system:<\/p>\n<pre><code>$ cat \/etc\/lsb-release \nDISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=16.04\nDISTRIB_CODENAME=xenial\nDISTRIB_DESCRIPTION=\"Ubuntu 16.04.2 LTS\"\n<\/code><\/pre>\n<p>Update the list of available packages and their versions with the following command:<\/p>\n<pre><code>$ sudo apt-get update\n<\/code><\/pre>\n<p>Now, install the newer versions of these packages:<\/p>\n<pre><code>$ sudo apt-get upgrade\n<\/code><\/pre>\n<p>After upgrading the packages, check the Ubuntu\u2019s release number. You will find that your distribution of Ubuntu 16.04 is upgraded. In our case, it upgraded to <code>Ubuntu 16.04.4 LTS<\/code>.<\/p>\n<pre><code>$ cat \/etc\/lsb-release \nDISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=16.04\nDISTRIB_CODENAME=xenial\nDISTRIB_DESCRIPTION=\"Ubuntu 16.04.4 LTS\"\n<\/code><\/pre>\n<p>The primary purpose of upgrading packages to the latest release is to keep the difference between your installed packages and the new ones in Ubuntu 18.04 as small as possible. Smaller differences minimize the risk of potential errors during the process.<\/p>\n<h1><a id=\"Step_2_Upgrade_Ubuntu_52\"><\/a>Step 2. Upgrade Ubuntu<\/h1>\n<p>The official recommended upgrade procedure uses a tool called <code>do-release-upgrade<\/code>. This tool is a part of <code>update-manager-core<\/code> package and is installed by default.<\/p>\n<p>If for some reason <code>update-manager-core<\/code> package is missing from your system, you can always install it with the following command from the terminal.<\/p>\n<pre><code>$ sudo apt-get install update-manager-core\n<\/code><\/pre>\n<p>Now, you should edit the configuration file for <code>do-release-upgrade<\/code>. Make sure to set the <code>Prompt<\/code> parameter to <code>lts<\/code>.<\/p>\n<pre><code>$ sudo vi \/etc\/update-manager\/release-upgrades\n....\n.... \nPrompt=lts\n....\n....\n<\/code><\/pre>\n<p>You can now issue the following command from the terminal to begin the upgrade procedure:<\/p>\n<pre><code>$ sudo do-release-upgrade\nChecking for a new Ubuntu release\nNo new release found.\n<\/code><\/pre>\n<p>Well, that seems wrong, doesn\u2019t it? Well, upgrades to Ubuntu 18.04 from 16.04 will only be enabled a few days after the 18.04.1 release expected in late July. Same goes for 17.10 upgrades. For more information about these upgrade rollouts, check out the <a href=\"https:\/\/wiki.ubuntu.com\/BionicBeaver\/ReleaseNotes#Upgrading_from_Ubuntu_16.04_LTS_or_17.10\" target=\"_blank\" rel=\"noopener\">Ubuntu wiki<\/a>.<\/p>\n<p>We <em>do<\/em> have a workaround, however. You can use the <code>-d<\/code> option to upgrade to a development release.<\/p>\n<pre><code>$ sudo do-release-upgrade -d\n\nChecking for a new Ubuntu release\nGet:1 Upgrade tool signature [819 B]                                                                                          \nGet:2 Upgrade tool [1,257 kB]                                                                                                 \nFetched 1,258 kB in 0s (0 B\/s)                                                                                                \nauthenticate 'bionic.tar.gz' against 'bionic.tar.gz.gpg' \nextracting 'bionic.tar.gz'\n\nReading cache\n\nChecking package manager\n\nContinue running under SSH? \n\nThis session appears to be running under ssh. It is not recommended to perform a upgrade over ssh currently because in case of failure it is harder to recover. \n\nIf you continue, an additional ssh daemon will be started at port \n'1022'. \nDo you want to continue? \n\nContinue [yN] y\n<\/code><\/pre>\n<p>Since you\u2019re using an SSH connection to start the upgrade process, the system asks whether you want to upgrade through SSH this connection. Press <code>y<\/code> to continue.<\/p>\n<pre><code>Starting additional sshd \n\nTo make recovery in case of failure easier, an additional sshd will \nbe started on port '1022'. If anything goes wrong with the running \nssh you can still connect to the additional one. \nIf you run a firewall, you may need to temporarily open this port. As \nthis is potentially dangerous it's not done automatically. You can \nopen the port with e.g.: \n'iptables -I INPUT -p tcp --dport 1022 -j ACCEPT'\nReading package lists... Done\nBuilding dependency tree        \nReading state information... Done\n........\n........                                                               \nFetched 0 B in 0s (0 B\/s)                                                                                                     \nReading package lists... Done    \nBuilding dependency tree          \nReading state information... Done\n\nUpdating repository information\n\nNo valid mirror found \n\nWhile scanning your repository information no mirror entry for the \nupgrade was found. This can happen if you run an internal mirror or \nif the mirror information is out of date. \n\nDo you want to rewrite your 'sources.list' file anyway? If you choose \n'Yes' here it will update all 'xenial' to 'bionic' entries. \nIf you select 'No' the upgrade will cancel. \n\nContinue [yN]y\n<\/code><\/pre>\n<p>The update manager informs you that a new SSH process is now running on port number 1022. You can add this port number to your firewall rules, if you have them, to allow this SSH connection as a precautionary measure. If for some reason the SSH connection drops and cannot let you connect again via port 22, you can connect to this new SSH instance using port 1022.<\/p>\n<p>Press <code>y<\/code> to continue:<\/p>\n<pre><code>..............\n..............\nChecking package manager\nReading package lists... Done    \nBuilding dependency tree          \nReading state information... Done\n\nCalculating the changes\n\nCalculating the changes\n\nDo you want to start the upgrade? \n\n3 installed packages are no longer supported by Canonical. You can \nstill get support from the community. \n\n88 new packages are going to be installed. 333 packages are going to \nbe upgraded. \n\nYou have to download a total of 230 M. This download will take about \n56 seconds with your connection. \n\nInstalling the upgrade can take several hours. Once the download has finished, the process cannot be canceled.\n\nContinue [yN]  Details [d]y\n<\/code><\/pre>\n<p>Once again, press <code>y<\/code> to continue. The update manager now starts downloading new packages for the upgrade and will inform you about the time remaining. New packages are be downloaded, unpacked, and installed one by one in your system. During the procedure, you will be asked to choose your keyboard- configuration, and if you want to restart services automatically when required.<\/p>\n<p>Generally speaking, it is safe to restart these services. You may also be prompted to replace the configuration files for a service you may have configured earlier.<\/p>\n<pre><code>Searching for obsolete software\nReading package lists... Done    \nBuilding dependency tree... 50%\nBuilding dependency tree          \nReading state information... Done\nReading state information... Done\n\nRemove obsolete packages? \n\n36 packages are going to be removed. \n\nContinue [yN]  Details [d]y\nSystem upgrade is complete.\n<\/code><\/pre>\n<p>Next, the update manager asks you to remove obsolete packages. It is safe to answer <code>y<\/code> in a system where you have not modified the packages extensively. In a system where you have modified the packages heavily, you probably want to check in details (the <code>d<\/code> option).<\/p>\n<p>At this stage, the upgrade is finished.<\/p>\n<pre><code>Restart required \n\nTo finish the upgrade, a restart is required. \nIf you select 'y' the system will be restarted. \n\nContinue [yN]y\n<\/code><\/pre>\n<p>Press <code>y<\/code> to do a restart of your system.<\/p>\n<p>If everything goes well, the system will be restarted. Login to the upgraded system, you will be greeted by a welcome prompt:<\/p>\n<pre><code>Welcome to Ubuntu 18.04 LTS <\/code><\/pre>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-1927\" src=\"https:\/\/www.ssdnodes.com\/wp-content\/uploads\/2018\/05\/201805_1804-celebrate.gif\" alt=\"\" \/><\/p>\n<p>You can also check the release version in the terminal, as you did at the beginning of this tutorial:<\/p>\n<pre><code>$ cat \/etc\/lsb-release \nDISTRIB_ID=Ubuntu\nDISTRIB_RELEASE=18.04\nDISTRIB_CODENAME=bionic\nDISTRIB_DESCRIPTION=\"Ubuntu 18.04 LTS\"\n<\/code><\/pre>\n<p>Now that your system is upgraded to latest release which is Ubuntu 18-04 Bionic Beaver, you can test the new versions of your software and services against the previous ones. Make sure everything works as expected, and have fun on the new Ubuntu LTS!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Upgrade to Ubuntu 18.04 from 16.04 on your VPS with a few simple commands and a short wait, and then take advantage of all the new features on your virtual private server (VPS)!<\/p>\n","protected":false},"author":20,"featured_media":2934,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[18,30],"tags":[185],"class_list":["post-1921","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops","category-tutorials","tag-ubuntu"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/1921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/comments?post=1921"}],"version-history":[{"count":2,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/1921\/revisions"}],"predecessor-version":[{"id":13066,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/posts\/1921\/revisions\/13066"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media\/2934"}],"wp:attachment":[{"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/media?parent=1921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/categories?post=1921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ssdnodes.com\/wp-json\/wp\/v2\/tags?post=1921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}