How To Upgrade Ubuntu 20.04 to 22.04 LTS via Command Lines Made Simple
This simple tutorial explains how to upgrade Ubuntu computer from 20.04 to 22.04 LTS using command lines in four steps. The benefit of upgrading is that you do not need to reinstall or reformat Ubuntu disk partition while keeping all installed applications intact. However, please note that this requires a lot of time. So prepare the requirements, be ready, and happy upgrading!
Subscribe to UbuntuBuzz Telegram Channel to get article updates.
About This Tutorial
We will upgrade Ubuntu 20.04 LTS "Focal Fossa" to Ubuntu 22.04 LTS "Jammy Jellyfish". This upgrade is also known as LTS to LTS upgrade. We use Lenovo ThinkPad T430 as the computer and a 5MB/s broadband internet access.
Please prepare these requirements before doing the upgrade:
- Backup all your data (except your computer is either new, empty or without Microsoft Windows).
- Time. You would watch the computer for many hours.
- Disable all PPAs (if any).
- Enough free disk space. We need >= 10GB free disk space.
- Stable internet access, faster is better.
1. Do the first command below. (*)
2. Do the second command. This will cost you hundreds of MB download, up to GBs of free disk space, and maybe 1-3 hours to finish. (*)
3. Do the third command. This will also cost you about the same. (*)
4. If any confirmation appears on screen, answer it accordingly (if you know what you're doing) or simply answer with YES / OK (if you don't), then repeat for other confirmations. After finishing it all, continue next step.
$ sudo apt-get update # first command
$ sudo apt-get upgrade # second command
$ sudo apt-get dist-upgrade # third command
(*) If you find your download speed slow, you should change your repository mirror to another one faster. Read Troubleshooting Section.
Restart your computer.
After restarting, do the following:
Step 1. Do command line below. Do not forget the 'minus dee' ( -d ) option.
Step 2. Let computer calculates the upgrade size.
Step 3. Computer will ask for confirmation, you should see the name jammy and not impish as in jammy.tar.gz, answer with YES / Y and continue, repeat for any later confirmations.
Step 4. Computer will start downloading, unpacking, then setting up your Ubuntu into the new release. This will cost you more than 1GB download, up to GBs of free disk spaces, and 1-4 hours to finish.
Step 5. If any confirmation appears of screen, answer accordingly (if you know what you're doing) or simply answer with YES / OK (if you don't), repeat for any later confirmations.
Step 6. Once successfully upgraded, Ubuntu will ask you once again to restart.
$ sudo do-release-upgrade -d
Congratulations, your computer has been upgraded successfully to Ubuntu 22.04!
For Part 1 and 3, if you find your download speed too slow, you can change your download server as the following:
Step 1. Stop command line from working by Ctrl+C.
Step 2. Open Software & Updates.
Step 3. Click 'Download from ' selection > choose Other ...
Step 4. Select the top most one namely mirrors.ubuntu.com > Choose Server > OK > Reload.
Step 5. Continue Part 1 above.
Step 6. If the download speed is still bad, repeat Step 1-3 > select your country > select a server among others > Choose Server > OK > Reload.
Notes. We in Indonesia found that the top most mirror is very fast and satisfying. However, in this practice we use mirror.biznetgio.com that is very fast and also stable, we would love to say thank you very much PT Biznet Gio Nusantara for providing this service generously.
This article is licensed under CC BY-SA 3.0.
Source: Ubuntu Buzz !