我正在远程访问 linux 系统 [Ubuntu16.04 LTS]。很多事情似乎都搞砸了。我需要安装libgmp-dev
,这会E: Sub-process /usr/bin/dpkg returned an error code (1)
出错。在尝试了一些事情之后,我认为apt-get update
可能会有所帮助,但sudo apt-get update
会出现错误:
Err:18 http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial/main amd64 Packages
404 Not Found
W: The repository 'http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/mc3man/trusty-media/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
阅读一些帖子,似乎删除 ppa 是解决方案,但是我不确定如何从命令行执行此操作。这个流行的答案建议sudo apt-get install ppa-purge
在删除 ppa 之前。但是sudo apt-get install ppa-purge
再次运行会出错E: Sub-process /usr/bin/dpkg returned an error code (1)
。
我想尝试该解决方案sudo add-apt-repository --remove ppa:whatever/ppa
,但令人尴尬的是,我不确定要替换什么,whatever
因为我从未安装过这些 ppas(我只能访问该系统)。
的输出ls /etc/apt/sources.list.d
是:
aheck-ubuntu-ppa-xenial.list mc3man-ubuntu-xerus-media-xenial.list nccl-2.1.15-ga-cuda8.0.list.save
aheck-ubuntu-ppa-xenial.list.save multiverse.list opennms.list
blahota-ubuntu-texstudio-xenial.list multiverse.list.save sublime-text.list
blahota-ubuntu-texstudio-xenial.list.save myppa.list sublime-text.list.save
mc3man-ubuntu-trusty-media-xenial.list myppa.list.save
mc3man-ubuntu-trusty-media-xenial.list.save nccl-2.1.15-ga-cuda8.0.list
编辑:
当我apt-get update
从 mc3man 运行很多 ppa 时,除了那个(amd64)之外,没有任何错误,删除所有这些作为grep mc3man *
inside输出的文件是否安全/etc/apt/sources.list.d/
?
mc3man-ubuntu-trusty-media-xenial.list:deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
mc3man-ubuntu-trusty-media-xenial.list:# deb-src http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
mc3man-ubuntu-trusty-media-xenial.list.save:deb http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
mc3man-ubuntu-trusty-media-xenial.list.save:# deb-src http://ppa.launchpad.net/mc3man/trusty-media/ubuntu xenial main
mc3man-ubuntu-xerus-media-xenial.list:deb http://ppa.launchpad.net/mc3man/xerus-media/ubuntu xenial main
mc3man-ubuntu-xerus-media-xenial.list:# deb-src http://ppa.launchpad.net/mc3man/xerus-media/ubuntu xenial main
编辑2:
mv mc3man-ubuntu-trusty-media-xenial.list mc3man-ubuntu-trusty-media-xenial.list.bak
工作是因为我在代理后面,现在错误是:
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
您可以尝试
cd
进入sources.list.d
目录并运行grep
到您从错误中知道的子模式,例如:grep mc3man *
这将显示它找到的包含给定字符串的文件和行,例如
afile.list: blah/mc3man/blah
然后,您可以
sudo add-apt-repository --remove ppa:whatever/ppa
使用与字符串匹配的文件(在本例中,afile.list
)按照建议继续