打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Linux Ubuntu更换阿里源

Linux版本:Ubuntu 20.04

1、在同路径下备份源文件

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

2、查看版本代号

lsb_release -c

每个版本的代号是不一样的,比如:

Ubuntu 15.04 代号为:vivid

Ubuntu 16.04代号为:xenial

Ubuntu 17.04代号为:zesty

Ubuntu 18.04代号为:bionic

Ubuntu 19.04代号为:disco

Ubuntu 20.04代号为:focal

3、打开sources.list

sudo vim /etc/apt/sources.list

如果提示:sudu vim: command not found,说明未安装vim编辑器,使用如下命令安装:

sudo vim apt-get install vim

开始编辑文件,先把原有内容注释,添加如下内容:

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-backports main restricted universe multiverse

deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports 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

保存,并退出。

第二种编辑方式:

在终端输入sudo gedit /etc/apt/sources.list

4、更新软件列表

sudo apt-get update

5、更新软件包

sudo apt-get upgrade

更新完后apt源已经成功修改为阿里源了。

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
新手安装Ubuntu 16.04 操作系统
ubuntu16.04将python2改为python3并安装pip3最新版
Ubuntu 18.04 软件源修改成国内源(文件或界面形式)
VMware安装Ubuntu18
Ubuntu 16.04配置国内高速apt
Ubuntu 16.04 LTS国内快速更新源
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服