I'm running Raspbian on my Raspberry Pi I just set up this day, the problem is that every time I try to install any package I get an error , for example, sudo apt-get install samba gives me :

The following packages have unmet dependencies: 
libc6 : Depends: libgcc1 but it is not going to be installed 
samba : Depends: samba-common (= 2:3.6.6-6+deb7u4) but it is not going to be installed
        Depends: libwbclient0 (= 2:3.6.6-6+deb7u4) but it is not going to be installed 
        Depends: libacl1 (>= 2.2.51-8) but it is not going to be installed  
        Depends: libattr1 (>= 1:2.4.46-8) but it is not going to be installed  
        Depends: libcap2 (>= 2.10) but it is not going to be installed  
        Depends: libcomerr2 (>= 1.01) but it is not going to be installed  
        Depends: libcups2 (>= 1.4.0) but it is not going to be installed
        Depends: libgcc1 (>= 1:4.4.0) but it is not going to be installed  
        Depends: libgssapi-krb5-2 (>= 1.10+dfsg~) but it is not going to be installed  
        (...)
Try 'apt-get -f install' with no packages (or specify a solution).

So I tried to do sudo apt-get -f install but that gave me :

 $ sudo apt-get -f install 
 Reading package lists... Done 
 Building dependency tree 
 Reading state information... Done 
 Correcting dependencies... Done

 The following extra packages will be installed:
     libgcc1

 The following NEW packages will be installed: 
     libgcc1

 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 2 not fully installed or removed. 
 Need to get 0 B/54.2 kB of archives. Continue [Y/n]? y 

 Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, line 1. 
 Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, chunk 1. 
 Use of uninitialized value $value in substitution (s///) at /usr/share/perl5/Debconf/Format/822.pm line 65, line 1. 
 Use of uninitialized value $item in hash element at /usr/share/perl5/Debconf/DbDriver/File.pm line 85, chunk 1.

 E: Cannot get debconf version. Is debconf installed? 
 debconf: apt-extracttemplates failed: No such file or directory
 dpkg: regarding .../libgcc1_1%3a4.8.2-21~rpi3rpi1_armhf.deb containing libgcc1:armhf, pre-dependency problem: libgcc1 pre-depends on multiarch-support, multiarch-support is unpacked, but has never been configured.

 dpkg: error processing /var/cache/apt/archives/libgcc1_1%3a4.8.2-21~rpi3rpi1_armhf.deb (--unpack): pre-dependency problem - not installing libgcc1:armhf
 Errors were encountered while processing: /var/cache/apt/archives/libgcc1_1%3a4.8.2-21~rpi3rpi1_armhf.deb 

 E:Sub-process /usr/bin/dpkg returned an error code (1)

I then tried to figure out how to fix these new errors and I ended up here : http://www.raspberrypi.org/forums/viewtopic.php?f=28&t=48737

So I followed these steps : https://askubuntu.com/questions/55099/dpkg-error-parsing-file-var-lib-dpkg-available-near-line-0

Because that seemed to work for the other guy but it's still giving me the same errors, it looks like there's something wrong with the packet management, does anyone know how I would fix this ?

  • Did you run apt-get update before apt-get install ? – Vinz Nov 12 '14 at 11:07
  • Yes I did, that works without problems but does not resolve the errors. – user2140285 Nov 12 '14 at 11:10
  • Your debconf installation seems to be corrupted...: E: Cannot get debconf version. Is debconf installed? – Vinz Nov 12 '14 at 11:20
  • Is there any way I can fix that? – user2140285 Nov 12 '14 at 11:21
  • The fastest way would be to do a backup and reinstall your system. Also make sure that your SD-Card does not contain bad sectors or your system will be corrupted again. – Vinz Nov 12 '14 at 11:26

from this answer https://askubuntu.com/a/485293

DISCLAIMER: I'm not sure what implications this will have on my overall package setup or cause any problems with upgrades down the line.

manually force the installed status for multiarch-support:

nano /var/lib/dpkg/status

find the the line starting with Package: something like:

Package: multiarch-support
Status: install ok unpacked

change unpacked to installed

save & exit

sudo apt-get install -f

This should fix your dependencies now

sudo apt-get install git

Some other people who've reported this created the problem by moving /var/cache into a tmpfs at boot. Raspbian isn't like that by default and the system won't work that way, so if you've done that you might as well re-install.

If not, it could be SD card issues. Even if it is a new card, a small percentage of them are perhaps born defunct and if there were 10 000 people doing the same thing yesterday and only one ended up here with this problem then there's your probability (n.b. most people will probably never have such problems in life but the ones that do tend to make a lot of noise about it).

First check the second partition with e2fsck. To do that you need to put it in another linux box. If you don't have one, get a live CD and use that, this will probably make your life with the pi easier in the long run anyway. Stick the card in and figure out what the device node for the second partition on the card is (some pop-up may tell you, or you can compare ls /dev before and after you insert it). You don't want it mounted, if it automounted undo that. Then if it's /dev/sdb2:

e2fsck -c /dev/sdb2

Don't get that device node wrong. Be very sure. It may take a while, but not too too long. It should complete without errors. If it starts coughing up a lot, you could stop it and restart with -y to automatically answer yes to everything, or, since your root filesystem is evidently screwed, reflash the card. Or you could give on the card. If you go through this twice in a row, definitely try another one.

If that passes okay then random corruption is more or less ruled out. At that point I have one more cargo cult find. Reboot the pi and:

sudo apt-get install debconf --reinstall

But again, don't bother with all this until you check the partition w/ e2fsck.

At first try:

dpkg -a --configure

After that run your previous 'apt-get command'. 'libgcc1' is not related to gcc compiler, It's related to network. After abovbe trying, try:

apt-get --reinstall install libgcc1

If you don't get any answer, report it.

  • Getting the missing dependencies error when trying the first command and the 2nd error with the 2nd command – user2140285 Nov 12 '14 at 11:11
  • I get an error: **Can't locate warnings.pm in @INC (you may need to install the warnings module) (@INC contains: /etc/perl ** – Igor Ganapolsky Jan 30 '17 at 20:45

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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