ifconfig的安装和使用 Ubuntu入门之八

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.csdn.net/qq_36938617/article/details/95013583

参考2 错误 E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
https://blog.csdn.net/x1987200567/article/details/104348055

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值