Ubuntu
使用apt-get
下载软件时,一般速度非常慢,因为apt
默认的下载源(服务器地址)是国外的。不过国内有些学校、组织、企业提供了国内的下载源,速度基本能跑满你的带宽。
闲话少叙,开始演示更换过程。
1、确定Ubuntu的版本代号
在终端输入命令lsb_release -c
Ubuntu 12.04 (LTS)代号为precise。
Ubuntu 14.04 (LTS)代号为trusty。
Ubuntu 15.04 代号为vivid。
Ubuntu 15.10 代号为wily。
Ubuntu 16.04 (LTS)代号为xenial。
Ubuntu 18.04 (LTS)代号为bionic。
不同的系统版本,源设置不同,这里只演示Ubuntu18.04
更换apt-install
源。
2、编辑/etc/apt/sources.list文件
首先进入/etc/apt/
文件夹,命令cd /etc/apt/
然后备份sources.list
文件,防止修改错了。命令sudo cp sources.list sources.list.backup
再编辑sources.list文件,命令sudo gedit sources.list
(如果你会vi/vim也可以用它,只要能编辑就行)
清空所有内容后,粘贴为下面的内容,并保存
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
3、更新获取 阿里软件源 提供的软件列表
保存后,直接关掉编辑窗口,回到终端执行命令sudo apt-get update
,更新获取 阿里软件源 提供的软件列表。
以上就是Ubuntu18.04 更换apt
源主要内容。