linux shell 缺少 ps 命令

1.缺少 ps 命令

apt-get install -y procps

yum install -y procps

2.缺少 pstree 命令

apt-get install -y psmisc

yum install -y psmisc

3.出现找不到包的问题:

root@7ff7c2b8677e:/# apt-get install -y procps
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package procps

更新一下就可以了:

apt-get update

再安装:

root@7ff7c2b8677e:/# apt-get install -y procps
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libprocps6 psmisc
The following NEW packages will be installed:
  libprocps6 procps psmisc
0 upgraded, 3 newly installed, 0 to remove and 86 not upgraded.
Need to get 431 kB of archives.
After this operation, 1434 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 libprocps6 amd64 2:3.3.12-3+deb9u1 [58.5 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 procps amd64 2:3.3.12-3+deb9u1 [250 kB]
Get:3 http://deb.debian.org/debian stretch/main amd64 psmisc amd64 22.21-2.1+b2 [123 kB]
Fetched 431 kB in 0s (456 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libprocps6:amd64.
(Reading database ... 17157 files and directories currently installed.)
Preparing to unpack .../libprocps6_2%3a3.3.12-3+deb9u1_amd64.deb ...
Unpacking libprocps6:amd64 (2:3.3.12-3+deb9u1) ...
Selecting previously unselected package procps.
Preparing to unpack .../procps_2%3a3.3.12-3+deb9u1_amd64.deb ...
Unpacking procps (2:3.3.12-3+deb9u1) ...
Selecting previously unselected package psmisc.
Preparing to unpack .../psmisc_22.21-2.1+b2_amd64.deb ...
Unpacking psmisc (22.21-2.1+b2) ...
Setting up psmisc (22.21-2.1+b2) ...
Setting up libprocps6:amd64 (2:3.3.12-3+deb9u1) ...
Setting up procps (2:3.3.12-3+deb9u1) ...
update-alternatives: using /usr/bin/w.procps to provide /usr/bin/w (w) in auto mode
Processing triggers for libc-bin (2.24-11+deb9u3) ...
root@7ff7c2b8677e:/#

就可以成功了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值