Ubuntu 18.04 更换国内源

前言

Ubuntu配置的默认源并不是国内的服务器,下载更新软件都比较慢。所以为了在使用Ubuntu的时候有更好的体验,我们将其配置成国内源。

开始修改配置

我们采用更换/etc/apt/sources.list文件里的源的方法

方法一

一、备份源列表

# 首先备份源列表
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

二、打开sources.list文件修改
当然国内的源有很多,如阿里云、清华源等。可以自行测试选取最快的那个。
首先打开source.list文件:

# 打开sources.list文件
sudo gedit /etc/apt/sources.list

在开头添加一下内容,修改成阿里云镜像源:

#  阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb 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 main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

三、刷新列表

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential

修改源在大部分情况下可以解决下载速度慢的问题。

方法二

如果使用方法一后,下载速度仍然不理想,可以直接在software&updates里面修改。

  1. 打开software&updates
  2. download from栏修改成other…
  3. 点击select best server
  4. 然后update即可

你可能感兴趣的:(Linux)