Ubuntu 默认是国外的源,软件下载和更新都比较慢。两种方法将下载源换成国内的源。

用"软件和更新"工具

从 Ubuntu 菜单中找到软件和更新这个应用并打开。

Responsive Image

找到下载自,选择其他 - 国内-aliyun,然后勾选前四个选项。关闭时会弹出对话框,点击更新。然后就能愉的下载软件了。

Responsive Image

修改sourcelist

备份原文件

这也算是系统文件的一部分,还是保险一点,出错了再改回来。

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

打开并修改

sudo vi /etc/apt/sources.list

vim用的不习惯的估计会和我一样找全选内容怎么操作。教给你了 在命令模式下,就是按一下esc键,然后输入ggvG。具体什么含义看VIM 笔记吧,选择后直接delete删除,再把阿里云源粘贴进去。保存退出。

#阿里云
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

更新

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get upgrade