How to modify the sources.list of Ubuntu 18.04 to Alibaba or Tsinghua mirror

How to modify the sources.list of Ubuntu 18.04 to Alibaba or Tsinghua mirror

1. Backup source list

The default source of Ubuntu is not a domestic server, so downloading updated software is slow. This article describes how to set up a source list and select a faster source to save download time.

# First back up the source list sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

2. Open the sources.list file and modify it

Select the appropriate source, replace the content of the original file, and save the edited file. Take Alibaba Cloud's update server as an example (from the actual test results, I personally think that Alibaba Cloud is faster than NetEase and Sohu's servers):

sudo vim /etc/apt/sources.list

3. Alibaba Cloud Mirror Source-Tsinghua Mirror Source

Note that depending on the specific Ubuntu version you are using, replace trusty in the text with the string of the corresponding version below:

Version Version Number Code
Lucid(10.04) 10.04 lucid
Precise(12.04): precise 12.04 precise
Trusty(14.04): trusty 14.04 trusty
Utopic(14.10): utopic 14.10 utopic
Ubuntu 16.04 TLS: xenial 16.04 xenial
Ubuntu 18.04 TLS: bionic 18.04 bionic

Ubuntu 18.04 TLS version Alibaba Cloud image source:

# https://opsx.alibaba.com/mirror
deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse 
deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse 

# Following the Tsinghua mirror source, the source mirror is commented to improve the apt update speed. If necessary, you can uncomment it yourself # deb-src https://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse 
# deb-src https://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

Ubuntu 18.04 TLS version Tsinghua mirror source:

# https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
# By default, the source mirror is commented to improve the apt update speed. If necessary, you can uncomment it yourself. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# Pre-release software source, not recommended to enable # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

4. Refresh the list, be sure to refresh

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

5. References

Modify ubuntu's sources.list source

Modify ubuntu's sources.list source

How to modify Ubuntu's source list

This is the end of this article about how to modify the sources.list of Ubuntu 18.04 to Alibaba or Tsinghua mirror. For more information about Ubuntu 18.04 sources.list, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to use DiagnosticSource in .NET
  • Solution to the problem of reading resources file path in Maven project
  • Java (including springboot) reads files under resources
  • How to modify Ubuntu's source list (source list) detailed explanation
  • Modification of the default source sources.list file of ubuntu20.04 LTS system
  • Solve the problem that SpringBoot cannot read files in resources after running as jar
  • Method for accessing static resources in local paths based on Springboot2.3 (solving error: Not allowed to load local resource)
  • The Library source does not match the bytecode error problem and solution generated by the Lombok plug-in in IDEA (professional test available)
  • Source Insight basic configuration code examples

<<:  Let's talk about the storage engine in MySQL

>>:  js object to achieve data paging effect

Recommend

Uniapp realizes sliding scoring effect

This article shares the specific code of uniapp t...

How to deploy LNMP architecture in docker

Environmental requirements: IP hostname 192.168.1...

Detailed explanation of CocosCreator project structure mechanism

Table of contents 1. Project folder structure 1. ...

Docker+gitlab+jenkins builds automated deployment from scratch

Table of contents Preface: 1. Install Docker 2. I...

Solve the problem of setting Chinese language pack for Docker container

If you use docker search centos in Docker Use doc...

Three solutions for sub-functions accessing external variables in JavaScript

Preface When we write web pages, we will definite...

CSS tips for implementing Chrome tab bar

This time let’s look at a navigation bar layout w...

Tutorial diagram of installing centos7.3 on vmware virtual machine

VMware Preparation CentOS preparation, here is Ce...

W3C Tutorial (14): W3C RDF and OWL Activities

RDF and OWL are two important semantic web techno...

Mysql NULL caused the pit

Using NULL in comparison operators mysql> sele...

Mini Programs enable product attribute selection or specification selection

This article shares the specific code for impleme...

VMware, nmap, burpsuite installation tutorial

Table of contents VMware BurpSuite 1. Virtual mac...