Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using Ubuntu 10.04
Whenever I try to do an sudo apt-get install I get this error

(this example is for sudo apt-get install virtualbox)

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting virtualbox-3.2 instead of virtualbox
virtualbox-3.2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up apache (1.3.34-2ubuntu0.1) ...
dpkg: error processing apache (--configure):
 subprocess installed post-installation script returned error exit status 10
Setting up lynx (2.8.5-2ubuntu1) ...
update-alternatives: error: alternative path /usr/bin/lynx doesn't exist.
dpkg: error processing lynx (--configure):
 subprocess installed post-installation script returned error exit status 2
Processing triggers for menu ...
Errors were encountered while processing:
 apache
 lynx
E: Sub-process /usr/bin/dpkg returned an error code (1)
share|improve this question

3 Answers 3

NOTE: In this process your apache & lynx will be removed and reinstalled

try following This should remove your apache & lynx

sudo dpkg -r lynx

sudo dpkg -r apache

then try

sudo apt-get -f autoremove

sudo apt-get -f install

sudo apt-get update

sudo apt-get install apache2 lynx

share|improve this answer

Something is wrong with your apache and lynx installation. It's hard to say what broke, or why. You could try removing lynx and apache and reinstalling them.

share|improve this answer

Actually, you can install and upgrade packages as long as they don't depend on lynx or apache. Nonetheless you should resolve this as soon as possible.

The installation process for both packages is blocked because the post-installation scripts are returning an error. You need to fix or work around each error.

For lynx, the message alternative path /usr/bin/lynx doesn't exist indicates that something is wrong with your current installation of lynx. It's possible that merely upgrading the package to the version in 10.04 will fix the problem, so try that first (apt-get install lynx-cur lynx). Otherwise the easiest way to fix this may well be to remove the lynx package and reinstall it.

For apache, you also currently have the version from 8.04 installed. If you were upgrading anyway, first try getting the latest version: apt-get install apache. If that doesn't work, you'll need to figure out what precisely is causing the error. Edit /var/lib/dpkg/info/apache.postinst and add set -x as the second line of the file, then run dpkg --configure apache and watch the trace. If you can't figure out what's wrong, post that trace.

share|improve this answer
    
when trying to apt-get install lynx i get E: Sub-process /usr/bin/dpkg returned an error code (1) –  Asaf Nov 4 '10 at 18:35
    
@Asaf: Add set -x to /var/lib/dpkg/info/lynx.prerm and post the resulting error message. Also post the output of ls -l /usr/bin/lynx* /etc/alternatives/lynx* and the contents of /var/lib/dpkg/alternatives/lynx. –  Gilles Nov 4 '10 at 20:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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