【笔记】apt源设置为阿里云源

目录

  • [1. 备份现有的源列表(可选,但推荐):](#1. 备份现有的源列表(可选,但推荐):)
  • [2. 编辑 `sources.list` 文件:](#2. 编辑 sources.list 文件:)
  • [3. 替换内容为阿里源:](#3. 替换内容为阿里源:)
  • [4. 保存并退出:](#4. 保存并退出:)
  • [5. 更新软件包索引:](#5. 更新软件包索引:)

在 Ubuntu 系统中,将 APT 源设置为阿里云源可以提高软件包更新和下载速度。你可以按照以下步骤操作:

1. 备份现有的源列表(可选,但推荐):

bash 复制代码
sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

2. 编辑 sources.list 文件:

使用以下命令打开 sources.list 文件:

bash 复制代码
sudo nano /etc/apt/sources.list

3. 替换内容为阿里源:

根据你使用的 Ubuntu 版本,将内容替换为对应的阿里源。以下是常见版本的源地址:

  • Ubuntu 22.04 (Jammy):

    复制代码
    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 20.04 (Focal):

    复制代码
    deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
  • Ubuntu 18.04 (Bionic):

    复制代码
    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

4. 保存并退出:

编辑完成后,按 Ctrl + O 保存文件,然后按 Ctrl + X 退出编辑器。

5. 更新软件包索引:

使用以下命令更新软件包索引:

bash 复制代码
sudo apt update

完成以上步骤后,APT 已经使用阿里云源进行软件包的更新和下载。

相关推荐
Database_Cool_16 分钟前
阿里云 Lindorm vs Elasticsearch 检索存储一体对比:多模数据库一站式方案首选
数据库·阿里云
kdxiaojie41 分钟前
Linux 驱动研究 —— V4L2 (3)
linux·运维·笔记·学习
百胜软件@百胜软件1 小时前
零点零一×百胜E3+业务智能中台项目启动,中台赋能客制化机械键盘品牌“加数”发展
大数据·云计算
Amazing_Cacao1 小时前
CFCA精品可可饮品中级参数推演:突破液态表达的混沌,实现萃取微观结构的绝对物理可控
笔记
十月的皮皮1 小时前
C语言学习笔记20260717-预处理机制
c语言·笔记·学习
skywalk81632 小时前
如何在FreeBSD的Linux仿真环境中运行GUI命令
云计算·腾讯云
eddietao2 小时前
MySQL+SQLServer数据库-笔记
数据库·笔记·mysql
Delta-delta3 小时前
M85-GCC13.3-CMSIS-接入笔记
笔记·单片机·嵌入式硬件
ysa0510303 小时前
【板子】德州扑克模拟
c++·笔记·板子
云布道师3 小时前
AutoMQ x 阿里云 OSS Tables:基于 Iceberg 构建流表一体的实时入湖
阿里云·云计算