在 Ubuntu 中执行命令时
sudo apt update
弹出以下错误:
Hit:1 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease
Hit:2 http://dl.google.com/linux/chrome/deb stable InRelease
Err:3 https://artifacts.elastic.co/packages/6.x/apt stable InRelease
403 Forbidden [IP: 34.120.127.130 443]
Hit:4 http://repo.yandex.ru/yandex-browser/deb beta InRelease
Hit:5 http://ppa.launchpad.net/fish-shell/release-3/ubuntu focal InRelease
Hit:6 https://packages.riot.im/debian default InRelease
Hit:7 https://download.mono-project.com/repo/ubuntu stable-bionic InRelease
Err:8 https://artifacts.elastic.co/packages/7.x/apt stable InRelease
403 Forbidden [IP: 34.120.127.130 443]
Hit:9 http://ppa.launchpad.net/linuxgndu/sqlitebrowser/ubuntu focal InRelease
Hit:10 http://us.archive.ubuntu.com/ubuntu focal InRelease
Get:12 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:11 https://download.mono-project.com/repo/debian wheezy InRelease
Get:13 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1 706 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [627 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [319 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [14,8 kB]
Get:19 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [915 kB]
Get:20 http://us.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [676 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages [1 379 kB]
Get:22 http://us.archive.ubuntu.com/ubuntu focal-security/main i386 Packages [414 kB]
Get:23 http://us.archive.ubuntu.com/ubuntu focal-security/main Translation-en [238 kB]
Get:24 http://us.archive.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [856 kB]
Get:25 http://us.archive.ubuntu.com/ubuntu focal-security/restricted Translation-en [122 kB]
Reading package lists... Done
E: Failed to fetch https://artifacts.elastic.co/packages/6.x/apt/dists/stable/InRelease 403 Forbidden [IP: 34.120.127.130 443]
E: The repository 'https://artifacts.elastic.co/packages/6.x/apt stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch https://artifacts.elastic.co/packages/7.x/apt/dists/stable/InRelease 403 Forbidden [IP: 34.120.127.130 443]
E: The repository 'https://artifacts.elastic.co/packages/7.x/apt stable InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
我无法弄清楚问题是什么以及如何解决它
该地址
artifacts.elastic.co
禁止连接到它,包管理器看到这一点,并且由于一个错误,停止更新其他所有内容。解决方案#1。写信给本网站的支持,并说明问题。也许他们不知道他们的目录正在返回 403 错误。
解决方案#2。删除地址,以便 apt 将停止尝试从那里获取任何内容。
手动选项:浏览文件
/etc/apt/sources.list.d/
并删除/注释掉与站点相关的所有内容。自动选项:
sudo sed -i 's|^deb|# deb|' /etc/apt/sources.list.d/elastic*
。做同样的事情,但更快。