如何删除“ /etc/apt/sources.list.d/目录中的文件,因为文件扩展名无效?”


16

从13.10升级到14.04之后,每次安装,更新,升级等等时,我都会收到这些烦人的消息:

N: Ignoring file 'webupd8team-java-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension 
N: Ignoring file 'bumblebee-stable-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension 
N: Ignoring file 'steam.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'ubuntu-x-swat-x-updates-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'xorg-edgers-ppa-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'webupd8team-java-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'bumblebee-stable-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'steam.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'ubuntu-x-swat-x-updates-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'xorg-edgers-ppa-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

如何解决消息中指出的根本问题?

编辑:有时,我会在上面的消息后附加其他消息:

W: GPG error: http://www.duinsoft.nl debs Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY E18CE6625CB26B26
W: Failed to fetch http://ppa.launchpad.net/person/ppa/ubuntu/dists/karmic/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/person/ppa/ubuntu/dists/karmic/main/binary-i386/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

有时,我可能会其他人,但是我找不到确切的消息了。

Answers:


13

要解决您的第一个问题,请在终端中运行此命令:

sudo rm /etc/apt/sources.list.d/*.disable

(禁用PPA时,较旧版本的软件包管理工具会保留这些文件。删除它们非常安全)

您的第二个问题来自旧的Karmic存储库。要找出在终端机中运行该程序的人:

cd /etc/apt

grep -rw karmic *

一旦知道了它来自哪个存储库,就可以很容易地禁用/删除它。


1
将.disable文件移动到另一个位置胜于删除。
2014年

4

也许您应该尝试使用以下命令:

sudo sh -c "echo 'Dir::Ignore-Files-Silently:: \"(.save|.distupgrade)$\";' > /etc/apt/apt.conf.d/99ignoresave"

 


这只会掩盖问题,也许会建议删除文件的方法?
hazrpg

点可能应该转义。
Pedro Gimeno

这实际上会做任何事情吗,因为op列出的所有文件都带有后缀,.disabled而答案仅带有后缀,.save并且.distupgrade
北部布雷德利

1

我在Ubuntu MATE 15.04中有一个类似的问题。后

sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' > /etc/apt/sources.list.d/pgdg.list"

wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -

sudo apt-get update

我收到此消息:

N: Ignoring file 'pgdg.listwget' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

我这样解决了:

sudo mv /etc/apt/sources.list.d/pgdg.listwget /etc/apt/sources.list.d/pgdg.list

0

就我而言,它正在为/etc/apt/sources.list.d/目录中的* .save文件提供消息。我删除了它们。现在,那里仅存在* .list文件。这些警告减少了。


0

[kubuntu 18.04]

我无法弄清楚为什么在似乎没有任何东西明确设置后缀.distUpgrade和后缀时会.save被忽略。

然后我发现其中apt-config dump | grep -i ignore有这些条目和其他条目:

Dir::Ignore-Files-Silently "";
Dir::Ignore-Files-Silently:: "~$";
Dir::Ignore-Files-Silently:: "\.disabled$";
Dir::Ignore-Files-Silently:: "\.bak$";
Dir::Ignore-Files-Silently:: "\.dpkg-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.ucf-[a-z]+$";
Dir::Ignore-Files-Silently:: "\.save$";
Dir::Ignore-Files-Silently:: "\.orig$";
Dir::Ignore-Files-Silently:: "\.distUpgrade$";

我只是将那些狡猾的人改名为那些扩展名。(我选择了.orig


-1

我们还可以像这样解决此问题:

sudo mv /etc/apt/sources.list.d/webupd8team-java-raring.list.disable /etc/apt/sources.list.d/webupd8team-java-raring.list

这仅适用于单个文件。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.