Reading Time: 3 minutes
How do I update Ubuntu using terminal command line is latest tutorial and we will guide you on how to update ubuntu system using command line.
Table of Contents
What is Ubuntu
Ubuntu is an opensource Operating System. Ubuntu is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in multiple editions: Desktop, Server, and Core for Internet of things devices and robots. All of the editions can run on a computer alone, or in a virtual machine.
Note: There are difference between update and upgrade. Incase you want to upgrade from one major release to another then you need to follow separate steps, Example if you want to upgrade from Ubuntu 20 to Ubuntu 22 then use separate steps, I will write a post for same.
Pre-Checks before you update Ubuntu
- Login to the Ubuntu System using SSH ( You can SSH using either Putty or terminal etc.)
- You should have sudo or root access
- It is good to have Console access, in case you have to recover during the update
- It is good to have a backup of the system however in the case of a non-critical system you may take a chance without a backup. There are multiple backup solutions however I personally used Rubrik. If you are a non-enterprise user then even you can think of having a free backup solution on your laptop or computer. I used Veam for free backup
- If you are using a Cloud provider and Ubuntu is hosted on either AWS or GCP then you can take snapshot backup and restoring from the snapshot is easier and faster.
Update Steps
You can save the output of the below commands in Notepad to match it later after the update of Ubuntu.
Check Kernel Version
$ uname -r
Check OS Version
$ cat /etc/os-release
Check Mounted File System
$ df -hP
How do I update Ubuntu using terminal command line
Fetch update software list
$ sudo apt-get update
This steps sync all packages from repository to your system. In order to update ubuntu, Please follow all steps mentioned in “How do I update Ubuntu using terminal command line”
Update Ubuntu software
$ sudo apt-get upgrade
Reboot System
$ sudo reboot
Wait for sometime and validate if you can ssh again, You can also monitor the same using console. Once system is UP, You can validate Kernel, OS and Mounted File System again. You should have new Kernel installed now.
Check Kernel Version
$ uname -r
Check OS Version
$ cat /etc/os-release
Check Mounted File System
$ df -hP
Make sure all File system are mounted as before update, If it is not mounted, try mounting it.
How to Integrate Ubuntu with Active Directory
If you want to integrate your ubuntu system with Active Directory, Please go through steps mentioned here
How to install Package in Ubuntu
$ sudo apt install PackageName
Alternate Command you can use to install standalone package
$ sudo apt-get install packagename
Conclusion
We have covered all steps in this tutorial “How do I update Ubuntu using terminal command line” , We hope you are able to update your ubuntu system now however incase you have any query on “How do I update Ubuntu using terminal command line” tutorial, Please write to us.