我执行了以下命令:
sudo rename 's/\.list$/.list.disable/' /etc/apt/sources.list.d/*.list
sudo apt-get update
sudo aptitude -f install libgl1-mesa-dri:i386=9.2.1-1ubuntu3 libgl1-mesa-glx:i386=9.2.1-1ubuntu3`
现在每次我尝试sudo apt-get update
都会得到以下信息:
N: Ignoring file 'linrunner-tlp-trusty.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'fossfreedom-rhythmbox-plugins-trusty.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'atareao-atareao-trusty.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 'webupd8team-sublime-text-2-trusty.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
我的问题是:我到底对我的系统做了什么以及如何恢复它?
答案1
这
rename 's/\.list$/.list.disable/' /etc/apt/sources.list.d/*.list
将所有文件/etc/apt/sources.list.d/
从重命名*.list
为*.list.disabled
。
可能最简单的做法就是把重命名反过来:那么这将是......
rename 's/\.list.disable$/.list/' /etc/apt/sources.list.d/*.list.disable
sudo apt-get update
答案2
存储库源保存在 中/etc/apt/sources.list
。此文件告诉 apt 检查哪些存储库以获取更新。
当添加多个额外的存储库时,列表会变得很长且难以维护;因此.list
有时会将文件添加到/etc/apt/sources.list.d
。这样可以更轻松地根据需要启用和禁用存储库。在执行更新检查之前,后台apt
只需在主列表文件中读取它们即可。
您曾经将sed
中的所有文件的文件名更改sources.list.d
为.list.disable
,这就会禁用它们。
消息来自apt
:
...it has an invalid filename extension
您需要将这些文件的扩展名改回才能.list
再次启用它们。