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
相关推荐
qq_339282233 小时前
centos中libc.so.6No such file的解决方式
linux·运维·centos
leoufung3 小时前
ECPF 简介
linux·网络·kernel
在肯德基吃麻辣烫4 小时前
Netdata在Ubuntu环境下的安装与配置:构建实时系统监控与性能分析平台
linux·运维·ubuntu
愚戏师6 小时前
Linux复习笔记(六)shell编程
linux·笔记·shell
大胆飞猪6 小时前
Linux操作系统--进程间通信(system V共享内存)
linux
LunarCod6 小时前
Ubuntu使用Docker搭建SonarQube企业版(含破解方法)
linux·运维·服务器·ubuntu·docker·开源·sonarqube
betazhou6 小时前
基于Linux环境实现Oracle goldengate远程抽取MySQL同步数据到MySQL
linux·数据库·mysql·oracle·ogg
什么半岛铁盒7 小时前
Linux信号的保存
linux·运维·网络
百锦再7 小时前
大数据技术的主要方向及其应用详解
大数据·linux·网络·python·django·pygame
2301_803554527 小时前
vim,gcc/g++,makefile,cmake
linux·编辑器·vim