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

从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. 

有时,我可能会有其他人,但我再也找不到准确的信息了。

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

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

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

你的第二个问题来自旧的Karmic存储库。 要找出哪个在终端中运行它:

 cd /etc/apt grep -rw karmic * 

一旦你知道它来自哪个存储库就很容易禁用/删除它。

也许你应该尝试这个命令:

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

我在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 

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

我们也可以像这样解决这个问题:

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

这仅适用于单个文件。