1. 检查Ubuntu系统的Codename

    $ lsb_release -a

    得到结果:

    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 18.04.2 LTS
    Release: 18.04
    Codename: bionic

    访问http://mirrors.aliyun.com/ubuntu/dists/查看阿里源是否支持

  2. 修改sources.list

    $ sudo vi /etc/apt/sources.list

    删除sources.list中原有的内容,更换为阿里源

    deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

    注意此处每一行的bionic都需要与系统的Codename相对应,因此不同系统版本间的sources.list文件不能通用

  3. 更新yuan

    $ sudo apt-get update
  4. 更新软件

    $ sudo apt-get upgrade
05-11 11:17