![如何删除 ppa](https://linux22.com/image/1173572/%E5%A6%82%E4%BD%95%E5%88%A0%E9%99%A4%20ppa.png)
我正在远程访问 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
因为我从来没有安装过这些 ppa(我刚刚才获得这个系统的访问权限)。
的输出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 *
安全/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/
答案1
您可以尝试cd
进入sources.list.d
目录并运行grep
到您从错误中知道的子模式,例如:
grep mc3man *
这将显示找到的包含给定字符串的文件和行,例如
afile.list: blah/mc3man/blah
然后,您可以按照sudo add-apt-repository --remove ppa:whatever/ppa
建议使用匹配字符串的文件继续进行操作(在此示例中为afile.list
)