如何解决错误 N:直接忽略文件‘sources.list.tmp’......?

如何解决错误 N:直接忽略文件‘sources.list.tmp’......?
N: Ignoring file 'sources.list.tmp' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'rm' in directory '/etc/apt/sources.list.d/' as it has no filename extension
N: Ignoring file 'sudo' in directory '/etc/apt/sources.list.d/' as it has no filename extension

答案1

打开终端并输入:

cd /etc/apt/sources.list.d/   
sudo rm sources.list.tmp sudo rm   
sudo update  

答案2

其中似乎有些文件/etc/apt/sources.list.d不符合源列表文件的规则。apt通知您它只是忽略了那些文件:

Ignoring file 'sources.list.tmp' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

似乎有一个文件sources.list.tmp(可能是文本编辑器的临时文件?)。源列表文件需要以 结尾.list。但无论如何,我认为这个文件是意外留在那里的。

另外两份通知的情况类似:

Ignoring file 'rm' in directory '/etc/apt/sources.list.d/' as it has no filename extension

Ignoring file 'sudo' in directory '/etc/apt/sources.list.d/' as it has no filename extension

似乎分别有名为rm和的文件sudo,它们也不遵循源列表文件的命名规则。

下面的话可能看起来有点居高临下,但总的来说,错误信息;)它们通常清楚地显示出在哪里可以解决问题。

相关内容