ubuntu apt 更换阿里云源

简介:Ubuntu系统的APT(Advanced Package Tool)是一个包管理器,用于在Ubuntu上安装、卸载和更新软件包。默认情况下,APT会从Ubuntu官方源中下载软件包,但由于网络原因,有时候下载速度较慢。阿里云是国内较为常用的镜像源之一,其提供了Ubuntu官方源的镜像。

历史攻略:

docker:更换镜像源

更换Ubuntu apt阿里云源的步骤:

1、备份原有源

python 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

2、打开 sources.list 文件

python 复制代码
sudo gedit /etc/apt/sources.list

3、替换为阿里云源

python 复制代码
# 18.04

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse


# 20.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

4、更新源

python 复制代码
sudo apt-get update
相关推荐
tRNA做科研16 分钟前
Bio-Linux-shell详解-1-从0开始
linux·运维·服务器
小黑爱编程1 小时前
【Linux网络】Socket套接字
linux·运维·网络
xyt0_01 小时前
【Linux】常见指令
linux
gs801401 小时前
安装node 报错需要:glibc >= 2.28
linux·服务器·前端·node.js
何老生4 小时前
Linux之MySQL主从复制
linux·运维·mysql
ggdpzhk4 小时前
图片详解,最简单易懂!!!Ubuntu增强功能
linux·ubuntu
神奇椰子5 小时前
Ubuntu 常用指令和作用解析
linux·运维·ubuntu·centos·云计算·代码规范·浪浪云
望获linux5 小时前
Linux网络协议栈的实现
linux·服务器·arm开发·网络协议·操作系统·嵌入式操作系统
树欲静而风不止丶5 小时前
【Ubuntu】安装常用软件包
linux·ubuntu
lagransun5 小时前
Linux内核学习之 -- 系统调用open()和write()的实现笔记
linux·笔记·学习