更新Ubuntu为国内源

更新Ubuntu为国内源

  1. 查看源文件
    cat /etc/apt/sources.list.d/ubuntu.sources

  2. 备份源文件
    cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sourcesbak

  3. 打开清华源镜像站
    https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

  4. 找到ubuntu软件仓库
    找到对应版本的源,这里以 Ubuntu 24.04 为例
    DEB822 格式 Ubuntu 版本选择 Ubuntu 24.04 TLS(noble)
    复制下面源内容到以下文件中
    /etc/apt/sources.list.d/ubuntu.sources
    image

  5. 更新ubuntu系统
    sudo apt update && sudo apt upgrade -y

  6. 移除无用软件
    sudo apt autoremove

  7. 安装软件
    apt install -y tree

posted @ 2025-07-23 07:22  HaimaBlog  阅读(888)  评论(0)    收藏  举报