Debian软件源配置指南
以下是Debian软件源配置指南:
备份原始文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
配置国内源(以清华源为例)
- 方法一:直接编辑
/etc/apt/sources.list
将内容替换为(根据系统版本替换sudo nano /etc/apt/sources.list
bookworm
等代号):deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
- 方法二:使用DEB822格式(推荐)
在
/etc/apt/sources.list.d/
目录下创建.sources
文件,如debian.sources
:
添加内容:sudo nano /etc/apt/sources.list.d/debian.sources
Types: deb deb-src URIs: https://mirrors.tuna.tsinghua.edu.cn/debian Suites: bookworm bookworm-updates bookworm-security Components: main contrib non-free non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
更新软件包列表
sudo apt update
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权请联系我们,一经查实立即删除!