file conflict when installing libsgutils-2-1.46-2 when upgrading from lunar to mantic

Bug #2039279 reported by Thomas Debesse
50
This bug affects 8 people
Affects Status Importance Assigned to Milestone
sg3-utils (Ubuntu)
Status tracked in Noble
Mantic
In Progress
Undecided
Andreas Hasenack
Noble
Fix Released
Undecided
Andreas Hasenack

Bug Description

[ Impact ]

A release upgrade from lunar to mantic, or jammy to mantic when lunar goes EOL, will encounter a file conflict in the libgsutils2 library.

This is what the library package is named, and the library it ships, in each relevant ubuntu release:

Jammy: 1.46-1build1
package: libsgutils2-2
ships: libsgutils2-1.46.so.2 and libsgutils2-1.46.so.2.0.0

Lunar: 1.46-1ubuntu0.23.04.1
package: libsgutils2-2
ships: libsgutils2-1.46.so.2 and libsgutils2-1.46.so.2.0.0

Mantic and Noble: 1.46-3ubuntu2
package: libsgutils2-1.46-2
ships: libsgutils2-1.46.so.2 and libsgutils2-1.46.so.2.0.0

The problem is that in the jammy and lunar versions the file that libgsutils2-2 ships conflicts with mantic, where the package was renamed to libgsutils2-1.46-2.

This update corrects the version of the existing breaks/replaces in the mantic package to avoid this conflict.

Note that, if the upgrade is done with do-release-upgrade, the conflict does not cause an abort, because dpkg is called with --force (see comment #3 down below).

[ Test Plan ]

Perform a release upgrade from lunar to mantic, with mantic-proposed enabled (I'm not yet sure how to have mantic-proposed enabled for do-release-upgrade: I'll come back to this once the package is in proposed). Check the upgrade logs in /var/log/dist-upgrade/apt-term.log and look for the part where libsgutils2 is being unpacked.

For example, this shows the problem:
Preparing to unpack .../125-libsgutils2-1.46-2_1.46-3ubuntu2_amd64.deb ...^M
Unpacking libsgutils2-1.46-2:amd64 (1.46-3ubuntu2) ...^M
dpkg: warning: overriding problem because --force enabled:^M
dpkg: warning: trying to overwrite '/usr/lib/x86_64-linux-gnu/libsgutils2-1.46.so.2.0.0', which is also in package libsgutils2-2:amd64 1.46-1ubuntu0.23.04.1^M
dpkg: warning: overriding problem because --force enabled:^M
dpkg: warning: trying to overwrite '/usr/lib/x86_64-linux-gnu/libsgutils2-1.46.so.2', which is also in package libsgutils2-2:amd64 1.46-1ubuntu0.23.04.1^M

This grep command can also be used:
$ grep "trying to overwrite" /var/log/dist-upgrade/apt-term.log
dpkg: warning: trying to overwrite '/usr/lib/x86_64-linux-gnu/libsgutils2-1.46.so.2.0.0', which is also in package libsgutils2-2:amd64 1.46-1ubuntu0.23.04.1
dpkg: warning: trying to overwrite '/usr/lib/x86_64-linux-gnu/libsgutils2-1.46.so.2', which is also in package libsgutils2-2:amd64 1.46-1ubuntu0.23.04.1

With the fixed version, there will be no such dpkg warning when unpacking libsgutils2 (example with a PPA, since the package is not yet in proposed, but the file to check, and grep command, are the same):

$ grep "trying to overwrite" /var/log/dist-upgrade/apt-term.log
$ # empty result, no hits

Locating the unpacking section in that log, we see that the conflicting package is removed before (took the example from a ppa build):

Removing libsgutils2-2:amd64 (1.46-1ubuntu0.23.04.1) ...^M
Selecting previously unselected package libsgutils2-1.46-2:amd64.^M
(Reading database ... ^M(Reading database ... 5%^M(Reading database ... 10%^M(Reading database ... 15%^M(Reading database ... 20%^M(Reading database ... 25%^M(Reading databas
Preparing to unpack .../libsgutils2-1.46-2_1.46-3ubuntu2.1~ppa3_amd64.deb ...^M
Unpacking libsgutils2-1.46-2:amd64 (1.46-3ubuntu2.1~ppa3) ...^M

[ Where problems could occur ]
Should this package ever get a version bump in an SRU, then the breaks/replaces version might need a bump, which can easily be forgotten. Something similar happened to a samba security update[1] a while ago. Looking at the history of sg3-utils in SRUs, however, shows that such a bump was never done, so it's unlikely. But if it happens, then this bug will resurface.

1. https://bugs.launchpad.net/bugs/2024663

[ Other Info ]

N/A

[Original Description]

While upgrading from lunar to mantic dpkg aborted with this error:

```
Preparing to unpack .../libsgutils2-1.46-2_1.46-3ubuntu2_amd64.deb ...
Unpacking libsgutils2-1.46-2:amd64 (1.46-3ubuntu2) ...
dpkg: error processing archive /var/cache/apt/archives/libsgutils2-1.46-2_1.46-3ubuntu2_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libsgutils2-1.46.so.2.0.0', which is also in package libsgutils2-2:amd64 1.46-1ubuntu0.22.04.1
```

ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: libsgutils2-2 1.46-1ubuntu0.22.04.1
ProcVersionSignature: Ubuntu 6.2.0-33.33-generic 6.2.16
Uname: Linux 6.2.0-33-generic x86_64
NonfreeKernelModules: vboxnetadp vboxnetflt vboxdrv amddrm_ttm_helper amdttm amdxcp amddrm_buddy amd_sched amdkcl
ApportVersion: 2.27.0-0ubuntu5
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: GNOME
Date: Fri Oct 13 15:29:48 2023
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: sg3-utils
UpgradeStatus: No upgrade log present (probably fresh install)
modified.conffile..etc.default.apport: [modified]
mtime.conffile..etc.default.apport: 2018-06-16T17:39:00.798346

Related branches

Revision history for this message
Thomas Debesse (illwieckz) wrote :
Revision history for this message
Thomas Debesse (illwieckz) wrote :

I was able to remove the old package and continue the installation this way:

```
dpkg -r libsgutils2-2
apt-get --fix-broken install
apt-get dist-upgrade
```

Robie Basak (racb)
tags: added: server-todo
Changed in sg3-utils (Ubuntu):
assignee: nobody → Andreas Hasenack (ahasenack)
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This is another case that if the upgrade is done with do-release-upgrade(8), the file conflict is overridden and not noticeable:

Unpacking libsgutils2-1.46-2:amd64 (1.46-3ubuntu2) ...
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: trying to overwrite '/usr/lib/x86_64-linux-gnu/libsgutils2-1.46.so.2.0.0', which is also in package libsgutils2-2:amd64 1.46-1ubuntu0.23.04.1
dpkg: warning: overriding problem because --force enabled:
dpkg: warning: trying to overwrite '/usr/lib/x86_64-linux-gnu/libsgutils2-1.46.so.2', which is also in package libsgutils2-2:amd64 1.46-1ubuntu0.23.04.1

Just to confirm, Thomas, did you use "apt-get dist-upgrade" for this upgrade from lunar to mantic?

Changed in sg3-utils (Ubuntu):
status: New → Confirmed
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

I think this has been caused by https://salsa.debian.org/linux-blocks-team/sg3-utils/-/commit/0d53f3311b6657040b23f851a47c429c49cae0e9. It should be a matter of adjusting Conflicts/Replaces accordingly for Ubuntu.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

These are the affected ubuntu releases with conflicting files:

Jammy: 1.46-1build1
package: libsgutils2-2
ships: libsgutils2-1.46.so.2 and libsgutils2-1.46.so.2.0.0

Lunar: 1.46-1ubuntu0.23.04.1
package: libsgutils2-2
ships: libsgutils2-1.46.so.2 and libsgutils2-1.46.so.2.0.0

Mantic: 1.46-3ubuntu2
package: libsgutils2-1.46-2
ships: libsgutils2-1.46.so.2 and libsgutils2-1.46.so.2.0.0

Upgrades from jammy to mantic will also see this bug, when lunar goes EOL.

This seems to be one of the unsolved cases in the debian package transitioning guide[1]. We need a breaks/replaces for all versions in jammy and lunar, including updates that are yet to become available. In summary, anything 1.46-1*.

If we do:
Breaks: libsgutils2-2 (<< 1.46-3ubuntu2)
Replaces: libsgutils2-2 (<< 1.46-3ubuntu2)

This will include versions like focal's 1.44-1ubuntu2, which isn't affected (the library file there was still called libsgutils2.so.2, so no file conflict). That being said, we don't expect someone from focal to upgrade to mantic without going through jammy first, at least. And once in jammy, the version in B/R from mantic is correctly targeting the jammy version.

I'll give this a try and run some tests.

1. https://wiki.debian.org/PackageTransition

Revision history for this message
Mike Ferreira (mafoelffen) wrote (last edit ):

nevermind <editted>

Revision history for this message
Andreas Hasenack (ahasenack) wrote (last edit ):
Changed in sg3-utils (Ubuntu):
status: Confirmed → In Progress
description: updated
description: updated
Changed in sg3-utils (Ubuntu Mantic):
status: New → In Progress
assignee: nobody → Andreas Hasenack (ahasenack)
Revision history for this message
Gordon Lack (gordon-lack) wrote (last edit ):

I have just done lunar to mantic updates using "do-release-upgrade -d -m desktop" and *DID* have this problem as it prevented sg3-utils being updated.
(Although after the first one a delete-before and reinstall-after was a simple workaround).

Revision history for this message
HasanZaki (hasanzaki) wrote :

maually intall it fix the problem

"apt install libsgutils2-1.46-2"

description: updated
description: updated
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Uploaded to mantic unapproved, and noble.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sg3-utils - 1.46-3ubuntu3

---------------
sg3-utils (1.46-3ubuntu3) noble; urgency=medium

  * d/control: fix version in libsgutils2-1.46-2 breaks/replaces to
    avoid file conflict when ugprading from jammy and lunar
    (LP: #2039279)

 -- Andreas Hasenack <email address hidden> Wed, 25 Oct 2023 09:49:58 -0300

Changed in sg3-utils (Ubuntu Noble):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.