On previous post we have described about yum install, update, upgrade, remove, reinstall packages. The basic yum commands are below,
1. yum repolist
'repolist' you will see some numbers, those are the number of packges in the repository. repo id, repo name and status.
# yum repolist
repo id repo name status
!base/7/x86_64 CentOS-7 - Base 8,652
*!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 7,760
!extras/7/x86_64 CentOS-7 - Extras 84
!mysql-connectors-community/x86_64 MySQL Connectors Community 14
!mysql-tools-community/x86_64 MySQL Tools Community 17
!mysql56-community/x86_64 MySQL 5.6 Community Server 139
repolist: 17,536
2. yum search:
yum search command is very easy to search related packages on 'yum search package-name'
3. yum-config-manager
'yum-config-manager' command for add, enable, and disable a repository.
To add repository,
yum-config-manager --add-repo repository_url
# yum-config-manager --add-repo http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
The below command disable and enable pgdg94 repository (pgsql)
How to enable specific repo.
# yum-config-manager --enable pgdg94
How to disable specific repo.
# yum-config-manager --disable pgdg94
4. yum list:
List installed packages only
The yum-config-manager is telling yum to hide all the packages being with the string "kernel". Can see the kernel packages,
# yum list kernel
# yum list installed
# yum list installed
List available packages only
# yum list available
Displaying all installed and available packages from the repository and system.
# yum list all
to Get information about specific package details use 'info'
# yum info vsftpd
Available Packages
Name : vsftpd
Arch : x86_64
Version : 2.2.2
Release : 13.el6_6.1
Size : 151 k
Repo : cloudlinux-x86_64-server-6
Summary : Very Secure Ftp Daemon
License : GPLv2 with exceptions
Description : vsftpd is a Very Secure FTP daemon. It was written completely from
: scratch.
4. yum provides:
Find packages that provide queried files, the below command shows packages containing samba server.
# yum provides samba
5. yum clean :
# yum clean vsftpd
To delete package saved in cache
# yum clean all
Clean out all packages and meta data from cache
6. Help :
# yum help
# man yum
# man yum
7. To Find yum location:
# whereis yum
yum: /usr/bin/yum /etc/yum /etc/yum.conf /usr/share/man/man8/yum.8
Comments (0)