Why is Ubuntu 22.04 specifically having an issue with 'trying to overwrite' a file while upgrading my package?

173 Views Asked by At

The error I'm getting when trying to update my own in house developed software package is:

sos@sos1:~$ sudo apt-get upgrade sos sos-playlist-editor
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  sos-playlist-editor-ver-6.0.0-1ubuntu1-22.04jammy
  sos-ver-6.0.0-1ubuntu1-22.04jammy
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  sos-playlist-editor-ver-6.0.1-1ubuntu1-22.04jammy
  sos-ver-6.0.1-1ubuntu1-22.04jammy
The following packages have been kept back:
  gjs libgjs0g linux-generic-hwe-22.04 linux-headers-generic-hwe-22.04
  linux-image-generic-hwe-22.04 ubuntu-advantage-tools
The following packages will be upgraded:
  sos sos-playlist-editor
2 upgraded, 2 newly installed, 0 to remove and 6 not upgraded.
Need to get 28.4 MB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://sos.noaa.gov/debian/sos jammy/stable amd64 sos-playlist-editor-ver-6.0.1-1ubuntu1-22.04jammy amd64 6.0.1-1ubuntu1~22.04jammy [1,246 kB]
Get:2 https://sos.noaa.gov/debian/sos jammy/stable amd64 sos-playlist-editor amd64 6.0.1-1ubuntu1~22.04jammy [1,150 B]
Get:3 https://sos.noaa.gov/debian/sos jammy/stable amd64 sos-ver-6.0.1-1ubuntu1-22.04jammy amd64 6.0.1-1ubuntu1~22.04jammy [27.1 MB]
Get:4 https://sos.noaa.gov/debian/sos jammy/stable amd64 sos amd64 6.0.1-1ubuntu1~22.04jammy [64.6 kB]
Fetched 28.4 MB in 2s (18.4 MB/s)
Selecting previously unselected package sos-playlist-editor-ver-6.0.1-1ubuntu1-22.04jammy.
(Reading database ... 253852 files and directories currently installed.)
Preparing to unpack .../sos-playlist-editor-ver-6.0.1-1ubuntu1-22.04jammy_6.0.1-1ubuntu1~22.04jammy_amd64.deb ...
Unpacking sos-playlist-editor-ver-6.0.1-1ubuntu1-22.04jammy (6.0.1-1ubuntu1~22.04jammy) ...
dpkg: error processing archive /var/cache/apt/archives/sos-playlist-editor-ver-6.0.1-1ubuntu1-22.04jammy_6.0.1-1ubuntu1~22.04jammy_amd64.deb (--unpack):
 trying to overwrite '/usr/share/pixmaps/sos-playlist-editor-icon.png', which is also in package sos-playlist-editor-ver-6.0.0-1ubuntu1-22.04jammy 6.0.0-1ubuntu1~22.04jammy
Preparing to unpack .../sos-playlist-editor_6.0.1-1ubuntu1~22.04jammy_amd64.deb ...
Unpacking sos-playlist-editor (6.0.1-1ubuntu1~22.04jammy) over (6.0.0-1ubuntu1~22.04jammy) ...
Selecting previously unselected package sos-ver-6.0.1-1ubuntu1-22.04jammy.
Preparing to unpack .../sos-ver-6.0.1-1ubuntu1-22.04jammy_6.0.1-1ubuntu1~22.04jammy_amd64.deb ...
Unpacking sos-ver-6.0.1-1ubuntu1-22.04jammy (6.0.1-1ubuntu1~22.04jammy) ...
Preparing to unpack .../sos_6.0.1-1ubuntu1~22.04jammy_amd64.deb ...
Unpacking sos (6.0.1-1ubuntu1~22.04jammy) over (6.0.0-1ubuntu1~22.04jammy) ...
Errors were encountered while processing:
 /var/cache/apt/archives/sos-playlist-editor-ver-6.0.1-1ubuntu1-22.04jammy_6.0.1-1ubuntu1~22.04jammy_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

From my understanding, it looks like since the file "/usr/share/pixmaps/sos-playlist-editor-icon.png" is part of two packages, and only one is being updated (where the icon is also being updated), Ubuntu is not happy about that situation.

I've tried through the automatic software updater tool, as well as a sudo apt-get upgrade as well, with no luck.

We are able to get this package installed if we issue a command to the terminal, namely:

sudo apt upgrade -o DPkg::options::="--force-overwrite" sos sos-playlist-editor

and this works fine and will install and upgrade the package. However, we don't want our users to have to run this command. Is there a better solution to this issue? Ideally, I'd like to have this package installed with normal updates.

0

There are 0 best solutions below