Open In App

YUM vs. APT: What’s the Difference?

Yum and APT are two of the most popular package management systems in the Linux world, and they are used on various Linux distributions, such as Red Hat-based Linux use yum (Yellowdog Updater Modified) and Debian-based systems use apt (Advanced Packaging Tool).

When it comes to updating package information and keeping your system up to date, both APT and Yum have their respective commands. In this article, we will explore the Yum equivalents of the ‘apt-get update’ command. Specifically, we will delve into ‘yum makecache’, ‘yum update’, and ‘yum upgrade’ to understand how they perform similar tasks on Yum-based systems.



What does ‘sudo apt-get update’ do?

The ‘sudo apt-get update’ command is an essential part of package management on Debian and Ubuntu-based systems. It serves two primary purposes:

sudo apt-get update

The ‘sudo apt-get update’ command does not actually install or upgrade packages; it only refreshes the information about available packages and their dependencies.



Alternatives of ‘apt-get update’ in Red Hat based systems:

In Red Hat-based systems like CentOS and Fedora, the package manager used is ‘yum,’ and the equivalent operation to ‘sudo apt-get update’ can be:

We’ll discuss them one by one.

1. yum makecache

Usage:

The ‘yum makecache’ command is the closest equivalent to ‘apt-get update’ in the Yum package management system. It serves the essential purpose of updating the package cache, allowing Yum to know the latest available packages, dependencies, and their respective versions. The ‘makecache’ operation retrieves information from the configured Yum repositories and stores it in the local cache for faster package management operations.

Syntax:

To run ‘yum makecache,’ open your terminal and execute the following command:

sudo yum makecache

Output: sudo yum makecache

2. yum update

Usage:

The ‘yum update’ command is the Yum equivalent of ‘apt-get upgrade’ in the Debian-based APT system. It is used to update the installed packages on your system to their latest available versions. Running ‘yum update’ will check the configured Yum repositories for updates and then install them on your system.

Yum will then retrieve the latest package information from its repositories and prompt you to confirm the installation of updates. You can choose to proceed or cancel the operation as per your requirements. It’s essential to keep your system up to date to ensure security and access the latest features and bug fixes.

Syntax:

To perform a system update using Yum, execute the following command:

sudo yum update

Output: sudo yum update

3. yum upgrade

Usage:

“yum upgrade” performs the same action as “yum update,” but once finished, it also removes all of the obsolete packages from the system.

This means “yum upgrade” not only updates your packages but also helps you maintain a cleaner and more efficient system by removing packages that are no longer needed or have been replaced by newer versions.

Syntax:

sudo yum upgrade

Output: sudo yum upgrade

Conclusion

In summary, while ‘sudo apt-get update’ is the go-to command for refreshing package repository metadata on Debian and Ubuntu-based systems, ‘yum makecache’ is the equivalent operation on Red Hat-based systems like CentOS and Fedora. To keep your Yum-based system updated, you can use ‘yum makecache’ to refresh the package metadata and then choose between ‘yum update’ and ‘yum upgrade’ to update your installed packages.

To learn more about yum checkout “YUM Commands for Linux Package Management“.


Article Tags :