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

Bug #2039279 reported by Thomas Debesse
64
This bug affects 11 people
Affects Status Importance Assigned to Milestone
sg3-utils (Ubuntu)
Fix Released
Undecided
Andreas Hasenack
Mantic
Fix Released
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).

UPDATE: instructions on how to test with the package in mantic-proposed

a) create /etc/apt/sources.list.d/proposed.list with this content (yes, with "lunar-proposed"):
deb http://br.archive.ubuntu.com/ubuntu lunar-proposed main restricted universe multiverse

b) create /etc/apt/preferences.d/sg3-utils with this content:
Package: libsgutils2-1.46-2 sg3-utils sg3-utils-udev libsgutils2-dev
Pin: release a=mantic-proposed
Pin-Priority: 500

c) Run:
sudo do-release-upgrade

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
Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Thomas, or anyone else affected,

Accepted sg3-utils into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sg3-utils/1.46-3ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in sg3-utils (Ubuntu Mantic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-mantic
Revision history for this message
andy cao (c-ys268) wrote :

#2 can fix this issue,i has been tested,it works.
thanks bro.

Revision history for this message
Aleksandr (aleksbazer) wrote : Re: [Bug 2039279] Re: file conflict when installing libsgutils-2-1.46-2 when upgrading from lunar to mantic
Download full text (6.1 KiB)

Thanks brother, but I think it will be difficult for me to do this. There
is still one problem when loading it gives an error. It’s easier for me to
tear it down and reinstall it on my computer.

вт, 21 лист. 2023 р. о 17:37 andy cao <email address hidden> пише:

> #2 can fix this issue,i has been tested,it works.
> thanks bro.
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (2043489).
> https://bugs.launchpad.net/bugs/2039279
>
> Title:
> file conflict when installing libsgutils-2-1.46-2 when upgrading from
> lunar to mantic
>
> Status in sg3-utils package in Ubuntu:
> Fix Released
> Status in sg3-utils source package in Mantic:
> Fix Committed
> Status in sg3-utils source package in Noble:
> Fix Released
>
> 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:am...

Read more...

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

# Mantic verification

I performed a do-release-upgrade from lunar to mantic, with mantic-proposed enabled and accounted-for via the updated instructions in the test plan to add pinning for the sg3-utils packages from mantic-proposed.

At the end of the release upgrade, I had this status:

- no overwrite warnings in apt-term.log:

ubuntu@sg3-utils-2039279:~$ grep "trying to overwrite" /var/log/dist-upgrade/apt-term.log
ubuntu@sg3-utils-2039279:~$

- sg3-utils packages from mantic-proposed installed:
ubuntu@sg3-utils-2039279:~$ apt-cache policy sg3-utils
sg3-utils:
  Installed: 1.46-3ubuntu2.1
  Candidate: 1.46-3ubuntu2.1
  Version table:
 *** 1.46-3ubuntu2.1 500
        100 http://br.archive.ubuntu.com/ubuntu mantic-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     1.46-3ubuntu2 500
        500 http://br.archive.ubuntu.com/ubuntu mantic/main amd64 Packages

- sg3-utils binary packages installed after the release upgrade:

ubuntu@sg3-utils-2039279:~$ dpkg -l|grep 1.46-3ubuntu2.1 | awk '{print $1,$2,$3}'
ii libsgutils2-1.46-2:amd64 1.46-3ubuntu2.1
ii sg3-utils 1.46-3ubuntu2.1
ii sg3-utils-udev 1.46-3ubuntu2.1

The above tells me that the release upgrade used the mantic-proposed packages, and there were no file overwrite errors.

Mantic verification succeeded.

description: updated
tags: added: verification-done-mantic
removed: verification-needed-mantic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sg3-utils - 1.46-3ubuntu2.1

---------------
sg3-utils (1.46-3ubuntu2.1) mantic; 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, 18 Oct 2023 15:50:36 -0300

Changed in sg3-utils (Ubuntu Mantic):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for sg3-utils has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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.