1. 安装 https 相关软件包:

    apt install apt-transport-https ca-certificates -y
    
    # 手动修改 nano crt+x 按回车退出
    mv /etc/apt/sources.list /etc/apt/sources.list.bk
    nano /etc/apt/sources.list
    
  2. 修改基础系统(Debian)的源文件,可以使用如下命令:

    Source.list 添加一下内容(Debian 12)

    # 科大镜像源
    deb <https://mirrors.ustc.edu.cn/debian/> bookworm main contrib non-free non-free-firmware
    # deb-src <https://mirrors.ustc.edu.cn/debian/> bookworm main contrib non-free non-free-firmware
    
    deb <https://mirrors.ustc.edu.cn/debian/> bookworm-updates main contrib non-free non-free-firmware
    # deb-src <https://mirrors.ustc.edu.cn/debian/> bookworm-updates main contrib non-free non-free-firmware
    
    deb <https://mirrors.ustc.edu.cn/debian/> bookworm-backports main contrib non-free non-free-firmware
    # deb-src <https://mirrors.ustc.edu.cn/debian/> bookworm-backports main contrib non-free non-free-firmware
    
    # 科大镜像安全源
    deb <https://mirrors.ustc.edu.cn/debian-security/> bookworm-security main contrib non-free non-free-firmware
    # deb-src <https://mirrors.ustc.edu.cn/debian-security/> bookworm-security main contrib non-free non-free-firmware
    
    # 官方安全更新源
    deb <https://security.debian.org/debian-security> bookworm-security main contrib non-free non-free-firmware
    # deb-src <https://security.debian.org/debian-security> bullseye-security main contrib non-free
    

    Debian 11

    deb <https://mirrors.ustc.edu.cn/debian/> bookworm main contrib non-free non-free-firmware
    # deb-src <https://mirrors.ustc.edu.cn/debian/> bookworm main contrib non-free non-free-firmware
    
    deb <https://mirrors.ustc.edu.cn/debian/> bookworm-updates main contrib non-free non-free-firmware
    # deb-src <https://mirrors.ustc.edu.cn/debian/> bookworm-updates main contrib non-free non-free-firmware
    
    deb <https://mirrors.ustc.edu.cn/debian/> bookworm-backports main contrib non-free non-free-firmware
    # deb-src <https://mirrors.ustc.edu.cn/debian/> bookworm-backports main contrib non-free non-free-firmware
    
    deb <https://mirrors.ustc.edu.cn/debian-security/> bookworm-security main contrib non-free non-free-firmware
    # deb-src <https://mirrors.ustc.edu.cn/debian-security/> bookworm-security main contrib non-free non-free-firmware
    
  3. 修改 ceph 源

    # Cept 源
    cp /etc/apt/sources.list.d/ceph.list /etc/apt/sources.list.d/ceph.list.bak
    echo "deb <https://mirrors.ustc.edu.cn/proxmox/debian/ceph-quincy> bullseye main" > /etc/apt/sources.list.d/ceph.list
    
  4. 更新 APT 索引

    更改完 sources.list 文件后请运行 apt update 更新索引以生效。

  5. 更新软件

    apt update && apt upgrade -y