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

Docker cleaning killer/Docker overlay file takes up too much disk space

[Looking at all the migration files on the Intern...

How to use css variables in JS

How to use css variables in JS Use the :export ke...

Vue monitoring properties and calculated properties

Table of contents 1. watch monitoring properties ...

MySQL5.7 master-slave configuration example analysis

MySQL5.7 master-slave configuration implementatio...

Several common methods of sending requests using axios in React

Table of contents Install and introduce axios dep...

A brief discussion on how to write beautiful conditional expressions in JS

Table of contents Multiple conditional statements...

Five practical tips for web form design

1. Mobile selection of form text input: In the te...

CSS draw a lollipop example code

Background: Make a little progress every day, acc...

How does Vue implement communication between components?

Table of contents 1. Communication between father...

Which one should I choose between MySQL unique index and normal index?

Imagine a scenario where, when designing a user t...

6 interesting tips for setting CSS background images

Background-image is probably one of those CSS pro...

Example of MySQL slow query

Introduction By enabling the slow query log, MySQ...