使用'sudo apt update'时出现404错误和"存储库没有发布文件"的问题。

运行命令sudo apt update时,我遇到了以下问题,让我很困扰:
$ sudo apt update

Hit:1 http://repo.mysql.com/apt/ubuntu eoan InRelease    
Hit:2 https://deb.debian.org/debian buster InRelease               
Ign:3 http://ppa.launchpad.net/morphis/anbox-support/ubuntu hirsute InRelease
Hit:4 https://deb.debian.org/debian-security buster/updates InRelease
Hit:5 https://download.sublimetext.com apt/stable/ InRelease       
Ign:6 https://storage.googleapis.com/cros-packages/88 buster InRelease
Err:7 http://ppa.launchpad.net/morphis/anbox-support/ubuntu hirsute Release
  404  Not Found [IP: 91.189.95.85 80]
Hit:8 https://storage.googleapis.com/cros-packages/88 buster Release
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/morphis/anbox-support/ubuntu hirsute Release' does not have a Release file.
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.

尝试使用sudo apt autoremove时,我得到了以下结果:
$ sudo apt autoremove
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

我同意HappyTux关于资源列表的观点。至于dpkg锁定问题,你能否更新你的问题,包括ps aux | grep -i apt的输出?解决方案可能只需几个点击。 - user1091774
1你好像没有使用Ubuntu? - KGIII
操作系统是什么?Hirsuite目前处于测试阶段(所以我们在这里不完全支持它)。混合使用来自不同发行版甚至版本的软件源会导致此类问题。我建议您[编辑]并发布您的/etc/apt/sources.list文件的内容以及lsb_release -a命令的输出。 - Zanna
我正在使用Chrome OS。如果我没记错的话,它只能在一个窗口中运行Ubuntu。 - Saulo Felipe
对我来说,我遇到这个错误是因为我当时使用的是不支持的Ubuntu版本。Ubuntu 22可以工作,但Ubuntu 23无法工作。 - undefined
1个回答

你需要编辑你的/etc/apt/sources.list文件,并删除其中所有无用的软件源。你的文件中包含了两个不兼容的Ubuntu版本、与这两个版本都不兼容的Debian buster以及第三方软件源,我不确定它们是否兼容,也不打算去检查。这个文件一团糟,永远无法产生一个稳定的系统。第三方软件源可能位于你的/etc/apt/sources.d/目录下,那是它们安装时的位置。在这些文件中,通过在没有注释的行开头加上#符号或完全删除文件来注释掉这些行,然后运行apt update命令重新读取并更新软件包缓存。

打开 sources.list 文件时,我只看到以下内容: deb https://deb.debian.org/debian buster main deb https://deb.debian.org/debian-security buster/updates main - Saulo Felipe
然后它们位于您的/etc/apt/sources.d/目录中,这是第三方安装源的位置。通过在那些文件中的行开头加上#来注释掉这些行,或者完全删除该文件,然后运行apt update命令。您希望至少删除Ubuntu,因为根据回复看起来您应该运行Buster。我已经编辑了回复以反映第三方位置。 - user1179897
谢谢帮助,我成功删除了导致问题的文件,它们确实位于 /etc/apt/sources.list.d 目录下。现在一切都正常进行中。 - Saulo Felipe
很高兴看到问题已经解决了,在将来只需添加与“Buster”兼容的代码行,这样才能确保软件能够在您的系统上使用。 - user1179897
“无用的存储库”是什么意思?哪些是无用的?我们如何判断它们是否无用? - nicbou