You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Launchpad中设置PPA自动重定向至新包名?

Elegant PPA Package Name Migration: Redirecting bookworm to com.github.babluboy.bookworm

The cleanest way to handle this package name transition on Launchpad is to leverage Debian's package dependency system—specifically the Provides, Conflicts, and Replaces fields. This will make APT automatically redirect users who run the old install command to the new package, eliminating the need for manual user intervention or in-app prompts. Here's how to implement it:

Step 1: Update the new package's control file

Edit the debian/control file of your new com.github.babluboy.bookworm package to include these lines in the package definition section:

Provides: bookworm
Conflicts: bookworm
Replaces: bookworm

Let's break down what each field does:

  • Provides: bookworm: Tells the package manager that this new package fulfills the functionality of the old bookworm package.
  • Conflicts: bookworm: Ensures the old and new packages can't be installed at the same time, preventing conflicts.
  • Replaces: bookworm: Allows the new package to overwrite any files or configurations from the old bookworm package, ensuring a smooth transition.

Step 2: Deprecate the old package

On Launchpad, you can mark the original bookworm package as obsolete:

  • Navigate to your PPA's package page for bookworm.
  • Under the "Status" dropdown, select "Obsolete" and save the change.
    This signals to APT that the old package is no longer supported, and combined with the fields above, it will prioritize the new package when users try to install the old name.

Step 3: Verify the behavior

Once you've pushed the updated new package to your PPA, test the old install command:

sudo apt-get install bookworm

APT should now prompt you to install com.github.babluboy.bookworm instead, explaining that it provides the bookworm package and replaces the old version. Users won't accidentally install the outdated package anymore.

Why this is better than your temporary in-app prompt

  • Root-level fix: Users don't need to open the app to see the prompt—this handles the transition at the package manager level, which is where they're initiating the install.
  • No broken installs: Anyone following old tutorials will get the current supported package automatically, without confusion.
  • Preserves dependencies: If any other tools or scripts depend on the bookworm package name, the Provides field keeps those dependencies satisfied.

Just make sure your new package has a higher version number than the old bookworm package (which it should, since it's an updated release) to ensure APT picks it as the replacement.

内容的提问来源于stack exchange,提问作者Siddhartha Das

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:42:39