Linux 22.04 version ubuntu change source

 1 Backup the original source files

        Execute the following command to backup and save the original source file.

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

 

2 Modify the source file sources.list

Open the source file, comment (or directly delete) the original source, copy and paste Ali source or other sources to save

sudo gedit /etc/apt/sources.list

or sudo vi /etc/apt/souces.list

deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal main restricted universe multiverse
deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal main restricted universe multiverse
deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal-security main restricted universe multiverse
deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal-security main restricted universe multiverse
deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal-updates main restricted universe multiverse
deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal-updates main restricted universe multiverse
deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal-proposed main restricted universe multiverse
deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal-proposed main restricted universe multiverse
deb [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal-backports main restricted universe multiverse
deb-src [http://mirrors.aliyun.com/ubuntu/](http://mirrors.aliyun.com/ubuntu/) focal-backports main restricted universe multiverse
 

 

3 update source

Execute command in terminal

sudo apt update

sudo apt upgrade

 

Guess you like

Origin blog.csdn.net/Zheng_Emperor/article/details/129813395