找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: golang Linux PHP
查看: 508|回复: 0

Ubuntu24.04换源方法(新版源更换方式)

[复制链接]

78

主题

31

回帖

751

积分

管理员

积分
751
发表于 2024-6-2 21:03:18 | 显示全部楼层 |阅读模式

103827fwzbfwhw2w5kk72h.png
一、源文件位置
Ubuntu24.04的源地址配置文件发生改变,不再使用以前的sources.list文件,升级24.04之后,而是使用如下文件
  1. /etc/apt/sources.list.d/ubuntu.sources
复制代码
二、开始换源
1. 备份源配置文件
  1. sudo cp /etc/apt/sources.list.d/ubuntu.sources  /etc/apt/sources.list.d/ubuntu.sources.bak
复制代码
2. 编辑源配置文件
  1. sudo vim /etc/apt/sources.list.d/ubuntu.sources
复制代码
通常刚安装的ubuntu22.04系统默认的源配置文件内容如下所示:
  1. Types: deb
  2. URIs: http://archive.ubuntu.com/ubuntu/
  3. Suites: noble noble-updates noble-backports
  4. Components: main restricted universe multiverse
  5. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

  6. Types: deb
  7. URIs: http://security.ubuntu.com/ubuntu/
  8. Suites: noble-security
  9. Components: main restricted universe multiverse
  10. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
复制代码
3. 修改为清华源配置(原Ubuntu源注释掉或者删除掉)
  1. Types: deb
  2. URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
  3. Suites: noble noble-updates noble-security
  4. Components: main restricted universe multiverse
  5. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
复制代码
4. 更新
  1. sudo apt-get update
  2. sudo apt-get upgrade
复制代码
三、其它源
中科大源
  1. Types: deb
  2. URIs: http://mirrors.ustc.edu.cn/ubuntu/
  3. Suites: noble noble-updates noble-security
  4. Components: main restricted universe multiverse
  5. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

  6. Types: deb
  7. URIs: http://mirrors.ustc.edu.cn/ubuntu/
  8. Suites: noble-security
  9. Components: main restricted universe multiverse
  10. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
复制代码
阿里源
  1. Types: deb
  2. URIs: http://mirrors.aliyun.com/ubuntu/
  3. Suites: noble noble-updates noble-security
  4. Components: main restricted universe multiverse
  5. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

  6. Types: deb
  7. URIs: http://mirrors.aliyun.com/ubuntu/
  8. Suites: noble-security
  9. Components: main restricted universe multiverse
  10. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
复制代码
网易源
  1. Types: deb
  2. URIs: http://mirrors.163.com/ubuntu/
  3. Suites: noble noble-updates noble-security
  4. Components: main restricted universe multiverse
  5. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

  6. Types: deb
  7. URIs: http://mirrors.163.com/ubuntu/
  8. Suites: noble-security
  9. Components: main restricted universe multiverse
  10. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
复制代码

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表