Ubuntu快速换源教程


目的:为了解决上网查资料过慢问题。可以通过换源来提高速度。

(1)备份系统源

cd /etc/apt
sudo mv sources.list sources.list.bak

(2)开始修改sources文件

有安装vim用户:

sudo vim sources.list

无安装vim用户:

sudo gedit sources.list

(3)写入阿里云的源(版本:Ubuntu 22.04)

发现现在很多源都没办法用了,我自己用了阿里云的源可以用,希望对你们有用

deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse

阿里云的源(版本:Ubuntu 21.04)

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

 

!注意查看自己Ubuntu版本,如果依赖比你系统版本新,那么它会更新你系统的版本库。特别是一些基础库,如libc等。这些请大家一定要看清楚看清楚看清楚再更新。因为一旦更新后,你的系统内核可能就不稳定,常见的就是桌面崩了。

可以用此指令查看Ubuntu版本:

lsb_release -a

显示如下:

Distributor ID: Ubuntu    //类别是ubuntu
Description:    Ubuntu 14.04.2 LTS  //14年2月4月发布的稳定版本,LTS是Long Term Support:长时间支持版本  三年 ,一般是18个月
Release:    14.04  //发行日期或者是发行版本号
Codename:   trusty //ubuntu的代号名称

 

(4)执行更新

sudo apt-get update

 

posted @ 2022-10-18 00:32  想撸猫猫  阅读(1008)  评论(0编辑  收藏  举报