ubuntu16.04更新源文件

       这几天在新台式机上装了ubuntu16.04,发现安装caffe时很多安装包安装不上,运行更新源语句sudo apt-get update,报错Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Temporary failure......,于是在网上找了好几个源列表,比如网易的,阿里云的,但是还是报错E: Some index files failed to download. They have been ignored, or old ones used instead. 然后把另一个ubuntu14.04里面可以成功运行的源文件复制过来还是会报错。

        然后试了清华的Ubuntu 镜像源很快就不报错了,https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/,具体是首先备份原文件:sudo  mv   sources.list   sources.list.bak,然后运行sudo gedit /etc/apt/sources.list,复制粘贴以下代码替换原来已有有的内容,然后保存;如果想保存Tsinghua的源或其它的源在另外的文件以后切换备用,那么可以这样做:先sudo gedit /etc/apt/sources.list.qinghua,会打开一个新建的叫sources.list.qinghua的空白文件,把以下语句复制粘贴进去,保存并关闭,也可以在这里下载ubuntu16.04源文件,最后复制其内容到sources.list文件中:sudo mv  sources.list.qinghua    sources.list

    

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multivers

运行成功的截图如下:

ubuntu16.04更新源文件_第1张图片

      最后感谢这个博文给我的启发 :Ubuntu14.04和16.04官方默认更新源sources.list和第三方源推荐(干货!) http://www.cnblogs.com/zlslch/p/6860229.html  

你可能感兴趣的:(技术总结)