如何删除我的 22.04 系统上配置的 16.04 存储库?

如何删除我的 22.04 系统上配置的 16.04 存储库?

当我添加sudo apt update到终端时,我收到一条警告,该警告与我的 22.04 系统上有 xenial (16.04 存储库)有关。我添加find /etc/apt -type f -exec grep xenial {} +命令,我将添加下面的输出,显示我有 xenial (16.04 存储库),要删除它,我已'/etc/apt/sources.list.d/official-source-repositories.list'使用 nano cli 编辑器和 gedit 文本编辑器打开,没有引用 xenial 的行,是否有另一种方法去掉它 ?

1. sudo apt更新警告

W: http://dl.openfoam.org/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://download.docker.com/linux/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://packages.osrfoundation.org/gazebo/ubuntu-stable/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

2.find /etc/apt -type f -exec grep xenial {} +输出

/etc/apt/sources.list.d/official-source-repositories.list.save:deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
/etc/apt/sources.list.d/official-source-repositories.list.save:deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
/etc/apt/sources.list.d/official-source-repositories.list.save:deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
/etc/apt/sources.list.d/official-source-repositories.list:deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
/etc/apt/sources.list.d/official-source-repositories.list:# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
/etc/apt/sources.list.d/official-source-repositories.list:deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted

答案1

您可以通过编辑以下内容从 22.04 系统中删除 16.04 存储库软件来源列表。首先,使用文本编辑器打开源列表:

sudo nano /etc/apt/sources.list

然后,找到包含对 16.04 存储库的引用的行,并将其删除。完成后,保存文件并退出编辑器。

删除存储库后,您应该更新软件包列表以确保系统知道更改:

sudo apt update

这将使用最新的软件包信息更新系统,删除对 16.04 存储库的任何引用。

相关内容