How to Upgrade With ‘sudo apt-get’ Command [2 cases]

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
EXPLANATION
  • sudo: Permits administrative privileges.
  • apt-get: Provides a command line interface for the package management system.
  • update: Updates packages in Linux.

updating packages in linux using apt-get

➌ Now, upgrade all the installed packages with the apt-get command:

sudo apt-get upgrade
EXPLANATION
  • upgrade: Upgrades packages to the latest versions in Linux.

upgrading all the old version packages with sudo apt-get upgrade

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.

You can check Case 01 Step 02 to update all the installed packages with the apt-get package manager.

➌ Now write this command to upgrade the Google Chrome package:

sudo apt-get upgrade google-chrome-stable
EXPLANATION
  • google-chrome-stable: Package name.

upgrading google chrome package

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

How do you upgrade apt?
apt is a high-level package manager to manage packages in Debian-based Linux distros. To upgrade with the apt tool, just run the ‘sudo apt upgrade’ in the Ubuntu terminal.
What is the sudo apt-get update command?
This command is used in Debian-based Linux distro to download all the information about packages from configured sources.
How long does sudo apt upgrade take?
As it is a very simple task, it takes up to a maximum of 2 minutes to upgrade the packages to their latest versions.

Related Articles


<< Go Back to Upgrade Package in Linux | Package Management in Linux | Learn Linux Basics

5/5 - (10 votes)
Mitu Akter Mou

Hello, This is Mitu Akter Mou, currently working as a Linux Content Developer Executive at SOFTEKO for the Linuxsimply project. I hold a bachelor's degree in Biomedical Engineering from Khulna University of Engineering & Technology (KUET). Experiencing new stuff and gathering insights from them seems very happening to me. My goal here is to simplify the life of Linux users by making creative articles, blogs, and video content for all of them. Read Full Bio

Leave a Comment