yum cheat sheet

From thelinuxwiki
Jump to: navigation, search


Install and remove a package or multiple packages:
# yum install [foo]
# yum remove [foo]
# yum install [foo fie fo fum]
# yum remove [foo fie fo fum]

Update an installed package:

  1. yum update [foo]

List available updates for installed packages:

# yum list updates

Update the whole system:

# yum update

housekeeping, will update repo lists and can fix update problems

# yum clean all

Run automatic daily updates:

# chkconfig --level 345 yum on; service yum start

Search for a package when you know the name:

$ yum search foo

Search for a package when you're not sure of the name, using ordinary regular expression wildcards:

$ yum list foo*
$ yum list *foo?

Find out which package a file belongs to:

$ yum provides [foo]

Yum has package groups that install big clumps of stuff at once. You can see a list of these:

$ yum grouplist

These are managed with almost the same commands as individual packages, with the group's name enclosed in single quotes:

# yum groupinstall 'FTP Server'
# yum groupupdate 'FTP Server'
# yum groupremove 'FTP Server'

By default, Yum queries your remote repositories every single time you run it, which are listed in /etc/yum.repos.d. This can get boring pretty quickly because it takes time to download fresh package lists. An alternative is to create a local Yum cache. To do this, add this line to /etc/yum.conf:

taken from Cheatsheet-Master-Linux-Package-Management