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

HTML table tag tutorial (13): internal border style attributes RULES

RULES can be used to control the style of the int...

Example code for implementing a pure CSS pop-up menu using transform

Preface When making a top menu, you will be requi...

Let’s talk about the symbol data type in ES6 in detail

Table of contents Symbol Data Type The reason why...

Tutorial on deploying nginx+uwsgi in Django project under Centos8

1. Virtual environment virtualenv installation 1....

Detailed steps to install and uninstall Apache (httpd) service on centos 7

uninstall First, confirm whether it has been inst...

Detailed explanation of using INS and DEL to mark document changes

ins and del were introduced in HTML 4.0 to help au...

Detailed explanation of the usage of scoped slots in Vue.js slots

Table of contents No slots Vue2.x Slots With slot...

Native JavaScript carousel implementation method

This article shares the implementation method of ...

Solution for Nginx installation without generating sbin directory

Error description: 1. After installing Nginx (1.1...

MySQL performance optimization tips

MySQL Performance Optimization MySQL is widely us...

How to solve the slow speed of MySQL Like fuzzy query

Question: Although the index has been created, wh...