ubuntu 更换镜像源

ubuntu 更换镜像源

ubuntu 更换镜像源


ubuntu20.04.2


  • 备份文件

    cd /etc/apt
    sudo cp sources.list sources.list.original
    
  • 替换sources.list内容

    1. 替换为清华源

      清华源 镜像站使用帮助

      到上边的网站,根据ubuntu版本选择合适的内容替换

      # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
      deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
      
      # 预发布软件源,不建议启用
      # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
      # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
      
  • 刷新和更新

    sudo apt-get update
    sudo apt-get upgrade
    
上一篇:2021ubuntu软件源-最全(阿里,腾讯云,京东云,清华,百度,163,山大


下一篇:linux下 apt的添加下载源