yum command is an interactive, open source, rpm based, package manager for a CentOS/RHEL and clones. It can automatically perform the following operations for you:
- Core system file updates
- Package updates
- Install a new packages
- Delete of old packages
- Perform queries on the installed and/or available packages
yum is similar to other high level package managers like apt-get command/apt command.
yum where is package installed
The syntax is as follows to install htop package for a demo purpose:
# yum install htop
To list the files installed by a yum package called htop, run the following rpm command:
# rpm -q {packageNameHere}
# rpm -ql htop
Sample outputs:
/usr/bin/htop /usr/share/doc/htop-2.0.2 /usr/share/doc/htop-2.0.2/AUTHORS /usr/share/doc/htop-2.0.2/COPYING /usr/share/doc/htop-2.0.2/ChangeLog /usr/share/doc/htop-2.0.2/README /usr/share/man/man1/htop.1.gz /usr/share/pixmaps/htop.png
How to see the files installed by a yum package using repoquery command
First install yum-utils package using yum command:
# yum install yum-utils
Sample outputs:
Resolving Dependencies --> Running transaction check ---> Package yum-utils.noarch 0:1.1.31-42.el7 will be installed --> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-42.el7.noarch --> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-42.el7.noarch --> Running transaction check ---> Package libxml2-python.x86_64 0:2.9.1-6.el7_2.3 will be installed ---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ======================================================================================= Package Arch Version Repository Size ======================================================================================= Installing: yum-utils noarch 1.1.31-42.el7 rhui-rhel-7-server-rhui-rpms 117 k Installing for dependencies: libxml2-python x86_64 2.9.1-6.el7_2.3 rhui-rhel-7-server-rhui-rpms 247 k python-kitchen noarch 1.1.1-5.el7 rhui-rhel-7-server-rhui-rpms 266 k Transaction Summary ======================================================================================= Install 1 Package (+2 Dependent packages) Total download size: 630 k Installed size: 3.1 M Is this ok [y/d/N]: y Downloading packages: (1/3): python-kitchen-1.1.1-5.el7.noarch.rpm | 266 kB 00:00:00 (2/3): libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm | 247 kB 00:00:00 (3/3): yum-utils-1.1.31-42.el7.noarch.rpm | 117 kB 00:00:00 --------------------------------------------------------------------------------------- Total 1.0 MB/s | 630 kB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : python-kitchen-1.1.1-5.el7.noarch 1/3 Installing : libxml2-python-2.9.1-6.el7_2.3.x86_64 2/3 Installing : yum-utils-1.1.31-42.el7.noarch 3/3 Verifying : libxml2-python-2.9.1-6.el7_2.3.x86_64 1/3 Verifying : yum-utils-1.1.31-42.el7.noarch 2/3 Verifying : python-kitchen-1.1.1-5.el7.noarch 3/3 Installed: yum-utils.noarch 0:1.1.31-42.el7 Dependency Installed: libxml2-python.x86_64 0:2.9.1-6.el7_2.3 python-kitchen.noarch 0:1.1.1-5.el7 Complete!
How do I list the contents of a installed package using YUM?
Now run repoquery command as follows:
# repoquery --list htop
OR
# repoquery -l htop
Sample outputs:
$ type -a httpd
$ type -a htop
$ command -V htop
🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.
🐧 0 comments... add one ↓
🐧 0 comments... add one ↓
Category | List of Unix and Linux commands |
---|---|
File Management | cat |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Network Utilities | dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time |
Searching | grep • whereis • which |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |