How to modify Ubuntu's source list (source list) detailed explanation

How to modify Ubuntu's source list (source list) detailed explanation

Introduction

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.

Configuration steps

1. Backup source list

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

2. Select the appropriate source, replace the contents 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 Alibaba Cloud is faster than NetEase and Sohu's servers):

deb http://mirrors.aliyun.com/ubuntu/ XXXXX main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ XXXXX-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ XXXXX-backports main restricted universe multiverse

Depending on the specific Ubuntu version you are using, replace XXXXX in the above text with the string of the corresponding version below:

Utopic(14.10): utopic
Trusty(14.04): trusty
Precise(12.04): precise
Lucid(10.04): lucid

3. Refresh the list

sudo apt-get update

After the update is complete, when you install the source again, the source package will be downloaded from the new server.

Remark:

Ubuntu 16.04 TLS version image source:

# By default, the source mirror is commented out to increase the speed of apt update. You can uncomment it if necessary. deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse

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

Summarize

This is the end of this article on how to modify Ubuntu's source list. For more information about modifying Ubuntu's source list, please search 123WORDPRESS.COM's previous articles 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
  • Modification of the default source sources.list file of ubuntu20.04 LTS system
  • How to modify the sources.list of Ubuntu 18.04 to Alibaba or Tsinghua mirror
  • 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

<<:  uni-app implements NFC reading function

>>:  Summary of MySql import and export methods using mysqldump

Recommend

How to query a record in Mysql in which page of paging

Preface In practice, we may encounter such a prob...

Explore the truth behind the reload process in Nginx

Today's article mainly introduces the reload ...

Use Rem layout to achieve adaptive

I have written an article about mobile adaptation...

Nginx URL rewriting mechanism principle and usage examples

URL rewriting helps determine the preferred domai...

A friendly alternative to find in Linux (fd command)

The fd command provides a simple and straightforw...

Nginx Layer 4 Load Balancing Configuration Guide

1. Introduction to Layer 4 Load Balancing What is...

CentOS8 - bash: garbled characters and solutions

This situation usually occurs because the Chinese...

MySQL database migration quickly exports and imports large amounts of data

Database migration is a problem we often encounte...

JavaScript message box example

Three types of message boxes can be created in Ja...

Comprehensive summary of MYSQL tables

Table of contents 1. Create a table 1.1. Basic sy...

Why is it not recommended to use index as key in react?

1. Compare the old virtual DOM with the new virtu...