6

I am having dependency problems. Whenever I run an apt-get install command, I get this error message:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1337 not upgraded.
7 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initramfs-tools (0.103ubuntu0.7) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.8.0-19-generic (3.8.0-19.30) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.8.0-29-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.8.0-19-generic /boot/vmlinuz-3.8.0-19-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.8.0-19-generic /boot/vmlinuz-3.8.0-19-generic
Error! echo
Your kernel headers for kernel 3.8.0-19-generic cannot be found at
/lib/modules/3.8.0-19-generic/build or /lib/modules/3.8.0-19-generic/source.
Error! echo
Your kernel headers for kernel 3.8.0-19-generic cannot be found at
/lib/modules/3.8.0-19-generic/build or /lib/modules/3.8.0-19-generic/source.
Error! echo
Your kernel headers for kernel 3.8.0-19-generic cannot be found at
/lib/modules/3.8.0-19-generic/build or /lib/modules/3.8.0-19-generic/source.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.8.0-19-generic /boot/vmlinuz-3.8.0-19-generic
update-initramfs: Generating /boot/initrd.img-3.8.0-19-generic
Warning: No support for locale: en_SG.utf8
cp: cannot stat ‘/module-files.d/libpango1.0-0.modules’: No such file or directory
cp: cannot stat ‘/modules/pango-basic-fc.so’: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-19-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.8.0-19-generic.postinst line 1010.
dpkg: error processing linux-image-3.8.0-19-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-image-3.8.0-29-generic (3.8.0-29.42) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.8.0-19-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.8.0-29-generic /boot/vmlinuz-3.8.0-29-generic
run-parts: executing /etc/kernel/postinst.d/dkms 3.8.0-29-generic /boot/vmlinuz-3.8.0-29-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.8.0-29-generic /boot/vmlinuz-3.8.0-29-generic
update-initramfs: Generating /boot/initrd.img-3.8.0-29-generic
Warning: No support for locale: en_SG.utf8
cp: cannot stat ‘/module-files.d/libpango1.0-0.modules’: No such file or directory
cp: cannot stat ‘/modules/pango-basic-fc.so’: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-29-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.8.0-29-generic.postinst line 1010.
dpkg: error processing linux-image-3.8.0-29-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-extra-3.8.0-29-generic:
 linux-image-extra-3.8.0-29-generic depends on linux-image-3.8.0-29-generic; however:
  Package linux-image-3.8.0-29-generic is not configured yet.
 
dpkg: error processing linux-image-extra-3.8.0-29-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
 linux-image-generic depends on linux-image-3.8.0-29-generic; however:
  Package linux-image-3.8.0-29-generic is not configured yet.
 linux-image-generic depends on linux-image-extra-3.8.0-29-generic; however:
  Package linux-image-extra-3.8.0-29-generic is not configured yet.
 
dpkg: error processing linux-image-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image:
 linux-image depends on linux-image-generic; however:
  Package linux-image-generic is not configured yet.
 
dpkg: error processing linux-image (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-extra-3.8.0-19-generic:
 linux-image-extra-3.8.0-19-generic depends on linux-image-3.8.0-19-generic; however:
  Package linux-image-3.8.0-19-generic is not configured yet.
 
dpkg: error processing linux-image-extra-3.8.0-19-generic (--configure):
 dependency problems - leaving unconfigured
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.8.0-27-generic
Warning: No support for locale: en_SG.utf8
cp: cannot stat ‘/module-files.d/libpango1.0-0.modules’: No such file or directory
cp: cannot stat ‘/modules/pango-basic-fc.so’: No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-3.8.0-27-generic with 1.
dpkg: error processing initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 linux-image-3.8.0-19-generic
 linux-image-3.8.0-29-generic
 linux-image-extra-3.8.0-29-generic
 linux-image-generic
 linux-image
 linux-image-extra-3.8.0-19-generic
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

I already tried:

  • apt-get clean, update, upgrade, install -f
  • dpkg --configure -a

What should I do now?

3
  • 2
    Can you please try this: sudo apt-get clean && sudo apt-get update && sudo apt-get dist-upgrade (this is all on one line). You have 1337 upgrades including linux kernels, that's why we're using dist-upgrade.
    – Alaa Ali
    Commented Aug 24, 2013 at 19:52
  • I've found that this repo was added in the sources.list file ftp.de.debian.org/debian sid main and it provides new version for all those 1337 packages. Is that repo stable? I am fine with upgrading if the repo above is well tested and marked as stable, untested packages may introduce more problems while I need to get my system ready asap.
    – boh
    Commented Aug 24, 2013 at 21:51
  • I found this person's post fixed my issue easily and completely. askubuntu.com/q/378883/257156 I spent 2 days looking for a solution until I came across this! Commented Mar 11, 2014 at 16:31

3 Answers 3

18

http://ftp.de.debian.org/debian/ sid main is a repository for the Debian OS, not Ubuntu. You should not be using this repository. Here's what you can do:

  1. sudo cp /etc/apt/sources.list /etc/apt/sources.list.bk

    • This is to backup your sources.list file.
  2. Open up /etc/apt/sources.list with your favorite editor, and delete everything, and repopulate it with the proper, default repositories. Here's how you'll get them:

    • Go here: http://repogen.simplylinux.ch/
    • Select your country and release.
    • Select everything in the "Ubuntu Branches" box.
    • Select everything in the "Ubuntu Updates" box except for the "Proposed" options.
    • Select everything in the "Ubuntu Partner Repos" box.
    • Select everything in the "Ubuntu Extras Repos" box.
    • Scroll down to the very bottom and hit Generate List.
    • Copy the output of the first box into your sources.list file and save it.
  3. Run the following commands in order:

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

    You'll probably get some errors along the way. apt-get install -f should try to fix most issues, but I suspect that it won't fix everything. dpkg will try to further configure the packages, although apt-get install -f should call it by default. The last command is to fully upgrade your system, including the linux kernel, which is what you're having problems with from the logs you posted. I suggest you, again, run these commands after everything is done:

    sudo apt-get install -f
    sudo dpkg -a --configure
    
1
  • latest ubuntu versions like 20.04 LTS is not there. Commented Aug 5, 2021 at 19:19
0

Try this command. It helped me.

apt remove package_name 

and hit Enter

Then try to install whatever you want

0

I had similar issue all of a sudden when I try to install via apt-get or dkpg -i.

What did the trick for me is as was suggested in the output of the error message:

apt-get install -f

I presume, one of my recent installations failed and left my system in an unmet dependencies state. Running the above installed a few libraries, post which I was able to install my new software.

You must log in to answer this question.

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