How to Update Linux?
We have divided this section into multiple parts in which we will explain the procedures to update the Linux distros such as Ubuntu, CentOS, Debian, Fedora.
How to Update Ubuntu
Explained below are two ways to update Ubuntu easily:
Update Ubuntu by the Command Line
- Open the terminal in the system from the menu and execute the following command:
sudo apt update && sudo apt upgrade -y
- The above command line has "sudo," the system will ask for the password. Remember, you will not be able to see characters on the screen while you type the password.
- The system will start the updating procedure once you type the password. The above command line is the combination of two different commands. The "&&" is a command for running various commands on Linux so that the system can run every command one by one.
- The "-y" in the command line enters "yes" automatically, while the "apt upgrade" asks the user's confirmation before installing any update.
- In case you want to perform the tasks separately, then use the following:
sudo apt update
sudo apt upgrade
- After executing the command, the system will start to update the local database of the packages. In case this command line doesn't run currently, then your local database will not get updated.
- After executing the command, you will see various links on the screen because these links are the package information of different repositories. If you want to see the upgrade packages list, then run the following command:
apt list --upgradable
- This command works to match the versions of all installed packages with your local database. It also collects the information and lists those packages which have the latest versions available.
- Now, the system will ask to update the package, type "Y," and press enter to confirm the installation.
Update Ubuntu using GUIs
If you want to update the Ubuntu packages using GUI tools, you can use"Software Updater".
- Click on this tool and check if there is any update available for the system.
- If you see any updates available, then you will see an option to install the updates.
- You install updates by the Update Manager in Ubuntu and click on the "Install Now". It may ask for the password, provide the password of your system.
- In some cases, the system requires a reboot to install the updates for working; you will get a message to reboot the system in the end update.
- Make sure you clean up after an update to remove unnecessary packages and free up some space. Use the following command to perform the clean up:
sudo apt autoremove
How to Update CentOS
- First, check the current version of CentOS, use the following command to do it:
- The system will show the complete details of the CentOS Linux release version.
- Make sure to create a complete backup of your files before running the system upgrade procedure.
- Now, check the available updates using the following commands:
sudo yum check-update
- After executing the commands, you will see the information of available updates.
- The yum package manager works to update the system, and it can accumulate the additional listing and downloaded data. For clearing this data, run the following commands:
sudo yum clean all
- Now, reboot the server using:
- Update the CentOS using the following command:
sudo yum update
- After executing the commands, the system will provide the package list and the space required for downloading these packages. Press "Y" to confirm the update procedure.
- Finally, verify the current version of CentOS by using the following command:
- The system will provide the complete details of your current CentOS version.
How to Update Fedora
In this section, we will describe two different procedures to update Fedora easily.
Update Fedora by Software Center
Most of the time, the system notifies the user to update the system whenever the new version is available. So users can click on the notification, and the system will launch the software center.
- If you follow this way, click on the "update" in the software center to update the system. In case you don't receive the notification, then go to the software center and check for the updates.
- You can also update the system from the Settings option, open the Settings option and go to the details section at the bottom of the options list.
- You will see a "Check for Updates" button in the details section, click on it to scan for any latest update. If you find any update, click on it and provide the password to start the update.
Update Fedora by the Command Line
- Open the Linux terminal and execute the following command:
sudo dnf upgrade
- After executing the command, provide the admin password to start the procedure.
- Many users prefer dnf update instead of dnf upgrade, but both of these commands do the same work.
- Finally, you can reboot your system once your system updates successfully.
How to Update Debian
- First, you make a backup of your file before starting the update and execute the following command to update the package list:
$ sudo apt update
- Use the following command to see the upgradable package list before starting the update.
$ sudo apt list --upgradable
- Now, execute the following command to upgrade all of the upgradable packages:
$ sudo apt upgrade
- After upgrading the system, use the below command to restart the server:
$ sudo reboot
- In case you want to accept the default and then start the upgrade procedure, execute the following command:
$ sudo apt update && sudo apt upgrade -y
- In the above command, "-y," which means this command will allow the system to start the upgrade automatically.
- It is optional to remove old packages, use the following command to remove old dependencies and packages:
$ sudo apt autoremove
We have provided complete information on updating different Linux distros like CentOS, Debian, Ubuntu, Fedora. Linux has a huge list of operating systems that are used for completing different tasks easily. If you use any Linux operating system, make sure you update your system regularly, as these updates help eliminate errors and get the newest options. We have every possible way to update the Linux distros without having any trouble. Remember that implement the above procedures carefully because you can get errors if you put any wrong command to update packages.