Find the rpm package to which the command belongs

Source: Internet
Author: User

Sometimes when we execute a command, we prompt:
[Root @ localhost ~] # Iptraf
-Bash: iptraf: command not found

I believe many of my friends will often encounter this problem.
To solve this problem, you need to install the corresponding software package. In many cases, the command name is not necessarily the software package name,
The iptraf command here happens to be the name of the software package, which is a better solution. It is OK to directly install the software package. As follows:
Yum install iptraf

But what if the command name and package name are different?
For example, the command name of the iostat command is different from that of the software package. installation fails:
1234567 [root @ localhost ~] # Yum install iostat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* Rpmforge: mirrors.neusoft.edu.cn
Setting up Install Process
No package iostat available.
Error: Nothing to do

Then we need to use the following method:
[Root @ localhost ~] # Yum-q install/usr/bin/iostat
========================================================== ========================================================== ========================================================== ============================
Package Arch Version Repository Size
========================================================== ========================================================== ========================================================== ============================
Installing:
Sysstat x86_64 9.0.4-20. el6 163 225 k
Transaction Summary
========================================================== ========================================================== ========================================================== ============================
Install 1 Package (s)
Is this OK [y/N]:

Here/usr/bin/iostat does not exist. Why can we find the package?
The rpm database is used for searching. The reason for using the/usr/bin path is that this command belongs to the user, that is,/usr. This is also a guess. If the package cannot be found using this path, change it.
If/bin is used here, it cannot be found:
[Root @ localhost bin] # yum install/bin/iostat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* Rpmforge: mirrors.neusoft.edu.cn
Setting up Install Process
No package/bin/iostat available.
Error: Nothing to do

The main problem is to check the command path. If it is correct, you can check it.

A better method. Just like it!

Create your own rpm package

Directory structure and configuration after rpm installation in Linux

Brief Introduction and demo of rpm and yum

RedHat Linux --- rpm command details

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.