1. 换源 (清华大学源)

    vim /etc/apt/sources.list
    
    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb <https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/> jammy main restricted universe multiverse
    # deb-src <https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/> jammy main restricted universe multiverse
    deb <https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/> jammy-updates main restricted universe multiverse
    # deb-src <https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/> jammy-updates main restricted universe multiverse
    deb <https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/> jammy-backports main restricted universe multiverse
    # deb-src <https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/> jammy-backports main restricted universe multiverse
    
    deb <http://ports.ubuntu.com/ubuntu-ports/> jammy-security main restricted universe multiverse
    # deb-src <http://ports.ubuntu.com/ubuntu-ports/> jammy-security main restricted universe multiverse
    
    # 预发布软件源,不建议启用
    # deb <https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/> jammy-proposed main restricted universe multiverse
    # # deb-src <https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/> jammy-proposed main restricted universe multiverse
    

    需要注意,树莓派是 ARM 架构的,需要使用 ubuntu-ports 镜像。

    如果在运行 apt update 后报一下错误,说明你用错成了 X86/X64 架构的镜像

    Untitled