docker容器ubuntu中apt-get命令安装(install)netstat失败

Ubuntu / 1857人浏览 / 0人评论

在docker容器中查看hph-fpm运行情况,使用命令:netstat -lntup|grep 9000,提示找不到命令netstat,然而docker容器(ubuntu环境)apt-get命令安装(install)netstat失败

在什么情况下?

docker容器、Ubuntu系统

在docker容器中查看hph-fpm运行情况,使用命令:netstat -lntup|grep 9000,提示找不到命令netstat,然而docker容器(ubuntu环境)apt-get命令安装(install)net-tools失败

查看php-fpm没有运行,端口:9000

查看命令

netstat -lntup|grep 9000

提示

bash: netstat: command not found

解决方法就是使用命令apt-get install net-tools安装解决了

如果出现安装错误,查看了很多资料,都是建议建议先做

apt-get update

然、继续后续

root@9a72e865a47a:# apt-get install net-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  net-tools
0 upgraded, 1 newly installed, 0 to remove and 47 not upgraded.
Need to get 248 kB of archives.
After this operation, 963 kB of additional disk space will be used.
Get:1 http://mirrors.ustc.edu.cn/debian stretch/main amd64 net-tools amd64 1.60+git20161116.90da8a0-1 [248 kB]
Fetched 248 kB in 0s (663 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package net-tools.
(Reading database ... 13773 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-1_amd64.deb ...
Unpacking net-tools (1.60+git20161116.90da8a0-1) ...
Setting up net-tools (1.60+git20161116.90da8a0-1) ...

查看想要

root@9a72e865a47a:# netstat -lntup|grep 9000
tcp        0      0 0.0.0.0:9000            0.0.0.0:*               LISTEN      1/php-fpm: master p

转载注明:

扩展查找

0 条评论

还没有人发表评论

发表评论 取消回复

记住我的信息,方便下次评论
有人回复时邮件通知我