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
相关推荐
不是笨小孩i1 小时前
开源AI图片处理工具HivisionIDPhotos安装与证件照制作指南
ubuntu
二十雨辰1 小时前
[linux]docker基础
linux·运维·docker
饮浊酒2 小时前
Linux操作系统 ------(3.文本编译器Vim)
linux·vim
lihuhelihu2 小时前
第3章 CentOS系统管理
linux·运维·服务器·计算机网络·ubuntu·centos·云计算
矛取矛求2 小时前
Linux系统性能调优技巧
linux
One_Blanks2 小时前
渗透测试-Linux基础(1)
linux·运维·安全
Perishell2 小时前
无人机避障——大疆与Airsim中的角速度信息订阅获取
linux·动态规划·无人机
爱吃喵的鲤鱼2 小时前
linux进程的状态之环境变量
linux·运维·服务器·开发语言·c++
dessler3 小时前
Linux系统-ubuntu系统安装
linux·运维·云计算
荒Huang3 小时前
Linux挖矿病毒(kswapd0进程使cpu爆满)
linux·运维·服务器