– Yum is a very useful, front end command for the package management in the Red Hat Linux versions.
– Yum is so simplified that its commands are like plain English like install, update, remove, re-install etc.
– So having knowledge of every aspect of the yum command is very helpful.
1. To Install
– To install any package on the Linux system, we can fire the yum install and the package name.
# yum install package1.rpm
# yum install package1.rpm package2.rpm package3.rpm package4.rpm
– Yum utility generally ask for the confirmation for package installation, if you want to specify it in the command itself then fire below command
# yum install package1.rpm -y
|
2. To Search
– To search for any package on the RPM repository (it can be RHN, Cent OS repository etc.)
# yum search package1.rpm
# yum search package1 package2
# yum search all
|
3. To Update
– To update any existing package on the system fire below update command
# yum update package1.rpm
# yum update package1.rpm package2.rpm
# yum update package1.rpm -y
|
4. To remove/uninstall
– To remove any existing package from the system
# yum remove package1.rpm
# yum remove package1.rpm package2.rpm
# yum remove package1.rpm -y
|
5. To update
– To update the entire system for the available updates from Vendor repository
# yum check-update # yum update
# yum update –y # yum update yum
|
6. Get info
– To get the information about any package
# yum info yum
# yum info vsftpd
|
7. To see the lists
– To list packages we can fire below commands
# yum list all # yum list available
# yum list installed # yum list extras
# yum list updates # yum list obsoletes
# yum list recent # yum list | less
# yum list pkgspec
|
8. To clean
– To clean the downloaded packages or metadata or information cached by yum utility.
# yum clean package1.rpm # yum clean metadata
# yum clean expire-cache # yum clean rpmdb
# yum clean plugins # yum clean all
|
9. To see what provides
– To see what service/file is provided by which package
# yum provides vsftpd
# yum provides yum
# yum whatprovides vsftpd
# yum whatprovides /etc/passwd
|
10. For groups
– The packages are grouped into Group List, like DNS, Desktop, Web Server etc. So to view/install/update the packages from grouplist fire below command.
# yum grouplist
# yum groupinstall “DNS Name Server”
# yum groupinstall “DNS Name Server” “Graphical Internet”
# yum groupupdate “DNS Name Server”
# yum groupremove “DNS Name Server”
# yum groupremove “DNS Name Server” “Graphical Internet”
|
11. Get info about group
– To get the information about the package groups.
# yum groupinfo “Graphical Internet”
# yum groupinfo “Graphical Internet” “DNS Name Server”
|
12. Resolvedep
– To specify to resolve the dependencies if any while installing or update the packages.
# yum resolvedep vsftpd
|
13. To download only
– To just download the packages on the system we can fire below commands.
# yum install yum-downloadonly
# yum install vsftpd –downloadonly
# yum update vsftpd –downloadonly
# yum update –downloadonly –downloaddir=/tmp
|
14. To locally install
– To install the downloaded packages from any local directory.
# yum localinstall package1.rpm
# yum localinstall package1.rpm package2.rpm
# yum localupdate package1.rpm
# yum localupdate package1.rpm package2.rpm
|
15. Reinstall
– To re-install any package, i.e. to unistall and then install it again.
# yum reinstall vsftpd
|
16. Downgrade
– To downgrade any package to the previous version.
# yum downgrade vsftpd
# yum downgrade vsftpd bash
|
17. To see dependency list
– To see any dependencies for the specified package.
# yum deplist vsftpd
# yum deplist vsftpd bash
|
18. Version
– To see the version information about any package.
# yum version all # yum version installed
# yum version available # yum version group
# yum version grouplist
|
19. History
– This allows the user to view what has happened in past transactions.
# yum history # yum history info
# yum history list # yum history summary
# yum history redo # yum history undo
# yum history new
|
One thought on “yum command examples”
Howdy Mate,
Thanks for highlighting this and indicating about Linux IQ where more study and thought is necessary.
I hear browser security should be taken seriously, which top extensions/add-on's do you guys use/recommend to make Firefox really safe when I am browsing, I am using Linux mint on my acer laptop to browse and email.
All UNIX files have its description stored in a structure called ‘inode’. The inode contains info about the file-size, its location, time of last access, time of last modification, permission and so on. Directories are also represented as files and have an associated inode.
Great effort, I wish I saw it earlier. Would have saved my day 🙂
Thanks and Regards
Kevin