Swiftorial Logo
Home
Swift Lessons
Tutorials
Learn More
Career
Resources

Using yum

Introduction

The Yellowdog Updater, Modified (yum) is a command-line package-management utility for RPM-compatible Linux operating systems. It is used to install, update, remove, and manage software packages. This tutorial will guide you through the basics of using yum with detailed explanations and examples.

Installing Packages

To install a package using yum, use the install command followed by the name of the package. For example, to install the httpd package, you would run:

sudo yum install httpd

This command will download and install the httpd package along with its dependencies.

Updating Packages

To update a specific package, use the update command followed by the name of the package. For example, to update the httpd package, you would run:

sudo yum update httpd

If you want to update all installed packages to their latest versions, simply run:

sudo yum update

Removing Packages

To remove a package, use the remove command followed by the name of the package. For example, to remove the httpd package, you would run:

sudo yum remove httpd

This command will remove the httpd package along with any dependencies that are no longer needed.

Searching for Packages

If you are unsure of the exact name of the package you want to install, you can search for it using the search command. For example, to search for packages related to httpd, you would run:

yum search httpd

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

* base: mirror.centos.org

* extras: mirror.centos.org

* updates: mirror.centos.org

==============================================================

httpd.x86_64 : Apache HTTP Server

... (other packages)

Listing Installed Packages

To list all installed packages on your system, use the list installed command:

yum list installed

Loaded plugins: fastestmirror

Installed Packages

... (list of installed packages)

Getting Information About Packages

To get detailed information about a specific package, use the info command followed by the name of the package. For example, to get information about the httpd package, you would run:

yum info httpd

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

Available Packages

Name : httpd

Arch : x86_64

Version : 2.4.6

Release : 97.el7.centos.1

Size : 2.7 M

Repo : base/7/x86_64

Summary : Apache HTTP Server

URL : http://httpd.apache.org/

License : ASL 2.0

Description: The Apache HTTP Server is a powerful, efficient, and extensible

: web server.

Cleaning up Unused Packages and Caches

Over time, package updates and installations can leave behind unused packages and cache files. To clean up these files, you can use the clean command. For example, to remove package cache files, you would run:

sudo yum clean packages

To remove all cache files, use:

sudo yum clean all

Conclusion

Using yum is essential for managing packages on RPM-based Linux distributions. This tutorial covered the basic commands for installing, updating, removing, searching, and cleaning packages. With these commands, you should be able to efficiently manage your system's software packages.