0

Please help! When I do this command:

sudo apt-get install libsnmp-dev

I get this error:

~$ sudo apt-get install libsnmp-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libsnmp-dev : Depends: libpci-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

When I do:

sudo apt-get install libpci-dev

I get:

~$ sudo apt-get install libpci-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libpci-dev : Depends: libudev-dev (>= 196) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

When I do:

sudo apt-get install libudev-dev

I get:

~$ sudo apt-get install libudev-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libudev-dev : Depends: libudev1 (= 237-3ubuntu10) but 237-3ubuntu10.3 is to be installed
E: Unable to correct problems, you have held broken packages.

When I do:

sudo apt-get install libudev1

I get:

~$ sudo apt-get install libudev1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libudev1 is already the newest version (237-3ubuntu10.3).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I tried all the usual fixes for this type of thing, well summarized on this page:

http://sourcedigit.com/21301-fix-broken-packages-ubuntu-terminal-list-broken-packages-ubuntu/

In case the link ever breaks I'll copy/paste them here:

sudo dpkg --remove -force --force-remove-reinstreq libsnmp-dev

sudo dpkg --remove -force --force-remove-reinstreq libpci-dev

sudo dpkg --remove -force --force-remove-reinstreq libudev-dev

Command 1

sudo apt-get --fix-broken install

Command 2

If a Ubuntu package installation fails (due to dependencies), run the following command

sudo apt-get clean
sudo apt-get install -f
sudo dpkg --configure -a
sudo apt-get update

Command 3

sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update

Command 4

sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove

Command 5

sudo dpkg --configure -a
sudo apt-get update

After all of this I still get the original error. Suggestions? I have no idea what else to do other than format HD / reinstall OS.

1
  • Please edit your question to include 1) Links to whatever instructions you are following, and 2) The complete output of cat /etc/apt/sources.list /etc/apt/sources.list.d/* – user535733 Oct 8 '18 at 20:41
1

Durp, once I checked "Recommended updates (bionic-updates)" within "Software & Updates" the original apt-get install command worked:

enter image description here

1
  • It worked. It also needed - sudo apt-get update – Nesha Zoric Sep 12 '19 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.