【linux】无法创建环境也无法安装任何包(没有用的踩坑记录)
要训练模型时突然发现linux无法创建任何python环境也无法安装任何包,报错:
Collecting package metadata (current_repodata.json): done Solving environment: failed
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Temporary failure resolving 'archive.ubuntu.com'
Err:2 http://archive.canonical.com/ubuntu xenial InRelease
Temporary failure resolving 'archive.canonical.com'
查了一下大多是说是镜像源的问题,解决方案是重新配置源,重新添加清华镜像源,尝试了这些方法【1】【2】搞了很久,并没有解决问题,所以我自己应该不是镜像源的问题。
后来发现登陆ubuntu界面就会报错:
Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings
才发现是ubuntu系统出现了问题,解决方案:
以root登录,执行命令
(1)移除缓存
sudo rm /var/lib/ubuntu-release-upgrader/release-upgrade-available
(2)运行,重新建立缓存
/etc/update-motd.d/91-release-upgrade
/usr/lib/ubuntu-release-upgrader/release-upgrade-motd
此处会出现“command not found”,可以忽略。
重新连接ssh不会再报上述错误。
-----------------------------emmmm,重启之后连接又会报这个错误
-------------------------------更新--------------------------------
解决了上述报错,且不进行重启,连接服务器不会再报这个错误,但是原有问题并没有解决,还是没法创建环境和安装包…再努力试试看吧。
尝试各种新的命令中的报错有:
wget: unable to resolve host address
Temporary failure in name resolution
nameserver:command not found
-------------------------------更新--------------------------------
当你为一个不知名bug修改各种系统文件,配置各种东西搞了三周,然后得知这是因为服务器没联网,我,真的,会谢。。。