解决Ubuntu报错: 在源列表 /etc/apt/sources.list 中第 14 行有误 (类型)

遇到问题:在修改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

就解决了! 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值