4

I installed Postgresql 9.3 for Ubuntu 14.04 trusty using this command:

sudo apt-get install postgresql-client-9.3 libpq-dev

I wanted to remove postgresql and instead install 9.2 so I ran this command

sudo apt-get install postgresql-client-9.3 libpq-dev

This yields the error:

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

Running sudo -i,echo $PATH yields this output:

/opt/ree/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

Regression

I've tried this command to purge it from existence but I keep getting the same error:

sudo dpkg --purge postgresql-9.3

I've looked on some forums but I haven't found the error messages that I am receiving.

I've also looked into said directores and /usr/local/sbin, /usr/sbin and /sbin exist.

What could be the problem?

3
  • Do sudo -i, enter your username's password, do echo $PATH, then do exit. Post the output from the command echo $PATH to your question. – Alaa Ali Aug 11 '14 at 21:42
  • 1
    Search for different messages like the part "not found in PATH or not executable". The first results I see is ubuntuforums.org/showthread.php?t=1942520 and gives plenty of possibilities to try. Please also include your tries as regression in your question and/or answer. For your understand, the issue is not that /usr/sbin etcetera paths do not exist, but that the installation can't find the helper applications ldconfig and start-stop-daemon. – Pro Backup Aug 12 '14 at 11:28
  • Thanks Pro Backup. This removed the problem I was having. I had to use this command PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin sudo apt-get -f install – Dan Rubio Aug 12 '14 at 18:40
3

Try to include the missing directories in your path before running the apt-get.

Like:

$ PATH=$(PATH):/usr/local/sbin:/usr/sbin:/sbin
$ sudo apt-get remove postgresql-client-9.3

Note: this PATH setting will be lost after reboot. The save this setting permanently place it in your shell its rc file, for example when using BASH shell: $ nano .bashrc

1

If you installed it from the repositories, you could try to uninstall it trough apt-get and not dpkg:

sudo apt-get remove posgresql-client-9.3
1
  • Hey darent thanks for the reply but no luck. I still get the same error message. :\ – Dan Rubio Aug 11 '14 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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