ubuntu各版本配置apt源(阿里源)

👨‍🎓博主简介

  🏅CSDN博客专家

  🏅云计算领域优质创作者

  🏅华为云开发者社区专家博主

  🏅阿里云开发者社区专家博主

💊交流社区: 运维交流社区 欢迎大家的加入!

🐋 希望大家多多支持,我们一起进步!😄

🎉如果文章对你有帮助的话,欢迎 点赞 👍🏻 评论 💬 收藏 ⭐️ 加关注+💗


文章目录

  • 简介
  • ubuntu各版本源内容替换:
    • [Ubuntu 14.04 LTS:](#Ubuntu 14.04 LTS:)
    • [Ubuntu 16.04 LTS:](#Ubuntu 16.04 LTS:)
    • [Ubuntu 18.04 LTS:](#Ubuntu 18.04 LTS:)
    • [Ubuntu 20.04 LTS:](#Ubuntu 20.04 LTS:)
    • [Ubuntu 22.04 LTS:](#Ubuntu 22.04 LTS:)
    • [Ubuntu 24.04 LTS:](#Ubuntu 24.04 LTS:)
  • 更新apt源

简介

  在安装ubuntu系统,我们需要安装软件及服务的时候,由于自带的apt源国内访问不到,所以下载不下来,需要更换apt源为国内源。

ubuntu各版本源内容替换:

如想换清华/中科大源,把 mirrors.aliyun.com 替换成对应域名即可,

  • 阿里源:mirrors.aliyun.com
  • 清华源:mirrors.tuna.tsinghua.edu.cn
  • 中科大:mirrors.ustc.edu.cn
ubuntu版本 代号 配置文件路径 是否仍受官方支持
14.04 trusty /etc/apt/sources.list ❌ 已停止支持
16.04 xenial /etc/apt/sources.list ❌ 已停止支持
18.04 bionic /etc/apt/sources.list ✅ 维护支持至 2028-04
20.04 focal /etc/apt/sources.list ✅ 维护支持至 2030-04
22.04 jammy /etc/apt/sources.list ✅ 维护支持至 2032-04
24.04 noble /etc/apt/sources.list.d/ubuntu.sources ✅ 维护支持至 2036-04

Ubuntu 14.04 LTS:

bash 复制代码
# 备份apt源文件
cp -ar /etc/apt/sources.list /etc/apt/sources.list-bak
# 编辑新的apt源文件
vim /etc/apt/sources.list
bash 复制代码
deb https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse

## Not recommended
# deb https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse

Ubuntu 16.04 LTS:

bash 复制代码
# 备份apt源文件
cp -ar /etc/apt/sources.list /etc/apt/sources.list-bak
# 编辑新的apt源文件
vim /etc/apt/sources.list
bash 复制代码
deb https://mirrors.aliyun.com/ubuntu/ xenial main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial main

deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb https://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb https://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main
deb https://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security universe

Ubuntu 18.04 LTS:

bash 复制代码
# 备份apt源文件
cp -ar /etc/apt/sources.list /etc/apt/sources.list-bak
# 编辑新的apt源文件
vim /etc/apt/sources.list
bash 复制代码
deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

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

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

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

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

Ubuntu 20.04 LTS:

bash 复制代码
# 备份apt源文件
cp -ar /etc/apt/sources.list /etc/apt/sources.list-bak
# 编辑新的apt源文件
vim /etc/apt/sources.list
bash 复制代码
deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse

# deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse

deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

Ubuntu 22.04 LTS:

bash 复制代码
# 备份apt源文件
cp -ar /etc/apt/sources.list /etc/apt/sources.list-bak
# 编辑新的apt源文件
vim /etc/apt/sources.list
bash 复制代码
deb http://mirrors.aliyun.com/ubuntu/ jammy main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ jammy-proposed main restricted universe multiverse

Ubuntu 24.04 LTS:

bash 复制代码
# 备份apt源文件
cp -ar /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources-bak
# 编辑新的apt源文件
vim /etc/apt/sources.list.d/ubuntu.sources
bash 复制代码
Types: deb
URIs: http://mirrors.aliyun.com/ubuntu
Suites: noble noble-security noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

更新apt源

bash 复制代码
apt-get -y update

apt源更新好之后就可以进行下载所需软件了;

如果有问题大家可以进行反馈,我来更新,谢谢大家的支持!!!


🐋 希望大家多多支持,我们一起进步!😄

🎉如果文章对你有帮助的话,欢迎 点赞 👍🏻 评论 💬 收藏 ⭐️ 加关注+💗

相关推荐
SkyWalking中文站6 小时前
认识 Horizon UI · 5/17:3D 基础设施地图
运维·监控·自动化运维
tntxia1 天前
linux curl命令详解_curl详解
linux
扛枪的书生1 天前
Linux 网络管理器用法速查
linux
SkyWalking中文站1 天前
认识 Horizon UI · 1/17:SkyWalking 新一代可观测性控制台
运维·前端·监控
顺风尿一寸1 天前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
雪梨酱QAQ1 天前
Kubeneters HA Cluster部署
运维
江华森1 天前
Spring Cloud 微服务全栈实战:从 Eureka 到 Docker Compose 一文贯通
运维
江华森1 天前
Matplotlib 数据绘图基础入门
运维
XIAOHEZIcode1 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
江华森1 天前
NumPy 数值计算基础入门
运维