现在更新时出现错误,由于损坏,我无法安装大多数软件
/etc/apt/sources.list
文件。我可以下载替换它吗?
该文件适用于美国的Ubuntu 12.04(最终Beta版)。
您可以使用此技巧。打开终端(按Ctrl+ Alt+ T)并执行这些操作
将损坏的一个移到安全的地方
sudo mv /etc/apt/sources.list ~/
并重新创建它
sudo touch /etc/apt/sources.list
打开软件和更新
software-properties-gtk
这将打开software-properties-gtk
,而未选择任何存储库。
然后,将服务器更改为主服务器或您选择的任何其他服务器。您必须在新窗口中启用一些存储库,才能在中创建新sources.list
文件/etc/apt/
。
从Ubuntu软件选项卡启用某些来源后,您可以启用更新。为此,请切换到“更新”选项卡,然后选择一个或多个更新通道。我建议至少选择安全性和更新渠道。(此图像是后来从Ubuntu xenial添加的,因此可能会有一些差异)
更新了内联内容
这是sources.list
12.04 Precise Pangolin的文件。
###### Ubuntu Main Repos
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise main restricted universe multiverse
###### Ubuntu Update Repos
deb http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu precise partner
deb-src http://archive.canonical.com/ubuntu precise partner
###### Ubuntu Extras Repo
deb http://extras.ubuntu.com/ubuntu precise main
deb-src http://extras.ubuntu.com/ubuntu precise main
If you're using another release, you need to replace the precise
word with your Ubuntu release name. You can see which name you should use with this command:
lsb_release -c -s
To replace the word, you can use this sed
command (assuming you copied the sources content in /etc/apt/sources.list
):
sudo sed -i "s/precise/$(lsb_release -c -s)/" /etc/apt/sources.list
Note 1: the word deb
and deb-src
refers to the repository format. deb
is for binary packages and deb-src
is for source packages.
Note 2: Using #
at the start of the line makes that line a comment. apt
will ignore it, so any repositories mentioned on that line will be disabled.
注3:有库线,其中包括所有四个组成部分:main
,universe
,restricted
,multiverse
。您可以通过删除单词来禁用其中的一个或多个。
注意4:您可以在其他答案中找到有关存储库的一些说明
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句