NoteZ_技术博客 NoteZ_技术博客
🏠 首页
  • 📚 Web技术
  • 📋 Npm笔记
  • 📑 Markdown
  • 📄 Git笔记
  • 📝 Nginx文档
  • 📓 Linux文档
  • 📖 技术文档
  • 📜 其他文档
  • 🧊 NodeJs
  • 🎡 Express
  • 🔥 Rust
  • 🎉 Koa2
  • 🍃 MongoDB
  • 🐬 MySql
  • 🥦 Oracle
  • 🍁 Python
  • 🍄 JavaScript
  • 🌰 CSS
  • 🧄 HTML
  • 🥑 Canvas
  • 🌽 Nuxt
  • 🍆 React
  • 🥜 Vue
  • 🧅 TypeScript
  • 🌶️ AI
  • 📘 分类
  • 📗 标签
  • 📙 归档
⚜️ 在线编辑 (opens new window)
  • 📁 站点收藏
  • 📦 前端组件库
  • 📊 数据可视化
  • 🌈 开源插件
  • 🎗️ 关于我
  • 🔗 友情链接
GitHub (opens new window)

NoteZ_技术博客

前端界的小学生
🏠 首页
  • 📚 Web技术
  • 📋 Npm笔记
  • 📑 Markdown
  • 📄 Git笔记
  • 📝 Nginx文档
  • 📓 Linux文档
  • 📖 技术文档
  • 📜 其他文档
  • 🧊 NodeJs
  • 🎡 Express
  • 🔥 Rust
  • 🎉 Koa2
  • 🍃 MongoDB
  • 🐬 MySql
  • 🥦 Oracle
  • 🍁 Python
  • 🍄 JavaScript
  • 🌰 CSS
  • 🧄 HTML
  • 🥑 Canvas
  • 🌽 Nuxt
  • 🍆 React
  • 🥜 Vue
  • 🧅 TypeScript
  • 🌶️ AI
  • 📘 分类
  • 📗 标签
  • 📙 归档
⚜️ 在线编辑 (opens new window)
  • 📁 站点收藏
  • 📦 前端组件库
  • 📊 数据可视化
  • 🌈 开源插件
  • 🎗️ 关于我
  • 🔗 友情链接
GitHub (opens new window)
  • Web技术

  • Git笔记

  • Linux文档

    • CentOS7 -bash:vim:未找到命令
    • CentOS系统中升级Git版本
    • Linux 下 Git 免登录不需重复输入账号和密码
    • Linux 下安装 Nginx 详细教程
    • Linux 中 mysql 数据库的备份与还原
    • Linux 使用 npm 安装 cnpm 镜像
    • Linux 安装 mysql 并设置远程连接
    • linux 环境安装 java 环境和 eclipse
    • Linux 系统命令总结
    • linux安装nvm并快速修改node版本
    • Linux防火墙配置相关笔记
    • Linux(centos7)上安装 Node.js 的 4 种方法(包含npm)
    • Linux(centos7)下 pm2 的安装步骤及问题总结
    • Linux(centos7)下查看端口占用情況
    • 【Linux-编译器gcc|glibc升级】CentOS7.x使用高版本NodeJS时报错解决方案
    • 如何在Linux系统(CentOS7.x)上安装Git
    • CentOS 7安装 FFmpeg音频视频处理工具
    • centos7 下通过docker安装sentry
    • CentOS7安装Gitea
    • CentOS7下安装GraphicsMagick或ImageMagick方法
    • Centos安装MySQL
    • Linux-客户端npc内网穿透开机后台自启动
    • linux(contOS_7)下安装git
    • 两台远程Linux服务器之间传输文件的四种方法(scp、rcp、wget、rsync)总结
    • Ubuntu20.x使用root账户远程登录ssh处理方法
    • Ubuntu 更换 apt 源为阿里云镜像源
      • 一、为啥换源
      • 二、换源步骤
      • 三、参考链接
      • 四、其他
    • linux 下 CentOS7 安装 LibreOffice 详细过程
    • linux 下 Ubuntu 安装 LibreOffice 方法
    • Linux 下安装 pm2 并设置开机自启动服务
    • Linux 服务器之 systemctl 命令使用详解
    • 在 linux下的 CentOS7 安装 Onlyoffice 详细步骤
    • Linux 下 Gitlab 相关配置记录
    • Linux(Ubuntu)下安装最新版 ffmpeg7
    • Linux (Ubuntu 24.04) 切换软件源为清华源
    • Linux 之 Ubuntu-24.04 安装英伟达显卡驱动
    • Ubuntu 上安装 【docker】 的详细指南
    • Ubuntu 安装 Anaconda 【conda】换源并配置 Python 环境
    • Linux(Ubuntu)安装 open-webui 最新方式汇总
    • linux 安装 ollama 基本步骤
    • Linux 使用 rsync 互相传输同步文件的简单步骤
  • Markdown

  • Nginx文档

  • Npm笔记

  • 技术文档

  • 其他文档

  • 前端开发
  • Linux文档
NoteZ
2024-05-29
目录

Ubuntu 更换 apt 源为阿里云镜像源

# 一、为啥换源

ubuntu下一般使用apt-get或者apt下载,由于Ubuntu是国外技术人员开发的,所以apt和apt-get这两个指令对接的就是国外地址,没翻墙下载速度很慢。笔者猜一下:其实换源就是改一下apt和apt-get指令的配置文件。

# 二、换源步骤

1、先把原先的源备份一下,以防止新增的源出错

# 版本 24.x 以下
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# 版本 24.x 以上
sudo cp /etc/apt/sources.list.d/ubuntu.sources  /etc/apt/sources.list.d/ubuntu.sources.bak
1
2
3
4

2、打开sources.list文件

# 版本 24.x 以下
sudo vim /etc/apt/sources.list
# 版本 24.x 以上
sudo gedit /etc/apt/sources.list.d/ubuntu.sources
1
2
3
4

3、把文件内容清空,然后把下面的内容复制进去(以 24.04 LTS 版本为例)

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14

4、保存退出,然后更新一下

# Ubuntu 16.04 以上
sudo apt-get update
# Ubuntu 16.04 以下
sudo apt update
1
2
3
4

4、保存退出

# 三、参考链接

Ubuntu 镜像其他版本:https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b114wfUEJ (opens new window)

# 四、其他

阿里云:https://developer.aliyun.com/mirror (opens new window)

中国科技大学源:https://mirrors.ustc.edu.cn/ubuntu/ (opens new window)

网易云:https://mirrors.163.com

#Linux#Ubuntu
上次更新: 2024/05/29, 17:27:32
Ubuntu20.x使用root账户远程登录ssh处理方法
linux 下 CentOS7 安装 LibreOffice 详细过程

← Ubuntu20.x使用root账户远程登录ssh处理方法 linux 下 CentOS7 安装 LibreOffice 详细过程→

最近更新
01
Gitea数据备份与还原
03-10
02
Linux 中使用 rsync 同步文件目录教程
03-10
03
Linux 使用 rsync 互相传输同步文件的简单步骤
03-08
更多文章>
Theme by Vdoing | Copyright © 2019-2025 NoteZ,All rights reserved | 冀ICP备2021027292号-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式