RPi-Distro / repo

Issue tracking for the archive.raspberrypi.org repo
37 stars 1 forks source link

RPi repo + buster-backports cause cmake upgrade/downgrade loop #245

Closed MichaIng closed 2 years ago

MichaIng commented 3 years ago

With #238 the cmake package from Debian Buster backports have been added to the RPi APT repository, which makes perfectly sense to provide the implied benefits to Raspbian users.

On Debian repo images, like Raspberry Pi OS 64-bit or when installing Debian + the RPi repo on an RPi with buster-backports enabled, this however causes a strange error. It looks like a bug in APT itself, but it should be easy and fast to prevent it by changing the RPi repo.

Replicate

  1. Apply these APT sources:
    deb https://deb.debian.org/debian/ buster main
    deb https://deb.debian.org/debian/ buster-updates main
    deb https://deb.debian.org/debian-security/ buster/updates main
    deb https://deb.debian.org/debian/ buster-backports main
    deb https://archive.raspberrypi.org/debian/ buster main
  2. apt update
  3. apt install cmake: This will pull cmake + cmake-data from the RPi repo.
  4. apt upgrade: This will now offer to upgrade those two packages when confirming a downgrade 🤔. When confirming, the two packages are again pulled from the RPi repo.
  5. apt upgrade: Since above the same packages have been reinstalled, the upgrade/downgrade is again offered.
  6. Comment/remove the buster-backports repo (or the RPi repo) to solve the issue.

This breaks automated apt-get upgrade calls without --allow-downgrade.

It's strange as the version strings from both repos is exactly the same, so APT should not see an upgrade at all. And if it sees one as upgrade, why does it sees it as downgrade in the same turn, that requires a confirmation? Confusing.

Workaround

Appending a suffix like -rpi (or similar, like done in a few other RPi/RPi desktop specific packages) should solve the issue as then the package from the RPi repo should be undoubtedly seen as the newer version, so that it is installed and then no upgrade is offered anymore.

MichaIng commented 2 years ago

The issue shouldn't be present anymore since Debian backports ships cmake v3.18.4 now. I'll leave the issue open just in case a general solution via version suffix or so, to prevent such upgrade looks in the future, wants to be found.

MichaIng commented 2 years ago

I'll mark this as closed. With an RPi OS Bullseye release and the actual issue solved with newer cmake package versions, this lost its importance.