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

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


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

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

相关推荐
方便面不加香菜2 小时前
Linux--基础IO(一)
linux·运维·服务器
鼎讯信通4 小时前
风电光缆运维提质增效:G-4000A 光缆故障追踪仪破解风场巡检难题
运维·网络·数据库
三十..5 小时前
MySQL 从入门到高可用架构实战精要
运维·数据库·mysql
跨境数据猎手5 小时前
大数据在电商行业的应用
大数据·运维·爬虫
linyanRPA6 小时前
影刀RPA店群自动化实战:多店铺活动自动报名与促销管理架构设计
运维·自动化·办公自动化·rpa·python脚本·爬虫自动化·店群自动化
mounter6256 小时前
现代 Linux 内存管理的演进与变革:从传统 LRU 到多代架构 MGLRU
linux·服务器·kernel
会Tk矩阵群控的小木6 小时前
安卓群控系统对于游戏工作室实战教程
android·运维·游戏·adb·开源软件·个人开发
赵渝强老师7 小时前
【赵渝强老师】Kubernetes(K8s)中的金丝雀升级
linux·docker·云原生·容器·kubernetes
佛山个人技术开发7 小时前
GitCode SSH连接配置教程
运维·ssh·gitcode
Qt程序员7 小时前
Linux RCU 原理与应用
linux·c++·内核·linux内核·rcu