当前位置: 首页 > article >正文

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

目录

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

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

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

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

2. 编辑 sources.list 文件:

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

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. 更新软件包索引:

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

sudo apt update

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


http://www.kler.cn/news/365132.html

相关文章:

  • Node + HTML搭建自己的ChatGPT [基础版]
  • Qt 学习第 天:线程与多线程
  • 基于RabbitMQ,Redis,Redisson,RocketMQ四种技术实现订单延时关闭功能及其相关优缺点介绍(以12306为主题)
  • 全面指南:在 Vue 中优雅封装 HTML <dialog> 组件
  • Vue中使用el-upload实现文件上传时控制提交按钮状态的最佳实践
  • NVIDIA 发布适用于网络安全的 NIM Blueprint
  • 19.面试算法-树的深度优先遍历(一)
  • Nginx15-Lua扩展模块
  • Zookeeper面试整理-Zookeeper集群管理
  • 简单走近ChatGPT
  • 信息安全工程师(55)网络安全漏洞概述
  • 解决 PHP 上传数据超时 504 错误:
  • 为微信小程序换皮肤之配置vant
  • 流批一体计算引擎-17-[Flink]中的Table API常用算子
  • 【Hive实战】Hive MetaStore升级调研
  • 金融工程--pine-script 入门
  • 软考:缓存击穿和缓存穿透
  • bitpoke- mysql-operator cluster
  • Python学习路线:从新手到专家
  • 低代码开发详解与行业应用指南
  • .net framework3.5sp1runtime组件怎么开启
  • CSS文本基础知识
  • C++游戏开发教程:从入门到进阶
  • 【数据结构初阶】二叉树---堆
  • 【力扣刷题实战】有效的括号
  • 【003】调用Kimi实现AI对话,流式内容输出_#py