Ubuntu 手动替换镜像源

手动替换Ubuntu 镜像源

1.备份默认镜像源

  # 备份默认镜像源,/etc/apt/sources.list 文件
  sudo mv /etc/apt/sources.list sources.lise.bak
  1. 编写新的镜像源
  sudo vi /etc/apt/sources.list
  1. 阿里源(ubuntn 20.4)

    deb https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
    
    # deb https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    # deb-src https://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
    
    deb https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    deb-src https://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
    
    
  2. 阿里源(ubuntu 22.4)

    将20.4 的focal 换成 jammy 即可

  3. 执行更新

    sudo apt-get update
    sudo apt-get upgrade
    

猜你喜欢

转载自blog.csdn.net/Hong_pro/article/details/129708048