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