{"id":16972,"date":"2023-11-04T08:18:44","date_gmt":"2023-11-04T08:18:44","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=16972"},"modified":"2023-11-04T08:18:46","modified_gmt":"2023-11-04T08:18:46","slug":"how-to-upgrade-from-ubuntu-20-04-lts-to-ubuntu-22-04-lts","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2023\/11\/04\/how-to-upgrade-from-ubuntu-20-04-lts-to-ubuntu-22-04-lts\/","title":{"rendered":"How to Upgrade from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS"},"content":{"rendered":"\n<p>Ubuntu 22.04, codenamed Jammy Jellyfish, was released by Canonical on April 21 2022. It is the latest long-term support (LTS) release after its predecessor, Ubuntu 20.04 LTS.&nbsp;<\/p>\n\n\n\n<p>Ubuntu 22.04 provides major enhancements, new capabilities, and a number of new software packages such as:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>PHP 8.1.2<\/li>\n\n\n\n<li>OpenSSL 3.0<\/li>\n\n\n\n<li>Ruby 3.0<\/li>\n\n\n\n<li>Python 3.10.4<\/li>\n\n\n\n<li>MySQL 8.0.28<\/li>\n\n\n\n<li>PostgreSQL 14.2<\/li>\n\n\n\n<li>Linux kernel v5.15.0-25 &amp; MESA 22<\/li>\n<\/ul>\n\n\n\n<p>For a comprehensive list of all the new features and software packages, check out the\u00a0<strong><a rel=\"noreferrer noopener\" href=\"https:\/\/discourse.ubuntu.com\/t\/jammy-jellyfish-release-notes\/24668\" target=\"_blank\">release notes<\/a>.<\/strong><\/p>\n\n\n\n<p>In this tutorial, we will walk you through the process of how to upgrade Ubuntu 20.04 to Ubuntu 22.04.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"prerequisites\"><strong>Prerequisites<\/strong><\/h2>\n\n\n\n<p>Before you begin the upgrade, ensure you meet the following requirements:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>At least 20 GB of free disk space. You can check the available disk space using the&nbsp;<strong>df -Th<\/strong>&nbsp;command.<\/li>\n\n\n\n<li>Ensure you have a regular user configured with sudo privileges with access to SSH or the terminal app. This is the user you will use to perform the upgrade process.<\/li>\n\n\n\n<li>In addition, ensure you have a fast and stable internet connection. Do not cancel the operation once it\u2019s begun.<\/li>\n\n\n\n<li>Ensure your UPS or battery are fully charged and working.<\/li>\n\n\n\n<li>Close all open applications.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step1\"><strong>Step 1: Backup all your data<\/strong><\/h2>\n\n\n\n<p>It is prudent to take a backup of all your databases and files before embarking on any major upgrade of an operating system. This ensures you will not lose your data in case something goes wrong during the upgrade process.&nbsp;<\/p>\n\n\n\n<p>Cloud server providers offer snapshot services. Therefore, if you are running a virtual machine or cloud VPS, ensure you take a complete snapshot so that you can restore your instance in case it breaks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step2\"><strong>Step 2: Upgrade all the system packages<\/strong><\/h2>\n\n\n\n<p>Once the backup is in place, log in to your instance and upgrade all the packages to their latest versions. This upgrades the entire system to the latest Ubuntu release.<\/p>\n\n\n\n<p>To list upgradable packages, run the command (note: if you haven\u2019t done this in a while, you may want to run the&nbsp;<em>sudo apt update<\/em>&nbsp;command first to get the most current details possible):<\/p>\n\n\n\n<p><code><strong>$ sudo apt list \u2013upgradable<\/strong><\/code><\/p>\n\n\n\n<p>Next, refresh the local package index and upgrade the packages in one single command as follows:<\/p>\n\n\n\n<p><code><strong>$ sudo apt update &amp;&amp; sudo apt upgrade -y<\/strong><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-1.png\" alt=\"\" class=\"wp-image-63945\"\/><\/figure>\n\n\n\n<p>This might take a while depending on the number of installed packages with pending upgrades. Once the upgrade is complete, reboot your system to take advantage of the latest kernel that will come with the upgrade.<\/p>\n\n\n\n<p><code><strong>$ sudo reboot<\/strong><\/code><\/p>\n\n\n\n<p>Then log back into the system and confirm it has been upgraded to the latest release, which, at the time of publishing this guide, is Ubuntu 20.04.4 LTS.<\/p>\n\n\n\n<p><code><strong>$ lsb_release -a<\/strong><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-2.png\" alt=\"\" class=\"wp-image-63946\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step3\"><strong>Step 3: Open TCP port 1022<\/strong><\/h2>\n\n\n\n<p>If you are connected to your Ubuntu instance via SSH, the upgrade tool will open another SSH port (1022) as a fallback port in case the SSH connection drops on port 22.&nbsp;<\/p>\n\n\n\n<p>To simplify things, we recommend that you open port 1022 on your firewall as follows. We also recommend speaking with your networking team beforehand to ensure you are minimizing potential security risks. Be sure to follow Step 6 below to close the port when you are done.<\/p>\n\n\n\n<p><code><strong>$ sudo ufw allow 1022\/tcp<\/strong><\/code><\/p>\n\n\n\n<p>To apply the firewall rule, reload the firewall.<\/p>\n\n\n\n<p><code><strong>$ sudo ufw reload<\/strong><\/code><\/p>\n\n\n\n<p>Then verify that the port has been opened by probing the firewall status as shown.<\/p>\n\n\n\n<p><code><strong>$ sudo ufw status<\/strong><\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-3.png\" alt=\"\" class=\"wp-image-63947\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step4\"><strong>Step 4: Upgrade to Ubuntu 22.04 Jammy Jellyfish\u00a0<\/strong><\/h2>\n\n\n\n<p>At this point, upgrading to Ubuntu 22.04 will be a straightforward and seamless process. There are two ways to upgrade to the latest Ubuntu version: You can use the&nbsp;<strong>do-release-upgrade&nbsp;<\/strong>tool, which works for both CLI and GUI instances, or the GUI update tool.<\/p>\n\n\n\n<p>In this guide, we will use the&nbsp;<strong>do-release-upgrade&nbsp;<\/strong>tool. If it is not installed, you can install it by running the command:<\/p>\n\n\n\n<p><code><strong>$ sudo apt install update-manager-core<\/strong><\/code><\/p>\n\n\n\n<p>To commence the upgrade, run the command:<\/p>\n\n\n\n<p><code><strong>$ sudo do-release-upgrade<\/strong><\/code><\/p>\n\n\n\n<p>During the upgrade, the upgrade tool will probe for the latest LTS release and walk you through a series of prompts.<\/p>\n\n\n\n<p>First and foremost, it will detect your SSH connection and notify you that an additional SSH service will be started on port 1022. Simply type \u201c<strong>Y<\/strong>\u201d to proceed.<\/p>\n\n\n\n<p>Next, the upgrade tool will notify you to open port 1022, which will be used as an alternative SSH port in case of an SSH connection interruption on the default port. Since you already opened the port, just hit ENTER.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-5.png\" alt=\"\" class=\"wp-image-63949\"\/><\/figure>\n\n\n\n<p>Next, you will be prompted to update the \u201c<strong>sources.list<\/strong>\u201d file from \u2018focal\u2019 to \u2018jammy\u2019 entries. To proceed with the upgrade, press \u201c<strong>Y<\/strong>\u201d and press ENTER.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-6.png\" alt=\"\" class=\"wp-image-63950\"\/><\/figure>\n\n\n\n<p>The update tool will calculate all the changes and provide a summary of the following:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Installed packages that are no longer supported by Canonical.<\/li>\n\n\n\n<li>The number of packages to be removed.<\/li>\n\n\n\n<li>The number of new packages that will be installed.<\/li>\n\n\n\n<li>The number of packages that will be upgraded.<\/li>\n\n\n\n<li>Total download size and how long the download will take.<\/li>\n<\/ol>\n\n\n\n<p>To continue, once again, press&nbsp;<strong>\u201cY<\/strong>\u201d and press ENTER.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-7.png\" alt=\"\" class=\"wp-image-63951\"\/><\/figure>\n\n\n\n<p>Some services will need to be restarted once some libraries and packages are upgraded. On this pop-up, select\u00a0<strong>\u2018Yes<\/strong>\u2018 to restart these services during package upgrades without being prompted.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-8.png\" alt=\"\" class=\"wp-image-63952\"\/><\/figure>\n\n\n\n<p>From here, the upgrade tool will proceed to download all the requisite packages from the official Ubuntu repositories and upgrade them.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-9.png\" alt=\"\" class=\"wp-image-63953\"\/><\/figure>\n\n\n\n<p>When prompted on what to do with the modified \u201c<strong>sshd_config<\/strong>\u201d configuration file, you can choose to install the package maintainer\u2019s version or keep the local version installed. Then, select \u2018<strong>Ok<\/strong>\u2019.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-10.png\" alt=\"\" class=\"wp-image-63954\"\/><\/figure>\n\n\n\n<p>Next, press&nbsp;<strong>\u201cY<\/strong>\u201d and hit ENTER to remove obsolete packages.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-11.png\" alt=\"\" class=\"wp-image-63955\"\/><\/figure>\n\n\n\n<p>Thereafter, all the old packages alongside their configuration files will be removed.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-12.png\" alt=\"\" class=\"wp-image-63956\"\/><\/figure>\n\n\n\n<p>The entire process takes quite some time, so patience will be required. This is a good time to take a break and grab some coffee.<\/p>\n\n\n\n<p>Once the upgrade is complete, you will be prompted to restart the system to finish the upgrade. Press \u201c<strong>Y<\/strong>\u201d and hit ENTER to reboot. This will cause you to lose connection to the server.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-13.png\" alt=\"\" class=\"wp-image-63957\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step5\"><strong>Step 5: Verify the upgrade to Ubuntu 22.04<\/strong><\/h2>\n\n\n\n<p>After rebooting, log back in and confirm the upgrade was successful.&nbsp;<\/p>\n\n\n\n<p>The command:<\/p>\n\n\n\n<p><strong>$ <code>lsb_release -a<\/code><\/strong><\/p>\n\n\n\n<p>checks the version of Linux, while the command<\/p>\n\n\n\n<p><strong>$ <code>uname -mrs<\/code><\/strong><\/p>\n\n\n\n<p>checks the kernel version.<\/p>\n\n\n\n<p>From the output below, you can see that we are now currently running Ubuntu 22.04 LTS. Also, note that we are using kernel 5.15 which is the kernel version that comes with Ubuntu 22.04 by default.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/jumpcloud.com\/\/wp-content\/uploads\/2022\/06\/Ubuntu-14.png\" alt=\"\" class=\"wp-image-63958\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step6\"><strong>Step 6: Delete the firewall rule you created<\/strong><\/h2>\n\n\n\n<p>Now that you are finished with the update and no longer need port 1022 open, run the following command to close the port and prevent it from becoming a security vulnerability.<\/p>\n\n\n\n<p><strong>$ sudo<code>ufw delete allow 1022\/tcp<\/code><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step7\"><strong>Step 7: Enable third-party repositories<\/strong><\/h2>\n\n\n\n<p>During the upgrade, all third-party repositories are disabled. You might want to re-enable them now that the upgrade is complete. You can find these repositories in the<code><strong>\/etc\/apt\/sources.list.d<\/strong><\/code> directory.\u00a0<\/p>\n\n\n\n<p>To display these repositories, run the command:<\/p>\n\n\n\n<p>\u00a0<code><strong>$ ls -l etc\/apt\/sources.list.d\/<\/strong><\/code><\/p>\n\n\n\n<p>To enable them, simply open each file and uncomment the entries by deleting the # sign at the beginning of each line.<\/p>\n\n\n\n<p>Finally, free up the disk space by removing all the unnecessary packages as follows:<\/p>\n\n\n\n<p><code><strong>$ sudo apt autoremove \u2013purge<\/strong><\/code><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>As you have seen, upgrading Ubuntu 20.04 to Ubuntu 22.04 is a simple process that requires just a few commands.<\/p>\n\n\n\n<p>If you are an IT admin overseeing the updates of multiple Ubuntu systems, in addition to macOS and Windows device updates, your workflow can become quite complicated very quickly.<\/p>\n\n\n\n<p><a href=\"https:\/\/jumpcloud.com\/blog\/how-to-upgrade-ubuntu-20-04-to-ubuntu-22-04\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 22.04, codenamed Jammy Jellyfish, was released by Canonical on April 21 2022. It is the latest long-term support (LTS) release after its predecessor, Ubuntu 20.04 LTS.&nbsp; Ubuntu 22.04 provides major enhancements, new capabilities, and a number of new software packages such as: For a comprehensive list of all the new features and software packages, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2023\/11\/04\/how-to-upgrade-from-ubuntu-20-04-lts-to-ubuntu-22-04-lts\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Upgrade from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-16972","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/16972","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=16972"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/16972\/revisions"}],"predecessor-version":[{"id":16973,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/16972\/revisions\/16973"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=16972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=16972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=16972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}