美文网首页linux、Ubuntu更换ubuntu软件源
Ubuntu下几种常用到的国内源

Ubuntu下几种常用到的国内源

作者: 敲代码的令狐葱 | 来源:发表于2018-03-29 11:31 被阅读0次

    Ubuntu安装后默认的官方源是美国的服务器,但是美国服务器在国内安装软件等会有较大的限制。所以我们需要将默认的源切换为国内源。一般来说,常用的国内源有阿里源(这是中国官方源)、网易源和搜狐源等等。除此之外,还有高校源,比如清华、中科大以及浙大等等。如果是在校学生,那么换成自己学校内部的源,更新和安装软件的速度会很快。如果是非校园网络,那么最推荐的就是阿里源。不同版本的Ubuntu系统的源列表不相同,在这里我只列举Ubuntu 16.04系统的源列表。

    1. 更换源的两种方式

    (1)打开系统设置选择,software&updates,如下:

    image

    然后在跳出来的框中点击选择”Download from:“选项

    image

    再点击other选项会出现一个choose a download server框并选择China,里面有很多国内服务器可选择。

    image

    (2)在sources.list文件中手动更改源,即将对应源列表中的代码复制到sources.list文件中,过程如下:

    <1> 打开终端,通过cd指令进入sources.list文件所在目录。

    $ cd /etc/apt

    image

    <2> 将原sources.list文件拷贝做备份,可以进入/etc/apt目录下看到有一个sources.list.bak文件。

    $ sudo cp sources.list sources.list.bak

    image

    <3> 通过gedit指令对sources.list进行编辑(也可以用vim指令),并将sources.list文件中的内容全选删除,再把对应的源列表的内容复制到文件中。

    $ sudo gedit sources.list
    或 执行
    $ sudo vi sources.list 进入 sources.list后 按 ggdG 快捷vi操作删除原文件内容

    image

    <4>访问源列表里的网址,并读取软件列表,然后更新保存在本地电脑,换源结束。

    $ sudo apt-get update

    国内的源地址

    阿里云源

    # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
    deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
    deb http://archive.canonical.com/ubuntu xenial partner
    deb-src http://archive.canonical.com/ubuntu xenial partner
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
    
    

    上海交通大学

    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-backports main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-proposed main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-security main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-updates main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu-cn/ dapper main multiverse restricted universe
    
    

    Ubuntu 10.04 台湾更新源

    deb http://tw.archive.ubuntu.com/ubuntu/ lucid main universe restricted multiverse
    deb http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe main multiverse restricted
    deb http://tw.archive.ubuntu.com/ubuntu/ lucid-proposed universe main multiverse restricted
    deb http://tw.archive.ubuntu.com/ubuntu/ lucid-security universe main multiverse restricted
    deb http://tw.archive.ubuntu.com/ubuntu/ lucid-backports main multiverse restricted universe
    deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid main universe restricted multiverse
    deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-security universe main multiverse restricted
    deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-updates universe main multiverse restricted
    deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-proposed universe main multiverse restricted
    deb-src http://tw.archive.ubuntu.com/ubuntu/ lucid-backports universe main multiverse restricted
    
    

    电子科技大学

    deb http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
    deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
    deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
    deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
    deb http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
    deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise main restricted universe multiverse
    deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-backports main restricted universe multiverse
    deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-proposed main restricted universe multiverse
    deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-security main restricted universe multiverse
    deb-src http://ubuntu.uestc.edu.cn/ubuntu/ precise-updates main restricted universe multiverse
    
    

    北京理工大学

    deb http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
    deb http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-backports main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-proposed main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-security main multiverse restricted universe
    deb-src http://mirror.bjtu.edu.cn/ubuntu/ precise-updates main multiverse restricted universe
    
    

    网易源

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

    网易开源镜像站

    阿里云源

    # deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
    deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
    deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
    deb http://archive.canonical.com/ubuntu xenial partner
    deb-src http://archive.canonical.com/ubuntu xenial partner
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
    
    

    相关文章

      网友评论

        本文标题:Ubuntu下几种常用到的国内源

        本文链接:https://www.haomeiwen.com/subject/zykmcftx.html