apt-get is one of the popular package managers used to perform different operations including install, remove, update, and upgrade in Debian-based Linux derivatives. It can automatically upgrade any package to its latest versions available. To make your system more fruitful and wish to have the additional benefits, upgrade packages regularly. However, if you don’t know how to upgrade the package just run this sudo apt-get upgrade command in your Ubuntu terminal, it will handle the rest. Moreover, you can also upgrade a specific package with apt-get. Stay connected to know more about it.
Key Takeaways
- Knowing about apt-get package managers.
- Learning about how to upgrade packages with apt-get.
- Learning to upgrade a single package using the apt-get command.
Requirements
- Must be a root user to avail of sudo privileges.
2 Cases to Upgrade Packages Using ‘sudo apt-get’ in Linux
In this section, I have explored two different cases to upgrade packages in Linux. If you want to upgrade all the packages with a single command, follow Case 01. Otherwise, to upgrade a specific package, you can check Case 02.
Case 01: Upgrade All Packages With the ‘sudo apt-get’ Command
It is always recommended to upgrade your packages daily to have a smooth work environment. As it is not such tiresome work, you can do it easily with a simple command in Ubuntu. In order to do that, follow the below steps carefully:
Steps to Follow >
➊ Open the Ubuntu terminal.
➋ Update the packages before upgrading the packages with the apt-get package manager by writing the following code:
sudo apt-get update
➌ Now, upgrade all the installed packages with the apt-get command:
sudo apt-get upgrade
- upgrade: Upgrades packages to the latest versions in Linux.
The upgrading process will start after you type your Ubuntu password. Then click ENTER. After that, write ‘y’ to complete the upgrading procedure. Now, you have the updated versions of all the packages installed in your Linux system.
Case 02: Upgrade a Specific Package With the ‘sudo apt-get’ Command
You can also upgrade a specific package whichever you want with a single command using apt-get. Here, I will show you how to upgrade an old version Google Chrome package.
Steps to Follow >
➊ Open the Ubuntu terminal.
➋ It is important to update the packages before upgrading any package.
➌ Now write this command to upgrade the Google Chrome package:
sudo apt-get upgrade google-chrome-stable
- google-chrome-stable: Package name.
When you type ‘y’, it automatically installs the updated version package of Google Chrome.
Conclusion
Now you are capable enough to upgrade packages in Linux. Remember that, it is a healthy practice to update packages before upgrading them. In this article, I have explained two practical cases about upgrading packages. All the packages can be upgraded at once. In addition, a single package can be upgraded with the apt-get. You must have the sudo privileges to execute these commands. Always keep your device up-to-date and healthy. Bye.
People Also Ask
Related Articles
- dnf Update Vs Upgrade [Which One Is Better]
- Yum Update Vs Upgrade [Basic Differences]
- How to Use ‘sudo apt full-upgrade’ in Linux [A complete Guide]
- Apt-get Update Vs Upgrade [What’s the Difference]
<< Go Back to Upgrade Package in Linux | Package Management in Linux | Learn Linux Basics