Ubuntu安装源配置文件"/etc/apt/sources.list"第X行有错误

出现这个错误,是因为sources.list文件中的获取源有问题

找到那个文件,打开文件,我们可以把里面的出现问题的行注释掉,也可以干脆把所有的源文件都换掉

下面提供一个163的源,如下

deb http://mirrors.163.com/ubuntu/ natty main universe restricted multiverse
deb-src http://mirrors.163.com/ubuntu/ natty main universe restricted multiverse
deb http://mirrors.163.com/ubuntu/ natty-security universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ natty-security universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ natty-updates universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ natty-proposed universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ natty-proposed universe main multiverse restricted
deb http://mirrors.163.com/ubuntu/ natty-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ natty-backports universe main multiverse restricted
deb-src http://mirrors.163.com/ubuntu/ natty-updates universe main multiverse restricted

之后执行$sudo apt-get update命令重新获取源

使用命令行添加源地址的方法是:

$sudo add-apt-repository "deb http://cn.archive.ubuntu.com/ubuntu/jaunty multiverse"

$sudo add-apt-repository "deb http://cn.archive.ubuntu.com/ubuntu/jaunty-updates multiverse"

$sudo apt-get update

注意上面的源地址需要根据你的需要进行修改

你可能感兴趣的:(ubuntu)