yum install the software prompts No package netstat available. solution

1. Introduction

Such as when I run netstat on the machine, suggesting that no such order has always been simple and crude, direct yum -y install netstat, apparently not properly installed.

[root@hadoop-103 ~]# yum -y install netstat
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                         | 3.6 kB  00:00:00     
extras                                                                                                       | 2.9 kB  00:00:00     
updates                                                                                                      | 2.9 kB  00:00:00     
(1/2): extras/7/x86_64/primary_db                                                                            | 153 kB  00:00:00     
(2/2): updates/7/x86_64/primary_db                                                                           | 5.1 MB  00:00:02     
No package netstat available.
Error: Nothing to do
[root@hadoop-103 ~]# 

In this case, how to do it?

2. Use the "yum search" command

At this point you can use "yum search" command to query the package in which:

[root@hadoop-103 ~]$ yum search netstat
Loaded plugins: fastestmirror
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
========================================================= Matched: netstat =========================================================
dstat.noarch : Versatile resource statistics tool
net-snmp.x86_64 : A collection of SNMP protocol tools and libraries
net-tools.x86_64 : Basic networking tools    #这里已经给出了netstat命令所在包

This package can then be installed directly: yum -y install net-tools

3. Use the package "yum whatprovides" where the query

You can also use yum whatprovides

[root@hadoop-103 ~]# yum  whatprovides *netstat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base/7/x86_64/filelists_db                                                                                   | 7.3 MB  00:00:04     
extras/7/x86_64/filelists_db                                                                                 | 207 kB  00:00:00     
updates/7/x86_64/filelists_db                                                                                | 3.0 MB  00:00:01     
1:net-snmp-utils-5.7.2-43.el7.x86_64 : Network management utilities using SNMP, from the NET-SNMP project
Repo        : base
Matched from:
Filename    : /usr/bin/snmpnetstat



net-tools-2.0-0.25.20131004git.el7.x86_64 : Basic networking tools
Repo        : base
Matched from:
Filename    : /bin/netstat



zsh-5.0.2-33.el7.x86_64 : Powerful interactive shell
Repo        : base
Matched from:
Filename    : /usr/share/zsh/5.0.2/functions/_netstat



net-tools-2.0-0.24.20131004git.el7.x86_64 : Basic networking tools
Repo        : @base
Matched from:
Filename    : /bin/netstat



[root@hadoop-103 ~]#

Reference link: https: //blog.csdn.net/xuejinliang/article/details/52777475

Guess you like

Origin www.cnblogs.com/cosmos-wong/p/11992926.html