发布于 2年前

把Ubuntu18的apt源更改为阿里云镜像

在正式更改前,建议先备份原文件

<pre data-language-edit="Bash" spellcheck="false">```bash
sudo <span class="hljs">mv</span> /etc/apt/sources.list /etc/apt/sources.list.bak

进入apt源配置目录,添加aliyun.list

sudo vim aliyun.list


在aliyun.list添加以下内容:

<pre data-language-edit="Plain text" spellcheck="false">```plaintext 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-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed 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

最后更新软件包

<pre data-language-edit="Bash" spellcheck="false">```bash
sudo apt-get update
sudo apt upgrade


对apt源的更改,需要有root权限。
©2020 edoou.com   京ICP备16001874号-3