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, 2018 at 20:41

3 Answers 3

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 Sep 12, 2019 at 7:07
0

I was facing same issue and tried many solutions but failed and faced following message.

    wasim@simsim:~/uStore-Auth$ sudo apt update && sudo apt install libsnmp-dev
                             
    .
    .
    .

    Fetched 768 kB in 3s (226 kB/s)     
    Reading package lists... Done 
    Building dependency tree       

    Reading state information... Done

    1 package can be upgraded. Run 'apt list --upgradable' to see it.

    Reading package lists... Done

    Building dependency tree       

    Reading state information... Done

    Package libsnmp-dev is not available, but is referred to by another 
    package.

    This may mean that the package is missing, has been obsoleted, or

    is only available from another source


    E: Package 'libsnmp-dev' has no installation candidate

I opened Software & updates and marked canonical-supported free and opensource softwares as shown in the images.

and also unmarked the following softwares in the Other Softwares tab. You will have different softwares but make sure to unmark all.

And finally I installed with the same command.

sudo apt-get install -y libsnmp-dev

0

Also you can downgrade your libudev1 like this:

sudo apt-get install --allow-downgrades libsnmp-dev libpci-dev libudev1=245.4-4ubuntu3.19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .