0

Okay, I just install Ubuntu (the LXDE version, which is Lubuntu) and everytime I try to install a package through the terminal with the "Apt-get install" command, this error pops up:

E: Unmet dependencies. Try 'apt-get -f install' with no packages

And, yes this is for every package i try to install. When I do apt-get -f install this is the terminal output I receive:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  libc-bin
The following NEW packages will be installed:
  libc-bin
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/1,168 kB of archives.
After this operation, 3,532 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Can't exec "locale": No such file or directory at /usr/share/perl5/Debconf/Encoding.pm line 16.
Use of uninitialized value $Debconf::Encoding::charmap in scalar chomp at /usr/share/perl5/Debconf/Encoding.pm line 17.
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)

Could someone please help me? I just started using linux 2 months ago, and switched to Lubuntu.

APLUS
  • 911
user287536
  • 301
  • 4
  • 9
  • 1
    http://ubuntuforums.org/archive/index.php/t-1266104.html this may help you.. – A J Jul 23 '14 at 09:02
  • Can you post the ouput of sudo echo $PATH? – chaos Jul 23 '14 at 09:10
  • /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games – user287536 Jul 23 '14 at 09:14
  • What version of Ubuntu did you install? The problem is that libc-bin is missing, there was an old bug in 2011 that could cause this error - if you did install such an old version, it would be better to re-install 14.04. – bain Jul 23 '14 at 11:09

1 Answers1

0

Before anything, try

sudo ldconfig

Just to get that out of the way so we know it's not that.

Then, try these commands, if you normally use sudo su then do not execute that command and do type sudo before every other command listed. If you normally typed sudo apt-get -f install, then execute these commands as listed.

sudo su
apt-get update
apt-get autoremove
apt-get autoclean
apt-get upgrade

And even if the last command fails try

apt-get -f install

For some reason using sudo su can be different than using sudo in terms of your $PATH.

mchid
  • 43,546
  • 8
  • 97
  • 150
  • I can't believe it but it worked. But only when root. I decided to reinstall ubuntu. – user287536 Jul 23 '14 at 17:23
  • @Whaaaaaat sudo -s does not use the same path see here http://ubuntuforums.org/showthread.php?t=983645&s=489a32d9679bc5a7b667e4f2c11da3f3&p=6188826#post6188826 the reason this works is because sudo su uses HOME=/root and whereas sudo and sudo -s use HOME=/home/username – mchid Oct 13 '14 at 00:16
  • actually the difference is the PATH and not HOME – mchid Oct 13 '14 at 00:25
  • Why do you need the root path for those commands? – Kaz Wolfe Oct 13 '14 at 00:36
  • @Whaaaaaat dpkg: warning: 'ldconfig' not found in PATH or not executable dpkg: error: 1 expected program not found in PATH or not executable – mchid Oct 13 '14 at 00:39