抑制 apt-get 更新错误

抑制 apt-get 更新错误

运行 Ubuntu Server 18.04 LTS,我正在尝试安装我目前正在进行的项目。问题是设置需要几个命令,因此我创建了一个 .sh 文件,以便其他人更轻松地设置项目。但我在添加新 URL 来安装软件包时遇到了问题。要启动脚本,我运行

blueprint@ubuntu:~$ bash install-project.sh

在该文件的稍下方,有以下行:

sudo add-apt-repository ppa:builds/sphinxsearch-stable

看起来运行正常,我没看到任何错误消息。但下一行:

sudo apt-get update

出现以下错误:

Hit:1 http://se.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://se.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://se.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:4 http://se.archive.ubuntu.com/ubuntu bionic-security InRelease
Ign:5 http://ppa.launchpad.net/builds/sphinxsearch-stable/ubuntu bionic InRelease
Err:6 http://ppa.launchpad.net/builds/sphinxsearch-stable/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.83 80]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/builds/sphinxsearch-stable/ubuntu bionic 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-get install ...在任何 sphinxsearch 包上运行时,它们似乎都会安装,所以这不是我的问题。

但是它会阻止 bash 文件继续运行(之后还会运行几个命令),这真的很烦人。到目前为止,我想到的唯一解决方案是创建两个不同的 .sh 文件,一个用于错误之前,一个用于错误之后。但这似乎是一种愚蠢而繁琐的方法。

有人知道是否有任何方法可以抑制错误,apt-get update以便 bask 文件不会停止吗?或者是否有任何方法可以让 bash 文件不会因错误而停止?

答案1

这是强加给你的不明智的政策决定。抱歉。

该特定的 PPA 与 Ubuntu 12.04 兼容,并且八年来没有更新。

建议:使用 Web 浏览器从 PPA 中自行提取软件包(它的这里)。将 PPA 添加为源是有目的的,因为它永远不会升级。

然后使用您的桌面安装它sudo apt install /path/to/deb_file.deb

并让您的项目知道,基于该软件包进行构建而不是采用更新的东西似乎有点走不通。

相关内容