我认为我的 Ubuntu 安装已损坏,因为现在它无法识别某些终端命令,例如 ufw/glances(已安装)。结果如下。
-bash: ufw: command not found
也sudo apt update --fix-missing
无法正常工作,因为它会产生以下结果。
Err:1 http://security.ubuntu.com/ubuntu focal-security InRelease
Temporary failure resolving 'security.ubuntu.com'
Err:2 http://lk.archive.ubuntu.com/ubuntu focal InRelease
Temporary failure resolving 'lk.archive.ubuntu.com'
Err:3 http://gb.archive.ubuntu.com/ubuntu bionic InRelease
Temporary failure resolving 'gb.archive.ubuntu.com'
Err:4 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease
Temporary failure resolving 'ppa.launchpad.net'
Err:5 http://lk.archive.ubuntu.com/ubuntu focal-updates InRelease
Temporary failure resolving 'lk.archive.ubuntu.com'
Err:6 http://ppa.launchpad.net/gluster/glusterfs-3.12/ubuntu focal InRelease
Temporary failure resolving 'ppa.launchpad.net'
Err:7 http://lk.archive.ubuntu.com/ubuntu focal-backports InRelease
Temporary failure resolving 'lk.archive.ubuntu.com'
Err:8 http://ppa.launchpad.net/gluster/glusterfs-6/ubuntu focal InRelease
Temporary failure resolving 'ppa.launchpad.net'
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://lk.archive.ubuntu.com/ubuntu/dists/focal/InRelease Temporary failure resolving 'lk.archive.ubuntu.com'
W: Failed to fetch http://lk.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Temporary failure resolving 'lk.archive.ubuntu.com'
W: Failed to fetch http://lk.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Temporary failure resolving 'lk.archive.ubuntu.com'W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/InRelease Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch http://gb.archive.ubuntu.com/ubuntu/dists/bionic/InRelease Temporary failure resolving 'gb.archive.ubuntu.com'
W: Failed to fetch http://ppa.launchpad.net/deadsnakes/ppa/ubuntu/dists/focal/InRelease Temporary failure resolving 'ppa.launchpad.net'
W: Failed to fetch http://ppa.launchpad.net/gluster/glusterfs-3.12/ubuntu/dists/focal/InRelease Temporary failure resolving 'ppa.launchpad.net'
W: Failed to fetch http://ppa.launchpad.net/gluster/glusterfs-6/ubuntu/dists/focal/InRelease Temporary failure resolving 'ppa.launchpad.net'
W: Some index files failed to download. They have been ignored, or old ones used instead.
在 ubuntu 20.2 中,我尝试将 Python 版本从 3.8 降级到 3.5 以运行特定程序时发生了这种情况。我有点晚才看到不推荐这些程序的评论,此时已经太晚了。
几点说明:我的路径如下(and it contains bin, /usr/bin and /usr/local/bin)
/home/chameera/.local/bin:/opt/lib/mpich/bin:/opt/lib/netcdf/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
- 使用 wget,无法下载任何文件,但可以通过 ssh 进入和退出机器,以及传输文件
- ping 8.8.8.8 有响应,但没有响应www.google.com
sudo dpkg --configure -a
sudo rm /var/lib/apt/lists/lock
清除、sudo rm /var/lib/dpkg/lock
、sudo rm /var/lib/dpkg/lock-frontend
中的锁定文件后不生成任何输出sudo rm /var/lib/apt/lists/* -vf
我还没有重启机器,因为它是一台远程机器,而且我有点担心重启,担心我可能会再次失去对它的访问权限,直到我物理恢复机器。如果你们能在这方面帮助我,我将不胜感激。
提前谢谢您!