前言
Ubuntu自带默认的软件源指向的服务器是部署在国外的,在国内进行软件下载更新时会非常慢,可以通过更改源地址指向国内的镜像数据源,比如阿里、网易、清华、中科等等
PS:因为今天群里有人在问,故把修改的方法记下来,如有异议,欢迎指正
一、桌面版图像界面设置方法
-
如果安装Ubuntu是桌面版,可以在应用栏中找到software&update软件与更新选项
-
在Ubuntu Software下Download from下拉框中选中other选择国内的镜像,如下图选择的是阿里云的镜像;也可以通过选择Select Best Server自动适配最优镜像地址,确认源地址后选择close关闭会自动加载
二、更新源文件方法
- 打开阿里云镜像官网,选择ubuntu系统,将18.04的配置地址进行复制
复制 ubuntu 18.04(bionic) 配置
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-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed 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
- 源文件sources.list在根目录etc/apt/下
通过命令编辑sources.list
sudo gedit /etc/apt/sources.list
或者
sudo vim /etc/apt/sources.list
将刚复制的阿里云镜像地址覆盖原来的地址,保存即可
- 最后加载更新源与软件
sudo apt-get update
sudo apt-get upgrade