Ubuntu setting Tsinghua source (learning content record)

This article is for my own installation record review.
The following is ubuntu20.04Ubuntu to replace the mirror source
Ubuntu. The default server is abroad, and the connection is very slow.
Change to a domestic mirror source, use the Tsinghua mirror source, the connection will be faster
The following describes the method of replacing the Tsinghua mirror source

1. Open the Ubuntu console (shortcut key ctrl+Alt T)

insert image description here

2. Enter the /etc/apt/ path

cd /etc/apt/

3. Save the sources.list backup as sources.backup.list to prevent replacement when necessary

cp -a sources.list sources.backup.list

4. Open Tsinghua mirror official, enter ubuntu in the search box, click the small question mark next to ubuntu

https://mirrors.tuna.tsinghua.edu.cn/
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

5. Copy the image source code according to the corresponding version and check the ubuntu version

insert image description here
View the version method corresponding to ubuntu:

cat /etc/issue

According to the version number, you need to select the corresponding version on the Tsinghua website and then copy the mirror source code

6. Open sources.list

sudo gedit sources.list

7. Clear the content in sources.list, paste the image source just copied, and save the following is ubuntu20.04

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

8. Update

 sudo apt-get update

insert image description here
Now my speed here is much faster than before

Reference link:

https://blog.csdn.net/weixin_74239923/article/details/129913664
https://mirror.tuna.tsinghua.edu.cn/help/ubuntu/

Guess you like

Origin blog.csdn.net/p309654858/article/details/131778994