LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Sub-Process /usr/bin/dpkg returned an error code (1) (https://www.linuxquestions.org/questions/debian-26/sub-process-usr-bin-dpkg-returned-an-error-code-1-a-171107/)

Bookspoppa 04-16-2004 07:15 PM

Sub-Process /usr/bin/dpkg returned an error code (1)
 
I just installed Debian, and I am upgrading to unstable. When I do the command apt-get upgrade I recieve the an error saying Sub-Process /usr/bin/dpkg returned an error code (1).

this is the the screen leading up to the error:

Preparing to replace console-common 0.7.38 (using .../console-common_0.7.40_all.deb) ...
dpkg: error processing /var/cache/apt/archives/console-common_0.7.40_all.deb (--unpack):
subprocess pre-installation script returned error exit status 9
Loading /etc/console/boottime.kmap.gz
Preparing to replace libkrb53 1.3.2-2 (using .../libkrb53_1.3.3-1_i386.deb) ...
Unpacking replacement libkrb53
Preparing to replace libpam-runtime 0.76-16 (using .../libpam-runtime_0.76-19_all.deb) ...
Unpacking replacement libpam-runtime ...
Errors were encountered while processing:
/var/cache/apt/archives/console-common_0.7.40_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I am a newbie, so please be specific in your reply. Thanks a lot for your help in advance.

CBlue 04-16-2004 09:11 PM

After you get that error, try apt-get -f install to force an install of the files that didn't get loaded because of the error. Then try apt-get upgrade again, apt-get -f install back and forth until only the package that has the error is left.

Bookspoppa 04-17-2004 04:02 AM

thanks a lot. that worked.

souljah 04-17-2004 07:22 AM

If you are going to be using debian unstable (sid) it is inherently necessary to read the manpage for dpkg and apt-get. This was just a small taste of what can go wrong with sid :)

CBlue 04-17-2004 10:42 AM

I love Sid though! It's fun! :)

feral-deb 01-31-2008 06:20 AM

I had a similar problem and what i found that worked for me was going into /var/lib/dpkg/info and deleting everything that had that name and you may also have to go into /var/cache/apt/archives and do the same thing. I'm fairly new to linux so if this breaks anything i am sorry. i haven't run into any problems yet that this has caused.

mrcheeks 04-19-2008 10:00 AM

For new users, IMHO it's easier to go on with stable or testing instead of unstable.

spinstartshere 01-25-2009 12:42 PM

Thank you, feral-deb. Your comment helped me with a somewhat chronic problem I was having with a package on Ubuntu.

elaterite 04-18-2009 05:01 PM

feral-deb you're a genius! Thanks!

Trebour 10-03-2009 06:04 PM

Quote:

Originally Posted by feral-deb (Post 3040967)
I had a similar problem and what i found that worked for me was going into /var/lib/dpkg/info and deleting everything that had that name and you may also have to go into /var/cache/apt/archives and do the same thing. I'm fairly new to linux so if this breaks anything i am sorry. i haven't run into any problems yet that this has caused.



Dude you helped me out big time i was tring to install torrentflux-b4rt and got same error after using your clean up help it installed perfectly many thanks :)

riazrahaman 11-11-2009 11:51 PM

Thanks feral-deb, your instructions worked perfectly for me.

evo2 11-12-2009 01:48 AM

Quote:

Originally Posted by feral-deb (Post 3040967)
I had a similar problem and what i found that worked for me was going into /var/lib/dpkg/info and deleting everything that had that name

You deleted the pre and post install scripts. This can very easily mean that the package will not be installed properly, and it won't be removed properly if you choose to uninstall it. It is THE WRONG THING to do.

Using 'apt-get -f install' and/or 'dpkg --configure --pending' are what you should do. If your problems persist, try to read and understand the .postinst script for the problematic package and check for bugs reported against that packge. Failing that, ask for help and/or report a bug.

If you are running sid, you should be prepared to do these sorts of things.
Quote:

and you may also have to go into /var/cache/apt/archives and do the same thing. I'm fairly new to linux so if this breaks anything i am sorry. i haven't run into any problems yet that this has caused.
This is where the .deb files that apt downloads are put, after installation, you can delete them, but you should do it with the command 'apt-get clean'.

Evo2.

euromark 12-26-2009 08:54 AM

i made it worse
 
after having the same problem as stated in the original post i used "feral-deb"s tip to delete those 2 directories
which some time later was rated inappropriate from "evo2" - too late for me...

since then i cannot proceed with "apt-get install" or even the -f force way.
it always halts with the following error code:
Code:

6 not fully removed or installed
...
Setting up libapache2-mod-php5 (5.2.4-2ubuntu5.7) ...
dpkg: error processing libapache2-mod-php5 (--configure):
 subprocess post-installation script returned error exit status 10
Setting up php5-cgi (5.2.4-2ubuntu5.7) ...
dpkg: error processing php5-cgi (--configure):
 subprocess post-installation script returned error exit status 10
dpkg: dependency problems prevent configuration of php5:
 php5 depends on libapache2-mod-php5 (>= 5.2.4-2ubuntu5.7) | php5-cgi (>= 5.2.4-2ubuntu5.7); however:
  Package libapache2-mod-php5 is not configured yet.
  Package php5-cgi is not configured yet.
dpkg: error processing php5 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5-gd:
 php5-gd depends on phpapi-20060613+lfs; however:
  Package phpapi-20060613+lfs is not installed.
  Package libapache2-mod-php5 which provides phpapi-20060613+lfs is not configured yet.
  Package php5-cgi which provides phpapi-20060613+lfs is not configured yet.
dpkg: error processing php5-gd (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php5-mysql:
 php5-mysql depends on phpapi-20060613+lfs; however:
  Package phpapi-20060613+lfs is not installed.
  Package libapache2-mod-php5 which provides phpapi-20060613+lfs is not configured yet.
  Package php5-cgi which provides phpapi-20060613+lfs is not configured yet.
dpkg: error processing php5-mysql (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of phpmyadmin:
 phpmyadmin depends on libapache2-mod-php5 | libapache-mod-php5 | php5-cgi | php5 | libapache2-mod-php4 | libapache-mod-php4 | php4 | php4-cgi; however:
  Package libapache2-mod-php5 is not configured yet.
  Package libapache-mod-php5 is not installed.
  Package php5-cgi is not configured yet.
  Package php5 is not configured yet.
  Package libapache2-mod-php4 is not installed.
  Package libapache-mod-php4 is not installed.
  Package php4 is not installed.
  Package php4-cgi is not installed.
 phpmyadmin depends on php5-mysql | php5-mysqli | php4-mysql; however:
  Package php5-mysql is not configured yet.
  Package php5-mysqli is not installed.
  Package php4-mysql is not installed.
dpkg: error processing phpmyadmin (--configure):
 dependency problems - leaving unconfigured
...
Errors were encountered while processing:
 libapache2-mod-php5
 php5-cgi
 php5
 php5-gd
 php5-mysql
 phpmyadmin
Sub-process /usr/bin/dpkg returned an error code (1)

no matter what i try to do

dpkg --configure --pending
does not work either
i am stuck

evo2 12-27-2009 06:28 PM

Hi,

ok, first off '-f' does not mean "force" it is "fix broken". As for deleting files: deleteing files in /var/cache/apt/archives should not be a problem. Deleting things in /var/lib/dpkg/info on the other hand could be, however I'm assuming you did not delete everything, just the scripts for some specific packages.

Anyway it seems that the problematic packages are all non critical apache related. You may simply be able to remove them and reinstall them. If this approach seems ok to you then please try:

Code:

sudo dpkg --remove libapache2-mod-php5 phpapi-20060613+lfs php5-cgi php5-gd php5-mysql phpmyadmin
Try experimenting with the list of packages to remove, until everything looks sane and 'dpkg --audit' returns nothing.

Evo2.

euromark 12-28-2009 10:32 AM

as this server is productive right now (running a little website) i might have to wait for the weekend here
i guess reinstalling those packages will make the website unavailable for a while :)
i was hoping on a fix that would enable me to just update the existing packages. but after screwing up by deleting the complete content of /var/lib/dpkg/info i probably will have to take your advice.


All times are GMT -5. The time now is 01:07 AM.