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

Several methods to execute sql files under mysql command line

Table of contents The first method: When the MySQ...

How to change password and set password complexity policy in Ubuntu

1. Change password 1. Modify the password of ordi...

Complete steps to configure a static IP address for a Linux virtual machine

Preface In many cases, we will use virtual machin...

Detailed usage of Vue timer

This article example shares the specific code of ...

JavaScript type detection method example tutorial

Preface JavaScript is one of the widely used lang...

Docker binding fixed IP/cross-host container mutual access operation

Preface Previously, static IPs assigned using pip...

Detailed steps for installing JDK and Tomcat on Linux cloud server (recommended)

Download and install JDK Step 1: First download t...

JavaScript implements constellation query function with detailed code

Table of contents 1. Title 2. Code 3. Results IV....

Basic usage of custom directives in Vue

Table of contents Preface text 1. Global Registra...

MySQL 5.6 compressed package installation method

There are two installation methods for MySQL: msi...

Markup language - web application CSS style

Click here to return to the 123WORDPRESS.COM HTML ...

How to run Spring Boot application in Docker

In the past few days, I have studied how to run s...