Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I have Dell latitude E6430, system information: Ubuntu 11.10 ,OS type 64 bit. when I tried to make updates to my Ubuntu 11.10 , it gave me a message , that you can't update anything until you remove third party repositories , but you can make upgrade. message 1 :

your Ubuntu release is not supported anymore. 
you will not get any further security fixes or critical updates. please upgrade to a later version of Ubuntu Linux.

message 2 :

not all updates can be installed. run  a partial upgrade, to install as many updates as possible. 
this can be caused by :
a previous upgrade which didn't complete.
problems with some of the installed software.
unofficial software packages not provided by Ubuntu.
normal changes of a pre-release version of Ubuntu.
I clicked on partial upgrade and it prepares upgrade for three hours then start to upgrade , then it didn't finish and stops then these message appear. 
message 3: software index is broken .
it is impossible to install or remove any software. please use the package manager "synaptic" or run " sudo apt-get install-f " in a terminal to fix this issue at first. 
When writing the command sudo apt-get install -f , the following appear

Reading package lists... Done 
Building dependency tree       
Reading state information... Done 
Correcting dependencies... Done 
The following packages were automatically installed and are no longer required: 
  gir1.2-timezonemap-1.0 gir1.2-gstreamer-0.10 efibootmgr libtimezonemap1 
  libdmraid1.0.0.rc16 libdebconfclient0 user-setup rdate python-argparse 
  libdebian-installer4 btrfs-tools apt-clone localechooser-data 
  python-xklavier archdetect-deb dmraid python-pyicu 
Use 'apt-get autoremove' to remove them. 
The following extra packages will be installed: 
  adobe-flash-properties-gtk adobe-flashplugin firefox firefox-globalmenu 
  fontconfig libc-bin libc6 libqt4-dbus libqt4-declarative libqt4-network 
  libqt4-opengl libqt4-script libqt4-sql libqt4-sql-mysql libqt4-svg 
  libqt4-xml libqt4-xmlpatterns libqtcore4 libqtgui4 libreoffice-base-core 
  libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw 
  libreoffice-gnome libreoffice-gtk libreoffice-impress libreoffice-math 
  libreoffice-writer python-uno qdbus thunderbird thunderbird-globalmenu 
  thunderbird-gnome-support uno-libs3 ure 
Suggested packages: 
  konqueror-nsplugins msttcorefonts ttf-bitstream-vera ttf-dejavu 
  ttf-xfree86-nonfree xfs libnspr4-0d latex-xft-fonts glibc-doc 
  libqt4-declarative-folderlistmodel libqt4-declarative-gestures 
  libqt4-declarative-particles libqt4-declarative-shaders qt4-qmlviewer 
  libqt4-dev qt4-qtconfig libreoffice-base libreoffice-style-hicontrast 
  libreoffice-style-tango libreoffice-style-crystal libreoffice-style-oxygen 
  libreoffice-evolution libreoffice-gcj libreoffice-java-common 
  libreoffice-filter-binfilter cli-uno-bridge 
The following NEW packages will be installed: 
  fontconfig libc-bin 
The following packages will be upgraded: 
  adobe-flash-properties-gtk adobe-flashplugin firefox firefox-globalmenu 
  libc6 libqt4-dbus libqt4-declarative libqt4-network libqt4-opengl 
  libqt4-script libqt4-sql libqt4-sql-mysql libqt4-svg libqt4-xml 
  libqt4-xmlpatterns libqtcore4 libqtgui4 libreoffice-base-core 
  libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw 
  libreoffice-gnome libreoffice-gtk libreoffice-impress libreoffice-math 
  libreoffice-writer python-uno qdbus thunderbird thunderbird-globalmenu 
  thunderbird-gnome-support uno-libs3 ure 
34 upgraded, 2 newly installed, 0 to remove and 464 not upgraded. 
2 not fully installed or removed. 
Need to get 0 B/134 MB of archives. 
After this operation, 28.2 MB 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. 
Extracting templates from packages: 100% 
Preconfiguring packages ... 
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)
share|improve this question

marked as duplicate by Alvar, Radu Rădeanu, Thomas W., Kevin Bowen, Warren Hill Aug 21 '13 at 6:56

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

The problem is that your software index is broken. Some package or other is being problematic. If you use apt-get, chances are it will not work. Try this:

  1. Type sudo dpkg --configure -a. It will error out, but don't worry.
  2. Find the files causing the problems and type sudo dpkg -r PACKAGE_NAME for each one to remove it. Some of them will fail to be removed. Add them to a list.
  3. Run sudo dpkg --configure PACKAGE_NAME for each package in your list. It will configure them. This time, you should not see any errors.
  4. Run sudo apt-get install -f to fix dependencies.
  5. Profit!

Also, you may want to run sudo apt-get autoremove to remove unnecessary packages. Good luck!

Update: To fix the problem with ldconfig, try this:

  1. aptitude download libc-bin
  2. dpkg-deb -x libc-bin* libc_unpacked
  3. cp libc_unpacked/sbin/ldconfig* /sbin/
share|improve this answer
    
thanks Dillmo for your reply , when typed sudo dpkg --configure -a appeared 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. –  smsm Aug 20 '13 at 21:36
    
what is the package name in this case. –  smsm Aug 20 '13 at 21:37
    
Try following the updated instructions (on the bottom) –  Dillmo Aug 21 '13 at 22:54

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