1

Why I am not able to install a few packages in my Ubuntu 16.04

If i try: sudo apt-get install update i get:

The following packages have unmet dependencies:
linux-image-extra-4.4.0-64-generic : Depends: linux-image-4.4.0-64-generic but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-64-generic but it is not going to be installed
                   Recommends: thermald but it is not going to be installed
y-ppa-manager : Depends: yad (>= 0.36.0) but it is not going to be installed
             Depends: libnotify-bin but it is not going to be installed
             Depends: ppa-purge but it is not going to be installed
             Depends: xterm
             Depends: launchpad-getkeys (>= 0.3.2) but it is not going to be installed
             Depends: python-appindicator but it is not going to be installed
             Depends: python-gtk2 but it is not going to be installed
             Depends: xclip but it is not going to be installed
             Recommends: gksu but it is not going to be installed or
                         kdesudo but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

I also tried: sudo add-apt-repository ppa:webupd8team/y-ppa-manager

But no use.

Please suggest.

  • 1
    did you do apt-get -f install as instructed by terminal? – George Udosen Feb 23 '17 at 12:07
  • i get same error after using -f option – Sushivam Feb 23 '17 at 12:10
  • 2
    please try sudo apt-get dist-upgrade && sudo apt-get -f install – George Udosen Feb 23 '17 at 12:13
  • What is the output of sudo apt-cache policy linux-image-extra-4.4.0-64-generic? – GAD3R Feb 23 '17 at 12:15
  • This is the output: linux-image-extra-4.4.0-64-generic: Installed: 4.4.0-64.85 Candidate: 4.4.0-64.85 Version table: *** 4.4.0-64.85 500 500 in.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 500 security.ubuntu.com/ubuntu xenial-security/main amd64 Packages 100 /var/lib/dpkg/status – Sushivam Feb 23 '17 at 12:22
2

The most basic fix to resolve dependencies problems is to run:

sudo apt-get -f install

The -f is short for --fix-broken. This will attempt to correct broken dependencies. If you manually installed a package that had unmet dependencies, apt-get will install those dependencies if possible, otherwise it may simply remove the package that you installed in order to resolve the problem.

Go ahead and run:

sudo dpkg --configure -a

Then run this again:

sudo apt-get -f install

If you still get the same error, remove and add the repository you just added. Let me know how it goes.

| improve this answer | |
  • For the command : sudo apt-get -f install i get, Errors were encountered while processing: /var/cache/apt/archives/linux-image-4.4.0-64-generic_4.4.0-64.85_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) Also i get , cannot copy extracted data for './boot/System.map-4.4.0-64-generic' to '/boot/System.map-4.4.0-64-generic.dpkg-new': failed to write (No space left on device) – Sushivam Feb 23 '17 at 12:12
  • For freeing up some space in /home directory i tried: sudo dpkg -P linux-image{,-extra}-4.4.0-{43,45,47,51}-generic – Sushivam Feb 23 '17 at 12:22
  • No space left on device.... Looks like your running out of space. Try freeing up some more space.. perhaps move some files to external or extra partition – Olu Smith Feb 23 '17 at 12:23
  • Yes tried removing some kernels, now /home space shows from 100% used to 60 % used and pls confirm if i remove some kernels listed in dpkg -l | grep -G "linux.*image.*" -h, should not affect anything right? – Sushivam Feb 23 '17 at 12:23
  • try running the sudo apt-get -f install again – Olu Smith Feb 23 '17 at 12:24
1

Begin by Removing Partially Installed Packages with Unmet Dependencies

So, If you run into dependency issues while installing a package, and then want to remove the partially installed package, follow the process below:

Run an audit to show packages with unmet dependencies: dpkg --audit OR sudo dpkg --audit

Force remove offending package(s): dpkg --remove --force-all [name of package]

After that, run

sudo apt-get -f install

Then

sudo dpkg --configure -a

Finally repeat sudo apt-get -f install

At this point, output should be

0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded

Now you can sudo apt-get update and your machine should be back to normal.

| improve this answer | |

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.