遇到问题:在修改sources.list时候关闭时无法保存,显示过"/etc.apt/sources.list" E212: 无法打开并写入文件
原因:镜像源出问题
第一步:查看当前Ubuntu版本
lsb_release -a
会出现如下:
得知Ubuntu版本为18.04.1 LTS
第二步: 在阿里云镜像源当中找到对应版本的镜像源阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区 (aliyun.com)
例如18.04.1 LTS的镜像为:
deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
# deb https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
将原来sources.list里面的内容删除(按D),然后将这段内容复制进去,并保存退出
第三步:更新镜像源
sudo apt update
就解决了!