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源更新好之后就可以进行下载所需软件了;

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


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

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

相关推荐
Johny_Zhao16 小时前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
chlk1232 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑2 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件2 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
碳基沙盒2 天前
OpenClaw 多 Agent 配置实战指南
运维
深紫色的三北六号3 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash3 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
哈基咪怎么可能是AI3 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github
十日十行4 天前
Linux和window共享文件夹
linux
木心月转码ing4 天前
WSL+Cpp开发环境配置
linux