ubuntu更改为阿里云镜像

ubuntu更改为阿里云镜像

更改为阿里云镜像是为减少安装软件出现问题

  • 备份文件:将原本的镜像文件保存一份,

    sudo mv  /etc/apt/sources.list  /etc/apt/sources.list.bak
    
    
  • 新建文件:

    sudo vim  /etc/apt/sources.list     
    
  • 将阿里云镜像复制到里面去

    deb http://mirrors.aliyun.com/ubuntu/ xenial main
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
    
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
    
    deb http://mirrors.aliyun.com/ubuntu/ xenial universe
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
    
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
    deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
    deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
    
  • 更新软件包的列表信息:sudo apt-get update

你可能感兴趣的:(ubuntu)