rlk@ubuntu:~$ ifconfig
Command 'ifconfig' not found, but can be installed with:
sudo apt install net-tools
rlk@ubuntu:~$ sudo apt install net-tools
[sudo] password for rlk:
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
rlk@ubuntu:~$ sudo apt install net-tools
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? // 错误
// 方法1
rlk@ubuntu:~$ ps -A | grep apt
1364 ? 00:00:00 apt.systemd.dai
1390 ? 00:00:00 apt.systemd.dai
rlk@ubuntu:~$ sudo kill 1364
rlk@ubuntu:~$ sudo kill 1390
kill: (1390): No such process
rlk@ubuntu:~$ ps -A | grep apt
rlk@ubuntu:~$ sudo apt install net-tools
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? // 没有解决问题
rlk@ubuntu:~$ ps -A | grep apt
// 方法2
rlk@ubuntu:~$ sudo rm /var/lib/apt/lists/lock -rf
rlk@ubuntu:~$ sudo rm /var/cache/apt/archives/lock -rf
rlk@ubuntu:~$ sudo apt update
Hit:1 http://archive.ubuntukylin.com:10006/ubuntukylin xenial InRelease
Hit:2 http://archive.ubuntukylin.com:10006/ubuntukylin bionic InRelease
Hit:3 http://mirrors.cn99.com/ubuntu bionic InRelease
Hit:4 http://mirrors.cn99.com/ubuntu bionic-updates InRelease
Hit:5 http://mirrors.cn99.com/ubuntu bionic-backports InRelease
Hit:6 http://mirrors.cn99.com/ubuntu bionic-security InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
735 packages can be upgraded. Run 'apt list --upgradable' to see them.
rlk@ubuntu:~$ sudo apt install net-tools
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it? // 也没有解决问题
rlk@ubuntu:~$ sudo rm /var/lib/dpkg/lock
rlk@ubuntu:~$ sudo dpkg --configure -a // 解决问题
rlk@ubuntu:~$ sudo apt 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 735 not upgraded.
Need to get 194 kB of archives.
After this operation, 803 kB of additional disk space will be used.
Get:1 http://mirrors.cn99.com/ubuntu bionic/main amd64 net-tools amd64 1.60+git20161116.90da8a0-1ubuntu1 [194 kB]
Fetched 194 kB in 3s (59.0 kB/s)
Selecting previously unselected package net-tools.
(Reading database ... 223293 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-1ubuntu1_amd64.deb ...
Unpacking net-tools (1.60+git20161116.90da8a0-1ubuntu1) ...
Processing triggers for man-db (2.8.3-2) ...
Setting up net-tools (1.60+git20161116.90da8a0-1ubuntu1) ...
rlk@ubuntu:~$
rlk@ubuntu:~$
rlk@ubuntu:~$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.119.128 netmask 255.255.255.0 broadcast 192.168.119.255
inet6 fe80::1ba1:c44b:dcfc:df88 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:df:d4:49 txqueuelen 1000 (Ethernet)
RX packets 12817 bytes 18358314 (18.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2718 bytes 182210 (182.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 236 bytes 16326 (16.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 236 bytes 16326 (16.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
参考1 Ubuntu系统中找不到ifconfig命令
https://blog.youkuaiyun.com/qq_36938617/article/details/95013583
参考2 错误 E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
https://blog.youkuaiyun.com/x1987200567/article/details/104348055