Score:2

trying to overwrite foo, which is also in package bar dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)

ir flag

Ubuntu 22.04

Today when I issue

sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 unixodbc : Depends: odbcinst1debian2 (>= 2.3.11) but it is not installed
            Depends: libodbc1 (>= 2.3.11) but 2.3.9-5 is installed
 unixodbc-dev : Depends: odbcinst1debian2 (= 2.3.11) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

then as suggested getting

sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  libodbccr2
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libodbc1 odbcinst odbcinst1debian2
Suggested packages:
  unixodbc-bin
The following NEW packages will be installed:
  odbcinst1debian2
The following packages will be upgraded:
  libodbc1 odbcinst
2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/607 kB of archives.
After this operation, 863 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 725562 files and directories currently installed.)
Preparing to unpack .../odbcinst_2.3.11_amd64.deb ...
Unpacking odbcinst (2.3.11) over (2.3.9-5) ...
dpkg: error processing archive /var/cache/apt/archives/odbcinst_2.3.11_amd64.deb (--unpack):
 trying to overwrite '/etc/odbc.ini', which is also in package unixodbc-common 2.3.9-5
Preparing to unpack .../odbcinst1debian2_2.3.11_amd64.deb ...
Unpacking odbcinst1debian2:amd64 (2.3.11) ...
dpkg: error processing archive /var/cache/apt/archives/odbcinst1debian2_2.3.11_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbcinst.so.2.0.0', which is also in package libodbcinst2:amd64 2.3.9-5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../libodbc1_2.3.11_amd64.deb ...
Unpacking libodbc1:amd64 (2.3.11) over (2.3.9-5) ...
dpkg: error processing archive /var/cache/apt/archives/libodbc1_2.3.11_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/x86_64-linux-gnu/libodbc.so.2.0.0', which is also in package libodbc2:amd64 2.3.9-5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/odbcinst_2.3.11_amd64.deb
 /var/cache/apt/archives/odbcinst1debian2_2.3.11_amd64.deb
 /var/cache/apt/archives/libodbc1_2.3.11_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

How to get out of this hole ?

I have no problems purging any package to solve this issue. This is exactly the kind of edge case which is holding up mass adoption of linux. My gut says lay low until offending package owners push their fix upstream.

I have tried many guesses including ... to no avail ... Suggestions ?

sudo apt-get autoremove  
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 unixodbc : Depends: odbcinst1debian2 (>= 2.3.11) but it is not installed
            Depends: libodbc1 (>= 2.3.11) but 2.3.9-5 is installed
 unixodbc-dev : Depends: odbcinst1debian2 (= 2.3.11) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Score:1
ir flag

These commands allowed me to remove the offending packages

previously the next command failed now its working

dpkg --remove  unixodbc-dev
(Reading database ... 725562 files and directories currently installed.)
Removing unixodbc-dev (2.3.11) ...


apt-get install -f
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
  odbcinst
Use 'apt autoremove' to remove it.
The following packages will be REMOVED:
  msodbcsql17 mssql-tools unixodbc
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 114 kB disk space will be freed.
Do you want to continue? [Y/n]
(Reading database ... 725539 files and directories currently installed.)
Removing mssql-tools (17.10.1.1-1) ...
Removing msodbcsql17 (17.10.2.1-1) ...
ODBC Driver 17 for SQL Server has been deleted (if it existed at all) because its usage count became zero
Removing unixodbc (2.3.11) ...
Processing triggers for man-db (2.10.2-1) ...


sudo apt-get autoremove -yq


sudo apt-get --fix-broken install -y



sudo dpkg -P libodbc2:amd64
dpkg: dependency problems prevent removal of libodbc2:amd64:
 libodbccr2:amd64 depends on libodbc2 (= 2.3.9-5).
 libodbc1:amd64 depends on libodbc2 (= 2.3.9-5).
 libgdal30 depends on libodbc2 (>= 2.3.1).

dpkg: error processing package libodbc2:amd64 (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 libodbc2:amd64




sudo dpkg -P libgdal30
dpkg: dependency problems prevent removal of libgdal30:
 libopencv-imgcodecs4.5d:amd64 depends on libgdal30 (>= 2.0.1).

dpkg: error processing package libgdal30 (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 libgdal30


sudo apt-get purge libopencv-*


sudo apt-get purge libodbc1
Lanklaas avatar
in flag
This pointed me in the right direction. In my case it seems like MS ODBC was causing this, had to remove mssql-tools & msodbcsql17. then I removed unixodbc. I also had to remove the microsoft-prod.list file from my /etc/apt/sources.list.d/. Then I could reinstall unixodbc
Score:0
cn flag

Your ouput says that you have two packages, libodbc1 and libodbc2 that are trying to provide the same file (libodbc.so.2.0.0). That's bad.

In other words, those two packages are incompatible. Only one of them can be installed without forcing (--force-overwrite). Only an experienced user (like you) should hazard forcing, and record somewhere that you did so -- uninstalling A may require reinstalling B.

Inexperienced users should not try to install both using deb package. Installing one from source, or using a different package system, may be preferable.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.