ubuntu全版本通用换源教程


我使用树莓派安装Ubuntu系统,用国内源更新

每个版本的源都是不同的,

如果源的版本不同就会出现很多的错误,比如gcc缺少依赖项等

首先打开终端输入

lsb_release -a

查看版本的代号和版本

release就是该ubuntu的版本号

codename就是该版本的代号

然后打开源文件:

sudo vim /etc/apt/sources.list
或者
sudo nano /etc/apt/sources.list

如果显示 vim:没有这个命令 就将vim换成vi或下载vim

sudo apt install vim

按i进入编辑模式

将原来的内容全部删除

将源地址加入进去:

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

codename就是课该版本的代号,比如说我的是22.10版本的(kinetic),我的源就是

deb https://mirrors.ustc.edu.cn/ubuntu/ kinetic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ kinetic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ kinetic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ kinetic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ kinetic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ kinetic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ kinetic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ kinetic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ kinetic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ kinetic-proposed main restricted universe multiverse

ubuntu中复制粘贴的方法:

shift + insert ,ctrl + insert
直接鼠标左键选中要复制的命令,然后在需要粘贴的地方按一下鼠标滚轮即可

之后按esc退出编辑模式

输入:wq

保存并退出

最后更新缓存和升级

sudo apt-get update
sudo apt-get upgrade # 此步骤并非必要,但可以加快以后的下载速度

重启

就完成了



扫描二维码,在手机上阅读

修复树莓派鼠标移动缓慢迟滞问题

Blender练习 纸飞机

评 论
更换验证码