ubuntu24.04添加apt源的方法和文件位置相对于以前的版本有变化,从原来的/etc/apt/sources.list文件更换到/etc/apt/sources.list.d/ubuntu.sources文件中。
我们先来看看ubuntu24.04 apt源中默认的配置。
cat /etc/apt/sources.list.d/ubuntu.sources | grep -iE -v '^($|#)'
Types: deb
URIs: http://cn.archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg我们可以看到有两组相似的deb,一般情况我们只需要修改上面那一组。
下面就是常用的国内apt源
1.清华源
Types: deb
URIs: http://mirrors.tuna.tsinghua.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg2.阿里源
Types: deb
URIs: http://mirrors.aliyun.com/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg3.网易源
Types: deb
URIs: http://mirrors.163.com/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg4.中科大源
Types: deb
URIs: http://mirrors.ustc.edu.cn/ubuntu/
Suites: noble noble-updates noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg选上述一种源替换到/etc/apt/sources.list.d/ubuntu.sources文件中上面一块即可,然后更新环境即可
apt update
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://sulao.cn/post/1081
相关阅读
- ubuntu22.04安装dcgm和基本用法
- ubuntu22.04安装cuda失败提示"Uninstall manifest corrupt"
- ubuntu使用ssh命令批量设置集群节点具有sudo权限的账户sudo免密切换
- ubuntu22.04算力环境基础配置一键验证脚本
- ubuntu22.04算力环境基础配置一键脚本
- ubuntu22.04忘记root密码进入单用户模式修改密码
- ubuntu22.04屏蔽使用apt安装软件时出现弹窗要求选择重启服务的方法
- ubuntu22.04删除系统中的新内核并回退的方法
- ubuntu22.04部署chrony时间同步服务
- ubuntu22.04部署ntp时间同步服务器
评论列表