【Ubuntu】使用阿里云apt源来更新apt源

news2024/10/3 21:10:06

1.前言 

我在京东云买了一个云服务器,但是我第一次使用apt的时候,发现遇到了下面这些情况 

后面听老师讲,还需要执行下面这个 

 但是我再次使用apt下载软件的时候,还是出现了下面这个情况

后面问了老师才知道是apt源的问题!

2.使用阿里云的apt源来更新

首先我们需要知道我们的系统是哪个版本的

cat /etc/os-release

 

像我的就是ubuntu 22.04版本的

接下来用你熟悉的编辑器打开:

/etc/apt/sources.list

 

接下来我们需要做的就是

替换默认的

http://archive.ubuntu.com/

https://mirrors.aliyun.com/

阿里云的apt源官网:ubuntu镜像_ubuntu下载地址_ubuntu安装教程-阿里巴巴开源镜像站 (aliyun.com) 

 2.1. ubuntu 14.04 LTS (trusty) (EOL) 配置如下

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

 2.2. ubuntu 16.04 LTS (xenial) (EOL) 配置如下

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

2.3. ubuntu 18.04 LTS (bionic) 配置如下 

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

2.4. ubuntu 20.04 LTS (focal) 配置如下

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

2.5. ubuntu 22.04 LTS (jammy) 配置如下 

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

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

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

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

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

 2.6. ubuntu 23.04 (lunar) 配置如下

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

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

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

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

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

 2.7. ubuntu 24.04 (noble) 配置如下

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

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

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

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

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

3.更换apt源 

由于我的是ubuntu 22.04,所以我就选ubuntu 22.04的,把/etc/apt/sources.list之前的apt源注释掉,把新的加进去。

保存退出之后,我们注意要执行下面这个命令啊

sudo apt update

 

 然后我们就可以使用apt下载软件啦

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2186868.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

解决Github打不开或速度慢的问题

一、原因 我们先分析一下Github在国内访问慢或有时候登陆不上去的问题原因:其实这都是因为我们访问github官网时是直接访问域名即github.com,那么中间有个域名通过DNS解析的过程,将域名解析为对应的ip地址,其实主要时间都是花在了…

【寻找one piece的算法之路】——双指针算法!他与她是否会相遇呢?

💐个人主页:初晴~ 📚相关专栏:寻找one piece的刷题之路 什么是双指针算法 双指针算法是一种常用的编程技巧,尤其在处理数组和字符串问题时非常有效。这种方法的核心思想是使用两个指针来遍历数据结构,这两…

学习记录:js算法(五十二):验证二叉搜索树

文章目录 验证二叉搜索树我的思路网上思路 总结 验证二叉搜索树 给你一个二叉树的根节点 root ,判断其是否是一个有效的二叉搜索树。 有效 二叉搜索树定义如下: 节点的 左子树 只包含 小于 当前节点的数。 节点的 右子树 只包含 大于 当前节点的数。 所有…

【Python】AudioLazy:基于 Python 的数字信号处理库详解

AudioLazy 是一个用于 Python 的开源数字信号处理(DSP)库,设计目的是简化信号处理任务并提供更直观的操作方式。它不仅支持基础的滤波、频谱分析等功能,还包含了滤波器、信号生成、线性预测编码(LPC)等高级…

Mybatis框架梳理

Mybatis框架梳理 前言1.ORM2.模块划分2.1 ORM的实现2.2 SQL的映射2.3 插件机制2.4 缓存机制2.5 其他 3. 愿景 前言 如果让我聊一聊mybatis,我该怎么说呢?开发中时时刻刻都在用它,此时此刻,脑海中却只浮现ORM框架这几个字&#xff…

Linux --入门学习笔记

文章目录 Linux概述基础篇Linux 的安装教程 ⇒ 太简单了,百度一搜一大堆。此处略……Linux 的目录结构常用的连接 linux 的开源软件vi 和 vim 编辑器Linux 的关机、开机、重启用户登录和注销用户管理添加用户 ⇒ ( useradd 用户名 ) ( useradd -d 制定目…

【AIGC】内容创作——AI文字、图像、音频和视频的创作流程

我的主页:2的n次方_ 近年来,生成式人工智能(AIGC,Artificial Intelligence Generated Content)技术迅速发展,彻底改变了内容创作的各个领域。无论是文字、图像、音频,还是视频,A…

SPARK调优:AQE特性(含脑图总结)

学完AQE需要能够回答如下的几个问题: 什么是AQE?AQE的实现原理是什么?AQE的特性有哪些?使用什么参数实现?AQE每个特性可以解决什么问题?什么问题是AQE不能解决的 HL:学习脑图如下 SparkAQE是spa…

MES系统适用于哪些行业?MES系统对于企业的作用和价值

MES系统(制造执行系统)广泛应用于多个行业,并在这些行业中发挥着重要作用,为企业带来了显著的价值。以下是对MES系统适用行业及其对企业作用和价值的详细分析: 一、MES系统适用的行业 电子信息行业: 随着市…

大功率LED模块(5V STM32)

目录 一、介绍 二、模块原理 1.尺寸介绍 2.模块原理图 3.引脚描述 三、程序设计 main.c文件 timer.h文件 timer.c文件 四、实验效果 五、资料获取 项目分享 一、介绍 大功率LED模块是一种照明设备,它将大功率高亮度发光二极管(LED)集成在铝基板上&…

Linux学习笔记(二):深入理解用户管理、运行级别与命令行操作

Linux学习笔记(二):深入理解用户管理、运行级别与命令行操作 Linux学习笔记(一):Linux学习环境的安装及远程连接工具的使用 1. 用户管理 1.1 用户密码管理 创建用户密码 使用 passwd 命令可以为指定用户…

封装了一个iOS水平方向动态宽度layout

我们有时候会遇到这样的情形,就是需要展示一些动态的标签,宽度是动态的, 水平方向是一行,其实这种情况还是比较容易处理的,只是一下子想不起来, 这里做了一个相关的需求,将思路和代码记录下来&a…

第5章 总线与微命令实验

第5章 总线与微命令实验 5.1实验目的 (1)理解总线的概念和作用。 (2)连接运算器与存储器,熟悉计算机的数据通路。 (3)理解微命令与微操作的概念。 5.2实验要求 (1)做…

69 BERT预训练_by《李沐:动手学深度学习v2》pytorch版

系列文章目录 文章目录 系列文章目录NLP里的迁移学习Bert的动机Bert架构对输入的修改五、预训练任务1、2、3、 六、1、2、3、 七、1、2、3、 八、1、2、3、 NLP里的迁移学习 之前是使用预训练好的模型来抽取词、句子的特征,例如 word2vec 或语言模型这种非深度学习…

香酥胡麻饼 一口沦陷的传统美食

🥯美食发现 | 胡麻饼,一口咬出的千年韵味🥯😋宝子们,今天我要给大家分享一款超级有历史底蕴的美食 —— 食家巷胡麻饼。 ✨食家巷胡麻饼,那可是有着悠久历史的传统美食。在古代,它就备受人们喜…

【算法】链表:160.相交链表(easy)+双指针

系列专栏 《分治》 《模拟》 《Linux》 目录 1、题目链接 2、题目介绍 3、解法(双指针) 返回结果 算法正确性 时间复杂度 4、代码 1、题目链接 160. 相交链表 - 力扣(LeetCode) 2、题目介绍 ​ 3、解法(…

MISC -第十天(音符加解密、敲击码、NtfsStreamsEditor工具)

前言 各位师傅大家好,我是qmx_07,今天继续讲解MISC的相关知识 [MRCTF2020]你能看懂音符吗 附件信息: rar文件无法打开,显示损坏,先放到hxd查看 头标识错误,尝试修复 rar标识头(52 61 72 21) 压缩包里有一个d…

4个顶级的大模型推理引擎

LLM 在文本生成应用中表现出色,例如具有高理解度和流畅度的聊天和代码完成模型。然而,它们的庞大规模也给推理带来了挑战。基本推理速度很慢,因为 LLM 会逐个生成文本标记,需要对每个下一个标记进行重复调用。随着输入序列的增长&…

【游戏模组】星际争霸1代模组燃烧之地,泰伦帝国对决UED。特效华丽兵种巨多特别好玩

各位星际争霸1代的粉丝大家好,今天小编给大家带来一个星际争霸1代的模组,这个模组的名字叫燃烧之地,主要是2个阵营。玩家可以扮演UED或者泰伦帝国中的一个来进行比赛。 这个模组设定的世界线背景是在异虫入侵并随后被星灵消灭后,…

昇思MindSpore进阶教程--梯度累加

大家好,我是刘明,明志科技创始人,华为昇思MindSpore布道师。 技术上主攻前端开发、鸿蒙开发和AI算法研究。 努力为大家带来持续的技术分享,如果你也喜欢我的文章,就点个关注吧 正文开始 本教程介绍梯度累加的训练算法…