1

I'm more used to Debian so yum and CentOS is a little new to me.

Apparently, lsblk is not available on this system. I'm trying to install it via yum with no luck. I just get "nothing to do".

I updated the CentOS-Base.repo file and ran yum clean all. It still doesn't find the package.

What should be my next step?

  • What does this program do? – Ignacio Vazquez-Abrams Jul 25 '13 at 2:15
  • 1
    If you ever want to know what package contains a given file on a Red Hat-based distro, use the whatprovides subcommand to yum. In this case you would do a yum whatprovides */lsblk – Bratchley Jul 25 '13 at 2:51
4

It's in the following package. You can use this command to install it on CentOS 6+:

$ sudo yum install util-linux-ng

Example

$ lsblk 
NAME                        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sr0                          11:0    1 1024M  0 rom  
vda                         252:0    0   10G  0 disk 
├─vda1                      252:1    0  500M  0 part /boot
└─vda2                      252:2    0  9.5G  0 part 
  ├─vg_mungr-lv_root (dm-0) 253:0    0  8.6G  0 lvm  /
  └─vg_mungr-lv_swap (dm-1) 253:1    0  992M  0 lvm  [SWAP]

You can see what package a program is in with this command:

$ which lsblk
/bin/lsblk

$ rpm -qf /bin/lsblk
util-linux-ng-2.17.2-12.9.el6_4.3.x86_64

Other ways to find its package

$ yum whatprovides */lsblk
Loaded plugins: fastestmirror, priorities, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: centos.mirrors.tds.net
 * epel: fedora-epel.mirror.lstn.net
 * extras: centos.someimage.com
 * updates: mirror.beyondhosting.net
76 packages excluded due to repository priority protections
util-linux-ng-2.17.2-12.9.el6.i686 : A collection of basic system utilities
Repo        : base
Matched from:
Filename    : /bin/lsblk
...

You can also use repoquery to look for packages that provide a particular executable, search by filename aka. -f:

$ repoquery -f */lsblk
util-linux-ng-0:2.17.2-12.9.el6_4.2.i686
util-linux-ng-0:2.17.2-12.9.el6_4.3.x86_64
util-linux-ng-0:2.17.2-12.9.el6_4.2.x86_64
util-linux-ng-0:2.17.2-12.9.el6_4.3.i686
util-linux-ng-0:2.17.2-12.9.el6.i686
util-linux-ng-0:2.17.2-12.9.el6.x86_64

Or you can do it using this:

$ repoquery --whatprovides */lsblk
util-linux-ng-0:2.17.2-12.9.el6_4.2.i686
util-linux-ng-0:2.17.2-12.9.el6_4.3.x86_64
util-linux-ng-0:2.17.2-12.9.el6_4.2.x86_64
util-linux-ng-0:2.17.2-12.9.el6.x86_64
util-linux-ng-0:2.17.2-12.9.el6.i686
util-linux-ng-0:2.17.2-12.9.el6_4.3.i686

Notice that the argument in most of the above examples is */lsblk. This allows repoquery to search for any matches whose path can vary, i.e. the */.

  • Thank you for all of your help. I think my problem is with the repos. None of those commands work. – Tensigh Jul 25 '13 at 4:40
  • <Hit return too soon> When I tried "yum install util-linux-ng", I still got "Nothing to Do". – Tensigh Jul 25 '13 at 4:41
  • 1
    @Tensigh - notice I said this is only available in CentOS 6+. It's not easily available for CentOS 5. – slm Jul 25 '13 at 11:39
  • 1
    @Tensigh - it doesn't appear to be available in a CentOS 5 repository. – slm Jul 25 '13 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.