Skip to content

Posts from the ‘Yum’ Category

28
Jun

Search for package name that install a specific binary

Let’s say we want to use a tool that is in a package but we don’t know which package it is.

So for example we want to use cgdisk binary to create partitions but the binary is not on our machine and we don’t know the package name that installs cgdisk. To find out we will run:

yum whatprovides "*/cgdisk

The result will be:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.imt-systems.com
 * epel: mirrors.n-ix.net
 * extras: centosmirror.netcup.net
 * updates: centosmirror.netcup.net
base/filelists_db                                                                                                                                     | 6.1 MB     00:00
epel/filelists_db                                                                                                                                     | 9.5 MB     00:00
extras/filelists_db                                                                                                                                   |  32 kB     00:00
updates/filelists_db                                                                                                                                  | 2.5 MB     00:00
gdisk-0.8.10-1.el6.x86_64 : An fdisk-like partitioning tool for GPT disks
Repo        : base
Matched from:
Filename    : /usr/sbin/cgdisk

So now we know the package name is gdisk and we will install it:

yum install gdisk
26
Jun

List installed packages with yum on CentOS Linux

To list all installed packages on CentOS Linux we will use yum command:

yum list installed

To find you some of installed packages we can use grep:

yum list installed | grep -i libdw
19
Jun

Reinstall a Package in CentOS Linux Using Yum

If you want to reinstall an already installed package in CentOS Linux using yum utility run the following command:

yum reinstall glibc-common

This command will reinstall glibc-common package.

12
May

Search for a specific binary in CentOS packages

To see a list of packages that install a specific binary in CentOS we run yum provides:

yum provides "*/ntpd"

The output is:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.23media.de
 * epel: mirrors.n-ix.net
 * extras: ftp.plusline.de
 * updates: ftp.plusline.de
base/filelists_db                                                                                                                            | 6.1 MB     00:00
epel/filelists_db                                                                                                                            | 9.5 MB     00:00
extras/filelists_db                                                                                                                          |  31 kB     00:00
updates/filelists_db                                                                                                                         | 2.2 MB     00:00
ntp-4.2.6p5-1.el6.centos.x86_64 : The NTP daemon and utilities
Repo        : base
Matched from:
Filename    : /etc/sysconfig/ntpd
Filename    : /etc/rc.d/init.d/ntpd
Filename    : /usr/sbin/ntpd
 
 
 
ntp-4.2.6p5-2.el6.centos.x86_64 : The NTP daemon and utilities
Repo        : updates
Matched from:
Filename    : /etc/sysconfig/ntpd
Filename    : /etc/rc.d/init.d/ntpd
Filename    : /usr/sbin/ntpd
 
 
 
ntp-4.2.6p5-3.el6.centos.x86_64 : The NTP daemon and utilities
Repo        : updates
Matched from:
Filename    : /etc/sysconfig/ntpd
Filename    : /etc/rc.d/init.d/ntpd
Filename    : /usr/sbin/ntpd
22
Mar

Find files installed by a package in CentOS

In order to find the files that are installed by a particular CentOS package we will first add a package that will help us to accomplish that:

yum install yum-utils

Now to find out what package installs dracut package:

repoquery --list dracut-033-161.el7.x86_64

or

repoquery --list dracut

or

repoquery --list *dracut*
22
Mar

Find What Package Installed a Binary in CentOS Linux

To find what is the package name that installed a specific binary we run (for example we want to know the package name that installs /usr/bin/dracut):

yum whatprovides /usr/bin/dracut

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.pidginhost.com
 * extras: mirrors.pidginhost.com
 * updates: mirrors.pidginhost.com
dracut-033-161.el7.x86_64 : Initramfs generator using udev
Repo        : base
Matched from:
Filename    : /usr/bin/dracut
 
 
dracut-033-161.el7_0.173.x86_64 : Initramfs generator using udev
Repo        : updates
Matched from:
Filename    : /usr/bin/dracut
 
 
dracut-033-161.el7.x86_64 : Initramfs generator using udev
Repo        : @anaconda
Matched from:
Filename    : /usr/bin/dracut