Fixing dpkg: warning: ‘ldconfig’ not found in PATH or not executable error when installing packages.

Linux Bugs - Error Message - blackMORE Ops

Overnight I had a new error in Kali Linux 2.0 – Kali Sana. I tried to install gimp and everything seemed going well. Except right at the point when it started installing gimp, I had the following errors coming up:

root@kali:~# apt-get install gimp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0
  libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1
  libumfpack5.6.2
Suggested packages:
  gimp-help-en gimp-help gimp-data-extras
The following NEW packages will be installed:
  gimp gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0
  libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1
  libumfpack5.6.2
0 upgraded, 12 newly installed, 0 to remove and 8 not upgraded.
Need to get 15.7 MB of archives.
After this operation, 70.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://http.kali.org/kali/ sana/main libamd2.3.1 amd64 1:4.2.1-3 [26.3 kB]
Get:2 http://http.kali.org/kali/ sana/main libbabl-0.1-0 amd64 0.1.10-2 [97.2 kB]                                                                                                                                 
Get:3 http://http.kali.org/kali/ sana/main libcamd2.3.1 amd64 1:4.2.1-3 [24.6 kB]                                                                                                                                 
Get:4 http://http.kali.org/kali/ sana/main libccolamd2.8.0 amd64 1:4.2.1-3 [26.0 kB]                                                                                                                              
Get:5 http://http.kali.org/kali/ sana/main libcolamd2.8.0 amd64 1:4.2.1-3 [20.4 kB]                                                                                                                               
Get:6 http://http.kali.org/kali/ sana/main libcholmod2.1.2 amd64 1:4.2.1-3 [288 kB]                                                                             Get:7 http://http.kali.org/kali/ sana/main libopenraw1 amd64 0.0.9-3.5+b2 [132 kB]
Get:8 http://http.kali.org/kali/ sana/main libumfpack5.6.2 amd64 1:4.2.1-3 [222 kB]
Get:9 http://http.kali.org/kali/ sana/main libgegl-0.2-0 amd64 0.2.0-7+b1 [541 kB]
Get:10 http://http.kali.org/kali/ sana/main libgimp2.0 amd64 2.8.14-1+b1 [1,666 kB]
Get:11 http://http.kali.org/kali/ sana/main gimp-data all 2.8.14-1 [8,309 kB]  
Get:12 http://http.kali.org/kali/ sana/main gimp amd64 2.8.14-1+b1 [4,395 kB]                                                                                                                                     
Fetched 15.7 MB in 6min 33s (40.0 kB/s)                                                                                                                                                                           
dpkg: warning: 'ldconfig' not found in PATH or not executable
dpkg: warning: 'start-stop-daemon' not found in PATH or not executable
dpkg: error: 2 expected programs 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)d

Did some research and found that it’s an issue with with $PATH in profile.

echo $PATH” and “sudo echo $PATH” both show me

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

However, because I use Kali as root user, it didn’t matter. I ended up using sudo with my install command and everything went well. Will keep researching on how to fix it permanently.

root@kali:~# sudo apt-get install gimp
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0 libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1 libumfpack5.6.2
Suggested packages:
gimp-help-en gimp-help gimp-data-extras
The following NEW packages will be installed:
gimp gimp-data libamd2.3.1 libbabl-0.1-0 libcamd2.3.1 libccolamd2.8.0 libcholmod2.1.2 libcolamd2.8.0 libgegl-0.2-0 libgimp2.0 libopenraw1 libumfpack5.6.2
0 upgraded, 12 newly installed, 0 to remove and 11 not upgraded.
Need to get 0 B/15.7 MB of archives.
After this operation, 70.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y

For some users, when you’re logged in as normal/standard user it happened. using su - to become root and sudo worked for them.

6 comments

  1. Same thing happened to me after trying to install synaptic… Lame, ended up reinstalling the whole distro and no issues after that installing synaptic. Something went bad along the way I tried the first time.

  2. where is Main Menu ?? .. i cant find him … in kali 1.x it shows in Applications> System Tools> Perefrences > Main Menu

    i want to add cobaltstrike and havij to the Applications Menu … Please Help me

  3. I had this same problem. Type sudo before apt-get even though it isnt required and no password prompt follows. The packages will then install properly :)

  4. Here’s a workaround:

    “`
    $ export PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/bin:/bin
    $ sudo -E apt install nginx
    “`

  5. add this line at the end of “.bashrc” file in your Home folder

    export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

    Save the file and restart the shell

Leave your solution or comment to help others.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from blackMORE Ops

Subscribe now to keep reading and get access to the full archive.

Continue reading

Privacy Policy on Cookies Usage

Some services used in this site uses cookies to tailor user experience or to show ads.