如何从特定程序的存储库/安装进行更改?

如何从特定程序的存储库/安装进行更改?

我对这两个答案都很好奇,因为简短的谷歌搜索没有显示任何结果。但我想知道你会如何处理在两个不同的存储库中安装同名程序。或者更改已安装的程序,以便它从新程序中接收更新。

具体来说,引起人们注意的是 OBS studio,因为它包含在默认的 Ubuntu 存储库中,但 obsproject 存储库具有该程序的更高版本。

答案1

每个存储库都包含一个 Release 文件,客户端在执行 apt 命令时会查找该文件。Release 文件包含有关可用 dist 和组件(例如 bionic main universe 等)的信息。它指定每个组件的位置和哈希值。获取相关 dist 后,客户端会搜索软件包列表,其中包含每个可用的 debian、其位置、全名、版本、哈希值、大小等。这就是您如何将一个存储库中的软件包与另一个存储库中的软件包区分开来的方法。

如果您想要请求特定版本或目标存储库,则在使用 apt-get 时需要使用 -t 选项。如果存储库中存在该版本,则会下载该版本。注意:选择特定存储库时,它首先必须存在于源列表中。

以下是 apt-get 手册页的引文:

-t, --target-release, --default-release
       This option controls the default input to the policy engine, it creates a default pin at priority 990 using the specified
       release string. This overrides the general settings in /etc/apt/preferences. Specifically pinned packages are not affected by
       the value of this option. In short, this option lets you have simple control over which distribution packages will be retrieved
       from. Some common examples might be -t '2.1*', -t unstable or -t sid. Configuration Item: APT::Default-Release; see also the
       apt_preferences(5) manual page.

答案2

在 Ubuntu 的典型安装中,Apt 会自动尝试安装它所知道的任何存储库中的最高版本。

如果你喜欢定制,你可以通过设置来调整适当的优先事项恰当标记, 和apt-pinning。但大多数人并不需要使用这些先进的工具。

警告:无法保证非 Ubuntu 存储库中的更高版本与您的 Ubuntu 系统兼容。有些软件兼容,有些软件不兼容。如果您的新更高版本软件导致问题,请返回到 Ubuntu 存储库中的版本。

相关内容