Upgrade Package in Linux

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

Upgrading packages is essential to keep your system up-to-date and avail all the new features of the software packages. When you upgrade a package, it ensures your software security, fixes bugs, and makes it more healthy and stable. Therefore, if you want to have a smooth performance of your software packages, upgrade the obsolete packages regularly to the newest versions by using different package managers like apt, apt-get, dnf, yum, rpm, etc. In this article, I will walk you through the 8 easy methods to upgrade a package in Linux (Debian-based and Red-hat-based distributions). Let’s dive into the main procedure.

8 Easy Methods to Upgrade a Package in Linux

There are various package management tools that manage packages as install, remove, upgrade, and so on. If you are a Debian-based distro user, you can use apt, apt-get to upgrade packages. Moreover, yum, dnf, and rpm are the popular package managers to upgrade packages in Red-hat-based Linux. GUI can also be used to upgrade packages. So to know the detailed steps of each method, stick to this article.

You can read our Comparative Analysis of Methods to distinguish between these methods and pick one for your needs.

1. Upgrade a Package Using “apt”

When you upgrade a package with apt, it will automatically download the newest version of the package and install it to replace the older version. Hence, you don’t need to manually download the new version and install it again by removing the old one. You can easily do that just by following some steps mentioned below:

  1. Open the Ubuntu terminal.
  2. Update the packages before upgrading any package by running this command:
    sudo apt update
    EXPLANATION
    • sudo: Permits administrative privileges.
    • apt: Provides a high-level command line interface for the package management system.
    • update: Updates packages in Linux.

    Updating a package to upgrade in Linux

    After writing the Ubuntu password, the installed packages will be updated automatically.

  3. You can now check all the upgradable packages in your Linux system by writing the following code:
    apt list --upgradable
    EXPLANATION
    • list: Lists all the upgradable packages.
    • – -upgradable: Displays the upgradable packages.

    checking all the upgradable packages in Linux

    Now you can upgrade your desired package to the latest version. Here, I will upgrade the Google Chrome package.

  4. Write the command to upgrade the Google Chrome package to the latest version using apt:
    sudo apt upgrade google-chrome-stable
    EXPLANATION
    • list: Lists all the upgradable packages.
    • upgrade: Upgrades packages to the latest versions.
    • google-chrome-stable: Package name.

    upgrading a package with apt managerThe upgrading of the Google Chrome package has started.typing y to give the permission to continue the processType ‘y’ in the place to continue the process. After typing the ‘y’, the Google Chrome package has been upgraded to its newer version. Additionally, you can also run an apt full upgrade to upgrade any packages by completely removing the old version.

2. Upgrade a Package Using “apt-get” in Linux

apt-get is a straightforward package manager that can be used to upgrade packages in Debian-based Linux distros such as Ubuntu, Kali Linux, and Linux Mint. Here, I am using the Ubuntu distro to show you the full process of upgrading a package with apt-get.

Note: Always remember to update the local packages before upgrading any package that gives you all the information about the available modern version.

And, there is a significant difference between apt-get update and apt-get upgrade. To know the differences click apt-get update vs upgrade article. Moreover, to get the full view of upgrading a package check sudo apt-get upgrade.

3. Upgrade a Package Using “Yum”

Yum refers to the Yellowdog Updater Modified, a front-end package manager used in Red-hat-based Linux distros like CestOS, RHEL, and Fedora, etc. to manage packages. The ‘yum update’ command can be used to update the installed packages before upgrading the package. The update command basically downloads the package but doesn’t install it. However, the upgrade command with yum is able to install the newest version of any package. In yum update vs upgrade article, I have explained the step-by-step process of upgrading a package with yum.

4. Upgrade a Package Using “dnf”

You can upgrade a package with dnf easily which is dandified yum containing additional features. It is more up-to-date than yum. Overall, this high-level manager is better than yum. Updating can also be achieved with the dnf. The overview of this method is explained in the article called dnf update vs upgrade. By reading this article you will also know about the difference between update and upgrade.

5. Upgrade a Package Using “RPM” in Linux

It stands for Red-hat Package Manager which has the potential to upgrade a package. Primarily, red-hat-based distros use it to operate packages. However, it is as powerful as In order to do that, check the steps below:

  1. Open the Red-hat terminal.
  2. Write this command to upgrade Google Chrome with rpm:
    sudo rpm -Uvh 'google-chrome-stable_current_x86_64(1).rpm'
    EXPLANATION
    • rpm: A Red-hat package manager to manage packages in Red-hat-based Linux.
    • U: Command option to upgrade packages to the newer versions.
    • v: Command option to show verbose output.
    • h: Command option to show the hash marks representing the action of the progress of the RPM upgrade.
    • ‘google-chrome-stable_current_x86_64(1).rpm’: Google Chrome rpm package.

    upgrading a package using red-hat package manager

    In this picture, you can see the Google Chrome package is upgrading from version google-chrome-stable-104.0.5112.7 to version google-chrome-stable-116.0.5845.1 by removing the old version.

6. Upgrade a Package Using Ubuntu Software Center

Upgrading an old package version to a newer one can be done with a graphical user interface-based method. Some people find it difficult to understand the command line. No worries, follow the exact procedure stated below to get your task done:

  1. Open the ‘Ubuntu Software Center’.
  2. Go to the ‘Updates’ tab to see all the upgradable packages.
  3. Then click the ‘Update’ button to upgrade your desired software. Here, I am updating ‘Firefox’.performing upgrade a package using Ubuntu Software CenterAfter clicking the update button, an authentication will come up like the following picture.an authentication window
  4. Now, to authenticate, type your Ubuntu password and click the ‘Authenticate’ option.installing the new updates to upgrade the package in Linux

    After that, the upgraded version of Firefox will be installed in your Linux distro.

7. Upgrade a Package Using Software Updater

Software Updater automatically finds the updated version of any package and then upgrades the old package to a new version. It is a very simple and straightforward method. Therefore, to use this method, follow the steps provided below:

  1. Open the Ubuntu distro and Go to the ‘Activities’ menu.
  2. Search the ‘Software Updater’.finding software updater to upgrade package in linuxAfter finding the ‘Software Updater’, click it.upgrading all the installed packages It will automatically check the updates and upgrade the old version software to a new one.

8. Upgrade a Package Manually in Linux

To update a package manually, you have to do a lot of tasks. First of all, you need to remove the old version software package and then download the latest version of that package. Then install it to avail all the modern features. To accomplish this task successfully, follow the steps:

  1. Open the Ubuntu terminal.
  2. Uninstall the old version package by writing the following code:
    sudo apt remove google-chrome-stable
    EXPLANATION
    • remove: Removes packages in Linux.

    removing old version google chrome package

    As soon as you write ‘y’, the old version Google Chrome package which is google-chrome-stable (75.0.3770.80-1) will be removed from your Linux system.

  3. Now, download the newer version of Google Chrome Package by writing the following code:
    wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
    EXPLANATION

    downloading the latest version of google chrome package

    Now you have the .rpm file of the Google Chrome package.

  4. Convert the .rpm file to a .deb file using this command:
    sudo alien -d google-chrome-stable_current_x86_64.rpm
    EXPLANATION
    • alien: Converts packages from one form to another in Linux.
    • -d: Converts any file format to a .deb file format.
    • google-chrome-stable_current_x86_64.rpm: rpm package of Google Chrome.

    converting rpm file to a deb file

  5. After generating the .deb format, install it with the next command:
    sudo dpkg -i google-chrome-stable_116.0.5845.179-2_amd64.deb
    EXPLANATION
    • dpkg: Manages packages in Debian-based Linux distro.
    • -i: Command option used to install packages.
    • google-chrome-stable_116.0.5845.179-2_amd64.deb: .deb file of the google chrome chrome package.

    installing the latest version of the package to upgrade in linux

    Finally, you have the latest version of Google Chrome software.

Comparative Analysis of Methods to Upgrade a Package in Linux

I have explored 8 practical methods here to upgrade packages in Linux. However, you don’t need all of them, choose one according to your preferences. Go through this table to pick your best possible method.

Methods Pros Cons
Method 1
  • User-friendly and great dependency resolver.
  • More control over managing software versions.
  • Requires restart to apply any changes.
  • Consumes more disk space.
Method 2
  • Provides detailed logs of the installation and upgrade process.
  • Well-documented package manager.
  • Less User-friendly.
  • Older version package manager.
Method 3
  • Reliable and stable package manager.
  • Better dependency resolver.
  • Comparatively slower.
  • Older syntax.
Method 4
  • Faster and more efficient.
  • During upgrades, automatically handle dependencies.
  • Less popular.
  • Doesn’t work in older versions of Linux.
Method 5
  • Provides detailed information about packages.
  • More control over software upgrades.
  • Can’t resolve dependencies automatically.
  • Susceptible to human error.
Method 6
  • Convenient.
  • Easy to explore software packages.
  • Limited control.
  • Lack of modern features.
Method 7
  • Provides detailed information about packages.
  • More control over software upgrades.
  • Provides less information about packages.
  • Resource intensive.
Method 8
  • Offers software customization.
  • Precise control over software version.
  • Time consuming.
  • Security risks.

I believe this table guides you in finding your best pick. If you are a Debian-based distro user go for method 1 or if you use Red-hat-based Linux, go for method  4. Moreover, if you feel comfortable using a GUI-based approach, pick method 6. Lastly, choose method 8 to upgrade the package manually in Linux.

No Such File or Directory Error While Upgrading a Package With “rpm”

Before upgrading any package with rpm, you have to write the rpm file name, not only the package name. If you write the package name only. It will show an error like the following image.showing error because of giving wrong package nameYou can notice the error in this image. To overcome this error write the exact name of the rpm file of the Google Chrome package which is google-chrome-stable_current_x86_64(1).rpm.upgrading with rpm and showing no errorNow it shows no error. Moreover, write the package name inside a single quote ‘rpm package’ to avoid further errors.

Conclusion

I hope this article helps you find 8 different ways to upgrade the old version packages to their modern versions. It is always great to use an updated version software package as it shows better performance and potential than the old one. Moreover, updated version packages have some extra benefits. So to use the best of one software package, upgrading the package is crucial. Here, I have explained several strategies to do this. Check the steps and perform them properly. Good Luck!

People Also Ask

How to upgrade a package in Linux?

To upgrade a package in Linux using apt, first run sudo apt update to get the recent information about the packages. Then write sudo apt upgrade <package_name> to upgrade the specific package to its latest version.

How to upgrade all packages in Debian?

To upgrade all packages in Debian based Linux, first update the package list using the sudo apt update command. Then run sudo apt upgrade to upgrade all packages to their latest versions available in the repositories.

How to upgrade a single package using yum?

To upgrade a single package using the yum package manager, use the sudo yum upgrade <package_name> command.

What is the command to install a package in Linux?

To install a package in a Linux Debian-based distro, run the command sudo apt install <package_name>. Use the command sudo yum install <package_name> to install packages in Red-hat-based Linux.

How to find command package in Linux?

The dedicated terminal commands apt-search and apt show assist in finding and displaying the details of the available packages in Linux.

How do I uninstall apt install?

Write this command to uninstall a package with apt: sudo apt remove <package name>.


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

4.8/5 - (15 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