Ubuntu20.04 steps to change image source

1) Backup --- sudo cp /etc/apt/sources.list /etc/apt/ sources.list.back

2) Modify the source --- sudo vim /etc/apt/sources.list

Change source: Recommend Tsinghua or Alibaba Cloud sources (try according to your own network, choose the fastest one): Tsinghua source address, select Ubuntu version (check ubuntu version command: cat /etc/issue) and copy the source content, overwrite The original content of the sources.list file

Delete all in V im normal mode : after pressing esc key, first gg (to get to the top), then dG (case sensitive )

Ali image source ubuntu 20.04 (focal)

deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

# deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

Tsinghua mirror source ubuntu 20.04 (focal)

# 默认注释了源码镜像以提高 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

(When operating in vim, enter the normal mode at the beginning. Press "i" to enter the insert mode. After editing, press "esc" to exit and enter the normal mode. Press Shift+: (press together), and then press wq+Enter. Complete save and exit operation)

Just choose to edit directly

3) Update --- sudo apt-get update

Frequently Asked Questions and Answers:

1. There  is no Release file in the warehouse "http://ppa.launchpad.net/v-launchpad-jochen-sprickerhof-de/pcl/ubuntu focal Release".

N: This source cannot be safely used for updates, so it is disabled by default.

Solution steps:

1) Open the software "Software and Updates"

2) In other software interfaces

3) Cancel and close the corresponding item, and it will be updated automatically.

4)sudo apt-get update

Guess you like

Origin blog.csdn.net/tangling1/article/details/132150597