此问题一般可通过修改apt 安装源列表解决。下面以Ubuntu 18.0.4版本为例,Ubuntu不用版本源地址不同,具体地址区别参考:https://wiki.ubuntu.org.cn/源列表
问题解决步骤如下:
1.备份源列表文件
mv /etc/apt/sources.list /etc/apt/sources-backup.list
2.新建源列表文件,添加源地址
vim /etc/apt/sources.list
将一下内容复制到文件中(此处采用网易镜像源,也可使用阿里,中科大等公司高校镜像源):
deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
tips:笔者最开始使用阿里镜像出现问题,后改为网易镜像
3.执行更新命令
apt update
apt upgrade
有问题评论区留言!