【笔记】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 已经使用阿里云源进行软件包的更新和下载。

相关推荐
听情歌落俗10 分钟前
MATLAB3-1变量-台大郭彦甫
开发语言·笔记·算法·matlab·矩阵
Naiva1 小时前
ESP32-C3 入门09:基于 ESP-IDF + LVGL + ST7789 的 1.54寸 WiFi 时钟(SquareLine Studio 移植)
ide·笔记·vscode
..过云雨1 小时前
03.【Linux系统编程】基础开发工具1(yum软件安装、vim编辑器、编辑器gcc/g++)
linux·c语言·笔记·学习
肥肠可耐的西西公主1 小时前
后端(FastAPI)学习笔记(CLASS 3):Tortoise ORM
笔记·学习·fastapi
shinelord明2 小时前
【数据行业发展】可信数据空间~数据价值的新型基础设施
大数据·架构·云计算·创业创新
PigeonGuan2 小时前
C盘扩容笔记
笔记
XINVRY-FPGA2 小时前
XCKU15P-2FFVA1760I AMD 赛灵思 Xilinx Kintex UltraScale+ FPGA
arm开发·嵌入式硬件·阿里云·fpga开发·云计算·硬件工程·fpga
王道长服务器 | 亚马逊云3 小时前
一个迁移案例:从传统 IDC 到 AWS 的真实对比
java·spring boot·git·云计算·github·dubbo·aws
世间小小鱼3 小时前
【爬坑指南】亚马逊文件中心 AWS S3 预签名URL 前端直传
前端·云计算·aws
TG_yunshuguoji3 小时前
亚马逊云代理商:AWS亚马逊云的独特优势与实用价值
服务器·云计算·aws