解决ubuntu18.04系统更新的问题

作者:朱金灿

来源:clever101的专栏

ubuntu18.04已经不受官方支持了,如果要进行更新,会出现以下错误:

bash 复制代码
E: 仓库 "http://mirrors.aliyun.com/ubuntu bionic Release" 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 "http://cn.archive.ubuntu.com/ubuntu bionic-backports Release" 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 "http://mirrors.aliyun.com/ubuntu bionic-updates Release" 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 "http://mirrors.aliyun.com/ubuntu bionic-security Release" 没有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
E: 仓库 "http://security.ubuntu.com/ubuntu bionic-security Release" 不再含有 Release 文件。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。

因此要解决这个问题,需要更换系统更新镜像网站。具体是将 Ubuntu 系统的 /etc/apt/sources.list 文件中的国外更新镜像网站改为国内镜像网站。

在修改之前,建议先备份原始文件,以防出现问题:

bash 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

使用文本编辑器(如gedit、 nano 或 vim)打开 /etc/apt/sources.list 文件:

bash 复制代码
sudo gedit /etc/apt/sources.list

将文件中的默认镜像地址替换为国内镜像地址。注意不要用阿里云镜像源,已经测试过了不行,使用清华大学镜像源,具体是把以下内容

bash 复制代码
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse

全部覆盖原来的/etc/apt/sources.list 文件的内容。

相关推荐
黑风风2 小时前
探索 Ubuntu 中的 Hostname 配置与管理
数据库·ubuntu·php
llkk星期五2 小时前
ubuntu 22.04附加驱动安装NVIDIA显卡驱动重启后无WiFi蓝牙等问题
linux·ubuntu
CVer儿2 小时前
ubuntu挂载固态硬盘
linux·运维·ubuntu
music&movie2 小时前
Win11安装VMware和Ubuntu并使用ssh访问部署模型
linux·ubuntu·ssh
程序员JerrySUN2 小时前
在 Ubuntu 20.04 上交叉编译 Qt 5 应用,使其可在 Windows 运行
windows·qt·ubuntu
闫利朋2 小时前
Ubuntu 22.04安装NVIDIA A30显卡驱动
ubuntu·a 30
秋知叶i2 小时前
【ubuntu20】--- 搭建 gerrit 最新最详细
ubuntu·gerrit
J.Pei2 小时前
Linux(ubuntu)环境下部署The Fuck项目的方法(保姆级教程)
linux·ubuntu
__echooo4 小时前
【大模型】Llama 3.2 大语言模型初探:模型权重下载
人工智能·算法·ubuntu·语言模型·自动驾驶·llama
爱喝矿泉水的猛男8 小时前
Windows 11 + Ubuntu 22.04双系统时间同步失败处理
linux·运维·ubuntu·双系统时间不同