Ubuntu Server 14.04配置apt-get源

1.在安装Ubuntu系统时候我们已经安装了ssh服务,所以直接xshell连接到ubuntu
2.下面进行apt-get源配置
1
注意:我们平时修改配置文件时候一定要先备份下原来的配置文件
  • 备份源:
1
zzq@ubuntu:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 

1.png

  • 配置源:

    1
    zzq@ubuntu:~$ sudo vim /etc/apt/sources.list 

    首先清空里面得到所有内容
    然后写上国内比较好的源:中科大源、阿里源

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    #中科大源:
    deb [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty main restricted universe multiverse
    deb [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty-security main restricted universe multiverse
    deb [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty-updates main restricted universe multiverse
    deb [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty-proposed main restricted universe multiverse
    deb [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty-backports main restricted universe multiverse
    deb-src [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty main restricted universe multiverse
    deb-src [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty-security main restricted universe multiverse
    deb-src [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty-updates main restricted universe multiverse
    deb-src [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty-proposed main restricted universe multiverse
    deb-src [http://debian.ustc.edu.cn/ubuntu/](http://debian.ustc.edu.cn/ubuntu/) trusty-backports main restricted universe multiverse

    #阿里源:
    deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty main multiverse restricted universe
    deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-backports main multiverse restricted universe
    deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-proposed main multiverse restricted universe
    deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-security main multiverse restricted universe
    deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-updates main multiverse restricted universe
    deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty main multiverse restricted universe
    deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-backports main multiverse restricted universe
    deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-proposed main multiverse restricted universe
    deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-security main multiverse restricted universe
    deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) trusty-updates main multiverse restricted universe

    图片.png

  • 升级源:

首先更新软件列表

1
zzq@ubuntu:~$ sudo apt-get update


然后更新软件

1
zzq@ubuntu:~$ sudo apt-get upgrade 


此时ubuntu源配置就OK了!