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

如何删除“忽略目录 /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.

有时我可能会找到其他信息,但我无法再找到准确的信息。

答案1

要解决第一个问题,请在终端中运行以下命令:

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

(旧版本的包管理工具在您禁用 PPA 时会留下这些文件。删除它们是相当安全的)

您的第二个问题来自旧的 Karmic 存储库。要找出哪一个,请在终端中运行以下命令:

cd /etc/apt

grep -rw karmic *

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

答案2

[Ubuntu 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

答案3

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

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

 

答案4

就我的情况而言,它发出有关 /etc/apt/sources.list.d/ 目录中 *.save 文件的消息。我删除了它们。现在那里只存在 *.list 文件。那些警告也减少了。

相关内容