您现在的位置是:首页 >学无止境 >ubantu换配置源网站首页学无止境
ubantu换配置源
简介ubantu换配置源
文章目录
1.配置镜像源位置
配置镜像源就在sources.list文件
2.进入终端,切换到/home/user/etc/apt/
cd /etc/apt/
3.默认这个文件是只读的,我们修改一下权限
sudo chmod 777 sources.list
解决对应的问题:-bash: /etc/apt/sources.list: 权限不够
4.修改之前,我们先备份一下系统原来配置的源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.back
5.开始修改,打开/etc/apt/sources.list文件,将原来的内容删除,然后将上述复制的内容,粘贴上,保存。这里用的是 vi 编辑器的操作,桌面版的系统也可以直接右键去编辑
sudo vi /etc/apt/sources.list
6.将下面的镜像源添加到sources.list文件中
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
7.更新源
sudo apt-get update
风语者!平时喜欢研究各种技术,目前在从事后端开发工作,热爱生活、热爱工作。