How `DistUpgrade` decides that a package is "foreign" (`go-mtpfs`)

Ubuntu Version

Ubuntu 24.04 LTS

Desktop Environment (if applicable)

GNOME

Problem Description

Testing upgrade to 26.04 - it claims the go-mtpfs is unofficial. Which is obviously wrong. On 24.04:

$ apt policy go-mtpfs
go-mtpfs:
  Installed: (none)
  Candidate: 1.0.0+git20200111.42254b1-1ubuntu0.24.04.3
  Version table:
     1.0.0+git20200111.42254b1-1ubuntu0.24.04.3 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages
     1.0.0+git20200111.42254b1-1build2 500
        500 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages
$ 

On the system in question while do-release-upgrade is waiting:

bor@noble:~$ apt-cache policy go-mtpfs
go-mtpfs:
  Installed: 1.0.0+git20200111.42254b1-1ubuntu0.24.04.3
  Candidate: 1.0.0+git20200111.42254b1-1ubuntu0.24.04.3
  Version table:
 *** 1.0.0+git20200111.42254b1-1ubuntu0.24.04.3 100
        100 /var/lib/dpkg/status
     1.0.0+git20200111.42254b1-1build3 500
        500 http://ru.archive.ubuntu.com/ubuntu resolute/universe amd64 Packages
bor@noble:~$ 

There is really nothing useful in logs, main.log just says the same:

2026-10-04 16:17:28,239 DEBUG Foreign (before rewriting sources): 
2026-10-04 16:17:28,240 DEBUG Foreign (after rewriting sources): go-mtpfs

One million question - why Ubuntu package is claimed to be foreign?

My best guess is - because 26.04 version is lower than 24.04 version, this package is not scheduled to be updated and its final version does not match the expected one for 26.04, so DistUpgrade believes it is due to the package coming from outside of Ubuntu. Is my guess correct?

Screenshots

Very well spotted, this is a packaging error:

$ dpkg --compare-versions "1.0.0+git20200111.42254b1-1ubuntu0.24.04.3" lt "1.0.0+git20200111.42254b1-1build3" && echo "True" || echo "False"
False
$

dpkg can not go backwards and is completely bound to the version string for deciding if it should move on, the resolute package needs a higher version one way or the other to not make the upgrade fail.

To overcome the blocker I’d just uninstall go-mtpfs and re-install it after the upgrade … and indeed report a bug …

4 Likes