1

I continue to deal with apt. After unsuccesful apt-offline use I've got a message, that there are errors with broken count. I ran sudo apt-get check and got output:

You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 systemd : Depends: libsystemd0 (= 237-3ubuntu10.33) but 237-3ubuntu10.39 is installed
 udev : Depends: libudev1 (= 237-3ubuntu10.33) but 237-3ubuntu10.39 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

But if I follow this advise, I see a long list of modules which will be removed (97), including init initramfs-tools initramfs-tools-core plymouth plymouth-label, etc. I did it once some time ago, broke my installation and was forced to reinstall Ubunte, so I think that execute this command is bad idea.

How can I fix this unmet dependencies without complete destroy my installation? Thank you!

Edited

Okey, it's turned out very simple in my case. On my offline Ubuntu I executed

sudo apt-get check

and got a list of packages with unmet dependecies.

Next on my online machine (actually, Win 10 Pro with Ubuntu 18.04.4 as WSL) I executed this command (from https://www.ostechnix.com/download-packages-dependencies-locally-ubuntu/)

$ apt-get download $(apt-rdepends package_wih_unmet | grep -v "^ " | sed 's/debconf-2.0/debconf/g')

(where package_wih_unmet is one of packeges from the list I've got on the previous step) in folder I've created for this purpose (for example, '~/python-crypto/'), for every package from the list above.

Next I copyed downloaded files to flash and on offline Ubunut simply ran sudo dpkg -i * in this folders.

For several iterations I've restored my System in unmet dependecies manner.

But I had to take my notebook with modem for efficiency.

  • 1
    A quick look at one item (https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=libudev1) shows the installed version is correct; what version of udev have you installed? and available ie. apt-cache policy udev (This is based on assumption you're using 18.04 LTS on amd64 arm64 armhf i386 ppc64el s390x sd you didn't specify) – guiverc Feb 28 '20 at 06:15
  • Here is output: udev: Installed: 237-3ubuntu10.33 Candidate: 237-3ubuntu10.33 Version table: *** 237-3ubuntu10.33 500 500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages 100 /var/lib/dpkg/status 237-3ubuntu10 500 500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages

    I'm newbie in Linux, sorry.

    – Alexander Moshnin Feb 28 '20 at 08:59
  • Please add additional information to your question, it allows greater formatting and is far easier to read. Your detail looks out of date, The correct bionic package available is 237-3ubuntu10.38 and not 10.33 (https://packages.ubuntu.com/search?suite=all&searchon=names&keywords=udev); so I'd suggest you sudo apt update and read for errors, and correct/expected output, if everything looks okay you could then try again (or sudo apt -f install) but your results for the apt-cache policy are very very old. – guiverc Feb 28 '20 at 09:53
  • This question is consequence of this situation: https://askubuntu.com/questions/1213424/apt-offline-install-produces-keyring-error The output was as this:
      Installed: 237-3ubuntu10.33
      Candidate: 237-3ubuntu10.33
      Version table:
     *** 237-3ubuntu10.33 500
            500 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
            100 /var/lib/dpkg/status
         237-3ubuntu10 500
            500 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages
    
    – Alexander Moshnin Feb 28 '20 at 11:18
  • 1
    This question is consequence of this situation: https://askubuntu.com/questions/1213424/apt-offline-install-produces-keyring-error Briefly, I have Ubuntu system on absolutely offline computer. It's located in private network and I can't use any modem. So, I try update it with apt-offline, which (as I understand) doesn't work properly om Ubuntu 18.04.4 LTS (I've got it a couple of weeks ago from official site). Now I'm going to install some dev software, but I fear, that my system is in inconsistent state. Unfortunately I can't use online options of apt. Sorry for my English – Alexander Moshnin Feb 28 '20 at 11:28

1 Answers1

0

You can try sudo dpkg --configure -a.

Another solution would be:

sudo apt purge libsystemd0 libudev1
sudo apt install libsystemd0=237-3ubuntu10.33
sudo apt install libudev1=237-3ubuntu10.33
Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83