How to upgrade from Ubuntu 20.04 to Ubuntu 22.04

2022-08-22 By Nathan 102828 Views Linux ubuntu upgrade
6 reviews

Ubuntu 22.04 LTS Jammy Jellyfish is the latest release of Ubuntu. It was released on April 21, 2022. It is the latest long-term support LTS release after its predecessor, Ubuntu 20.04 LTS. Ubuntu 22.04 is one of the world’s most popular Linux distributions. As a long-term support release, Ubuntu 22.04 LTS will be supported for 10 years.


Before proceeding with the upgrade, please make sure to back up all the important data to your local drive.


  1. Update and upgrade the entire system to the latest Ubuntu release using the below command.

    # apt  update -y && apt upgrade -y
    

    ubuntuupdate20to22_1


    While installation, there will be a prompt to select the following options, select keep the local version currently installed and perform the reboot action after installation.

    ubuntuupdate20to22_2


  1. Check the installed release.

    # cat /etc/os-release
    

    ubuntuupdate20to22_3

  2. Since using SSH port 22, select another free port to connect for updating the server. In this case, we use port 1022.


    Use the following commands to allow port 1022/TCP:

    # ufw allow 1022/TCP
    
    # ufw reload
    
    # ufw status
    

    ubuntuupdate20to22_4

  3. Install update-manger-core.

    # apt install update-manager-core
    

    ubuntuupdate20to22_5

  4. Start the update to ubuntu 22 now.

    # do-release-upgrade -d
    

    ubuntuupdate20to22_6


    It will detect SSH connection and notify that an additional SSH service will be started on port 1022. Simply type Y and press ENTER to proceed.

    ubuntuupdate20to22_7


    The upgrade tool will notify an alternative SSH port 1022 in case of an SSH connection interruption on the default port. Since the port is already opened, press ENTER.

    ubuntuupdate20to22_8

  5. The update tool will calculate all the changes and provide a summary.


    To continue, once again, press Y and press ENTER.

    ubuntuupdate20to22_9


    Some services will need to be restarted, select Yes to restart these services during package upgrades without being prompted. ubuntuupdate20to22_10

  6. When prompted on What do want to do about modified configuration file sshd_config?, select keep the local version currently installed.

    ubuntuupdate20to22_11

  7. Press Y and hit ENTER to remove obsolete packages.

    ubuntuupdate20to22_12

  8. Once the upgrade is completed, restart the system to finish the upgrade. Press Y and hit ENTER to reboot.

    ubuntuupdate20to22_13

  9. Check the OS information after rebooting.

    # cat /etc/os-release
    

    ubuntuupdate20to22_14

  10. Delete the ufw firewall rules.

    # ufw delete allow 1022/TCP
    

    ubuntuupdate20to22_15

  11. Free up the disk space by removing all the unnecessary packages.

    # sudo apt autoremove --purge
    

    ubuntuupdate20to22_16


Related Tutorials

What do you think about this article?

Rate this article
LayerStack Promotion
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.