解决方法
- 原因是 /dev/null 设备可能被常规文件替换了,重新创建即可
方法一
方法二
1
| rm -f /dev/null; mknod -m 666 /dev/null c 1 3
|
1 2 3 4 5
| Hit:1 http://mirrors.tencentyun.com/ubuntu focal InRelease Hit:2 http://mirrors.tencentyun.com/ubuntu focal-security InRelease Hit:3 http://mirrors.tencentyun.com/ubuntu focal-updates InRelease Hit:4 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu focal InRelease Reading package lists... Done
|
问题表现
这一大堆,我也懒得看…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| ❯ apt update Hit:1 http://mirrors.tencentyun.com/ubuntu focal InRelease Hit:2 http://mirrors.tencentyun.com/ubuntu focal-security InRelease Hit:3 http://mirrors.tencentyun.com/ubuntu focal-updates InRelease 0% [Connecting to ppa.launchpad.net (91.189.95.85)]gpgv: Signature made Fri Apr 24 01:34:17 2020 CST gpgv: using RSA key 3B4FE6ACC0B21F32 gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>" gpgv: Signature made Fri Apr 24 01:34:17 2020 CST gpgv: using RSA key 871920D1991BC93C gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>" /usr/bin/apt-key: 57: cannot create /dev/null: Permission denied 0% [Connecting to ppa.launchpad.net (91.189.95.85)]gpgv: Signature made Tue Nov 2 05:30:01 2021 CST gpgv: using RSA key 3B4FE6ACC0B21F32 gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>" gpgv: Signature made Tue Nov 2 05:30:01 2021 CST gpgv: using RSA key 871920D1991BC93C gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>" /usr/bin/apt-key: 57: cannot create /dev/null: Permission denied 0% [Waiting for headers]gpgv: Signature made Tue Nov 2 05:30:35 2021 CST gpgv: using RSA key 3B4FE6ACC0B21F32 gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>" gpgv: Signature made Tue Nov 2 05:30:35 2021 CST gpgv: using RSA key 871920D1991BC93C gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>" /usr/bin/apt-key: 57: cannot create /dev/null: Permission denied Hit:4 http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu focal InRelease 0% [Working]gpgv: Signature made Sun Oct 24 03:17:20 2021 CST gpgv: using RSA key 9EA4D6FCA5D37A5D1CA9C09AAD5F235DF639B041 gpgv: Good signature from "Launchpad PPA for Alessandro Strada" /usr/bin/apt-key: 57: cannot create /dev/null: Permission denied Reading package lists... Done
|
Ref
- https://unix.stackexchange.com/questions/146633/bash-dev-null-permission-denied
-------------本文结束再接再厉-------------
微信支付
支付宝