How to change apt-get source in Ubuntu 18.04

How to change apt-get source in Ubuntu 18.04

When using apt-get to install, it will be very slow. After changing the domestic source, this problem can be solved.

1. Back up the sources.list file

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

2. Open the sources.list file

sudo gedit /etc/apt/sources.list

3. Delete the original content and add the following content

#TsinghuaSource
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

#AlibabaCloudSource
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

Both sources can be used. I have tried both and feel that the Alibaba Cloud source is faster.

4. Update

After saving the sources.list file you need to update apt-get.

sudo apt-get update

After the update is complete, you can use it normally.

This is the end of this article about changing the apt-get source in Ubuntu 18.04. For more information about changing the apt-get source in Ubuntu 18.04, 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 change the domestic source of Ubuntu 20.04 apt
  • Detailed explanation of several domestic update sources for Ubuntu 16.04
  • How to change Alibaba source in Ubuntu 14.04 and Ubuntu 16.04
  • How to configure Ubuntu 17.04 to change the domestic source
  • How to change the Ali source in Ubuntu 20.04
  • Example of how to change the domestic source in Ubuntu 18.04
  • Detailed process of changing apt source to Alibaba Cloud source in Ubuntu 18.04

<<:  Detailed example of using case statement in MySQL stored procedure

>>:  Vue uses el-tree lazy loading to implement the add, delete, modify and query functions

Recommend

What is COLLATE in MYSQL?

Preface Execute the show create table <tablena...

Detailed explanation of Vue element plus multi-language switching

Table of contents Preface How to switch between m...

Share 13 excellent web wireframe design and production tools

When you start working on a project, it’s importa...

In-depth explanation of the global status of WeChat applet

Preface In WeChat applet, you can use globalData ...

Complete steps for Docker to pull images

1. Docker pull pulls the image When using $ docke...

Detailed explanation of Vue life cycle functions

Table of contents Lifecycle Functions Common life...

Analysis of the Principle of MySQL Index Length Limit

This article mainly introduces the analysis of th...

A Brief Analysis on the Time Carrying Problem of MySQL

The default time type (datetime and timestamp) in...

Overview of the basic components of HTML web pages

<br />The information on web pages is mainly...

Common JavaScript memory errors and solutions

Table of contents 1. Timer monitoring 2. Event mo...

Tutorial on installing mysql5.7.17 via yum on redhat7

The RHEL/CentOS series of Linux operating systems...

Solve the problem when setting the date to 0000-00-00 00:00:00 in MySQL 8.0.13

I just started learning database operations. Toda...

Gojs implements ant line animation effect

Table of contents 1. Gojs Implementation 1. Drawi...