Ubuntu更换源列表

前言

Ubuntu默认的安装源是http://archive.ubuntu.com/ubuntu/,在国内访问速度比较慢。最好是换成国内的安装源,能够节省很多时间。本文中,我们假设系统为Ubuntu14.04.5,打算换成Ubuntu官方中国的安装源(阿里、网易、搜狐等的更换方法类似)。Ubuntu14的源地址可以在模板:14.04source中找到,其他版本Ubuntu的源地址可以在源列表中找到。

配置步骤

配置步骤参考如何修改Ubuntu的源列表(source list),操作如下:

1、备份源列表文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2、编辑源列表文件
sudo vim /etc/apt/sources.list

修改为:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
##測試版源
deb http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
# 源碼
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
##測試版源
deb-src http://cn.archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
# Canonical 合作夥伴和附加
# deb http://archive.canonical.com/ubuntu/ trusty partner
# deb http://extras.ubuntu.com/ubuntu/ trusty main

3、更新资源包
sudo apt-get update

如果报错Error connecting: Could not connect: Connection refused ,那么可以参考“Unable to connect” error with apt-get?apt-get update Error connecting Could not connect Connection refused

4、更新软件
sudo apt-get upgrade

0%