1

I have upgraded my desktop computer from Ubuntu 20.04 to 22.04. This has resulted in a problem related to libnih and unmet dependencies. The error messages read:

The following packages have unmet dependencies:
 libnih-dbus-dev : Depends: libnih-dbus1 (= 1.0.3-12build1) but 1.0.3-6ubuntu2 is to be installed
                   Depends: libnih-dev (= 1.0.3-12build1) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

and:

dpkg: error processing archive /var/cache/apt/archives/libnih-dbus1_1.0.3-12build1_amd64.deb (--unpack):
 package libnih-dbus1:amd64 (1.0.3-12build1) with field 'Multi-Arch: no' is not co-installable with libnih-dbus1 which has multiple installed instances
dpkg: error processing archive /var/cache/apt/archives/libnih1_1.0.3-12build1_amd64.deb (--unpack):
 package libnih1:amd64 (1.0.3-12build1) with field 'Multi-Arch: no' is not co-installable with libnih1 which has multiple installed instances

It is not clear to me how I can repair this. I have tried apt --fix-broken install and also tried to manually remove and update packages but was not successful. How can I solve this problem?

Nmath
  • 12,333
Jan
  • 199
  • I would check your sources and release you're running, as the package versions in your first paste are from bionic and jammy, ie. libnih-dbus1 | 1.0.3-6ubuntu2 | bionic | amd64, arm64, armhf, i386, ppc64el, s390x and libnih-dbus1 | 1.0.3-12build1 | jammy/universe | amd64, arm64, armhf, ppc64el, riscv64, s390x ie. I'd use apt-cache policy to check where you're getting a bionic package from if you're using jammy as you claim. – guiverc Aug 13 '22 at 10:45
  • Thank you for your reply guiverc. This computer has been running Ubuntu for many years and has been upgraded from one LTS to the next multiple times. It could be that during those upgrades some errors have somehow found their way into the computer. – Jan Aug 13 '22 at 14:11
  • I ran the suggested command apt-cache policy but I don't see the word bionic in the results. – Jan Aug 13 '22 at 14:15
  • bionic would be the location if you were getting it from an official Ubuntu repository as per prior comment; you're likely getting it from a poorly managed 3rd party source - where did it show it was from? as your message clearly says "1.0.3-6ubuntu2 is to be installed". We are limited by what you show us, as you can see the full messages you have the best chance of figuring out the issue (ie. read what the apt-cache policy showed as sources...) – guiverc Aug 13 '22 at 22:56
  • It was the Ubuntu Software Updater which suggested that I could upgrade from 20.04 to 22.04. I pushed that upgrade button and have this unmet dependency issue since then. Maybe I should just live with the current situation until it somehow magically gets resolved in the future at a future software update. – Jan Aug 14 '22 at 06:29
  • Your error message shows an error with a bionic (18.04) package thus my suggestion to check your sources (ie. sudo apt update & ensure you have correct sources)... My guess is you have missing lines, or lines that don't belong in the output of apt update If my comments don't help, wait for others to comment, but we're limited with what you provide, my first comment showing the Ubuntu repo. source of that version that is a problem; we can't know what 3rd party you're also using unless told. – guiverc Aug 14 '22 at 06:32
  • Thank you jfs! That seems to have solved the issue on my computer. – Jan Aug 22 '22 at 02:01
  • For at least a year and also since some meta posts recently, there has been a rollback war between 'collaborative editing' for style and such in the post vs. actual OP intention and contents where OP is not willing to accept changes which benefit readability. As a result of this edit war, I am locking this post indefinitely. The conflict between OP and the community in this matter is resulting in rollback wars. Be aware that Stack Exchange is a collaborative environment, and edits are permitted. Aggressive rollbacks are forbidden when the edits are beneficial and don't conflict with intent. – Thomas Ward Feb 20 '23 at 22:04

1 Answers1

2

The most helpful answer was posted as a comment by user jfs. He referred to a similar question, and to where the answer can be found

libnih-dbus1:amd64 and libnih1:amd64 update errors after 22.04 upgrade

https://bugs.launchpad.net/ubuntu/+source/libnih/+bug/1948346

sudo apt purge libnih1:i386 libnih-dbus1:i386 && sudo apt upgrade -y

I tried this, not knowing in great detail what the command actually does, and it works.

Jan
  • 199