LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   apt-get install pkg_name returns "update-alternatives: command not found" (http://www.linuxquestions.org/questions/linux-software-2/apt-get-install-pkg_name-returns-update-alternatives-command-not-found-907100/)

bpeacocke 10-08-2011 10:22 AM

apt-get install pkg_name returns "update-alternatives: command not found"
 
I am trying to install the "make" package (and various others) in order to successfully compile chkrootkit but I always get an error that "update-alternatives" is not found.
I tried to install chkconfig (in order to "recover" alternatives" however it too gives me the same error.
Here is the full result from the apt-get command (I am logged on as root):

# apt-get install make
Reading package lists... Done
Building dependency tree
Reading state information... Done
make is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 79 not upgraded.
4 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up cpp (4:4.3.2-2) ...
/var/lib/dpkg/info/cpp.postinst: line 3: update-alternatives: command not found
dpkg: error processing cpp (--configure):
subprocess post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of gcc:
gcc depends on cpp (>= 4:4.3.2-2); however:
Package cpp is not configured yet.
dpkg: error processing gcc (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of g++:
g++ depends on cpp (>= 4:4.3.2-2); however:
Package cpp is not configured yet.
g++ depends on gcc (>= 4:4.3.2-2); however:
Package gcc is not configured yet.
dpkg: error processing g++ (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of build-essential:
build-essential depends on g++ (>= 4:4.3.1); however:
Package g++ is not configured yet.
dpkg: error processing build-essential (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
cpp
gcc
g++
build-essential
E: Sub-process /usr/bin/dpkg returned an error code (1)

Anyone have any ideas how I can fix this problem??

smallpond 10-08-2011 10:58 AM

What do you get when you run:

apt-get install chkconfig

eSelix 10-08-2011 11:16 AM

"update-alternatives" is in package "dpkg". Try reinstalling this. Also check
Code:

echo $PATH
whereis update-alternatives


bpeacocke 10-12-2011 12:51 AM

Answer to suggestion 1:
-----------------------
apt-get install chkconfig
Reading package lists... Done
Building dependency tree
Reading state information... Done
chkconfig is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 79 not upgraded.
4 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up cpp (4:4.3.2-2) ...
/var/lib/dpkg/info/cpp.postinst: line 3: update-alternatives: command not found
dpkg: error processing cpp (--configure):
subprocess post-installation script returned error exit status 127
...

bpeacocke 10-12-2011 12:54 AM

Eureka!
 
Thanks smallpond!! I reinstalled dpkg and that did the trick!

smallpond 10-12-2011 10:16 PM

Quote:

Originally Posted by bpeacocke (Post 4496144)
Thanks smallpond!! I reinstalled dpkg and that did the trick!

Thank eSelix who at least told you the right package.


All times are GMT -5. The time now is 06:49 PM.