• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Dependency hell

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Shelnutt2

Overclockers Team Content Editor
Joined
Jun 17, 2005
Location
/home/
Yep I've done it, I fell into the pit.

I tried to install a .deb (converted from rpm via alien),
Code:
K-Server:/home/shelnutt/Downloads# dpkg -i gravetat_0.9.1-2_i386.deb
(Reading database ... 290670 files and directories currently installed.)
Preparing to replace gravetat 0.9.1-2 (using gravetat_0.9.1-2_i386.deb) ...
Unpacking replacement gravetat ...
/var/lib/dpkg/info/gravetat.postrm: line 4: fg: no job control
dpkg: warning - old post-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/postrm: line 4: fg: no job control
dpkg: error processing gravetat_0.9.1-2_i386.deb (--install):
 subprocess new post-removal script returned error exit status 1
/var/lib/dpkg/tmp.ci/postrm: line 4: fg: no job control
dpkg: error while cleaning up:
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 gravetat_0.9.1-2_i386.deb

I then tried to convert to a .deb without scripts and then install it but I got this:

Code:
K-Server:/home/shelnutt/Downloads# dpkg -i gravetat_0.9.1-2_i386.deb
(Reading database ... 290670 files and directories currently installed.)
Preparing to replace gravetat 0.9.1-2 (using gravetat_0.9.1-2_i386.deb) ...
Unpacking replacement gravetat ...
/var/lib/dpkg/info/gravetat.postrm: line 4: fg: no job control
dpkg: warning - old post-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
dpkg: error processing gravetat_0.9.1-2_i386.deb (--install):
 there is no script in the new version of the package - giving up
Errors were encountered while processing:


So now anytime I try to use apt-get I receive:
Code:
K-Server:/home/shelnutt/Downloads# apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  module-assistant kbuild python-utidylib libx264-66 libtidy-0.99-0
  python-feedparser libphysfs-1.0-0 python-chardet
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  gravetat
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
1 not fully installed or removed.
After this operation, 438kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 290659 files and directories currently installed.)
Removing gravetat ...
/var/lib/dpkg/info/gravetat.postrm: line 4: fg: no job control
dpkg: error processing gravetat (--remove):
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 gravetat
E: Sub-process /usr/bin/dpkg returned an error code (1)


How do I remove gravetat completely? I don't care about trying to get it installed, if I can get it uninstalled.
 
Code:
sudo apt-get --purge remove gravetat

should purge the program

you can also try aptitude or dkpg if apt doesn't get rid of it
 
Code:
sudo apt-get --purge remove gravetat

should purge the program

you can also try aptitude or dkpg if apt doesn't get rid of it


Code:
K-Server:/home/shelnutt/Downloads# apt-get --purge remove gravetat
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: The package gravetat needs to be reinstalled, but I can't find an archive for it.
K-Server:/home/shelnutt/Downloads# dpkg --remove gravetat
dpkg: error processing gravetat (--remove):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
Errors were encountered while processing:
 gravetat
K-Server:/home/shelnutt/Downloads# dpkg --purge gravetat
dpkg: error processing gravetat (--purge):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
Errors were encountered while processing:
 gravetat
K-Server:/home/shelnutt/Downloads#

No go :-/
 
look in the following directory :

$ cd /var/lib/dpkg/info

Now list files in following format:
packagename.*

$ ls packagename.*

Now open each file and find out line that read as follows:

$ /bin/sh -e

and replace this with

$ /bin/sh

Save and close all the files. Now run apt-get / dpkg command again to remove package:

$ apt-get --purge remove packagename

or

$ dpkg -r packagename

Let me know if that works for you (remember to backup files before making changes to them)
 
Code:
K-Server:/var/lib/dpkg/info# ls packagename
ls: cannot access packagename: No such file or directory
K-Server:/var/lib/dpkg/info# ls | grep packagename
K-Server:/var/lib/dpkg/info# ls |grep grav
gravetat.list
gravetat.md5sums
gravetat.postinst
gravetat.postinst~
gravetat.postrm
gravetat.postrm~

I then did what you said to the two gravetat.postinst and gravetat.postrm and now:

Code:
K-Server:/home/shelnutt/Downloads# dpkg --purge gravetat
(Reading database ... 290659 files and directories currently installed.)
Removing gravetat ...
/var/lib/dpkg/info/gravetat.postrm: line 4: fg: no job control
dpkg: error processing gravetat (--purge):
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 gravetat
 
With no scripts:

Code:
shelnutt@K-Server:~/Downloads$ su -c "alien -d Gravetat-0.9.1-1.i386.rpm"
Password: 
Warning: Skipping conversion of scripts in package Gravetat: postinst postrm
Warning: Use the --scripts parameter to include the scripts.
gravetat_0.9.1-2_i386.deb generated

K-Server:/home/shelnutt/Downloads# dpkg -i gravetat_0.9.1-2_i386.deb
Selecting previously deselected package gravetat.
(Reading database ... 290660 files and directories currently installed.)
Preparing to replace gravetat 0.9.1-2 (using gravetat_0.9.1-2_i386.deb) ...
Unpacking replacement gravetat ...
/var/lib/dpkg/info/gravetat.postrm: line 4: fg: no job control
dpkg: warning - old post-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
dpkg: error processing gravetat_0.9.1-2_i386.deb (--install):
 there is no script in the new version of the package - giving up
Errors were encountered while processing:
 gravetat_0.9.1-2_i386.deb


K-Server:/home/shelnutt/Downloads# dpkg --purge gravetat
(Reading database ... 290659 files and directories currently installed.)
Removing gravetat ...
/var/lib/dpkg/info/gravetat.postrm: line 4: fg: no job control
dpkg: error processing gravetat (--purge):
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 gravetat


K-Server:/home/shelnutt/Downloads# apt-get --purge remove gravetat
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  module-assistant kbuild python-utidylib libx264-66 libtidy-0.99-0
  python-feedparser libphysfs-1.0-0 python-chardet
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  gravetat
0 upgraded, 0 newly installed, 1 to remove and 1024 not upgraded.
1 not fully installed or removed.
After this operation, 438kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 290659 files and directories currently installed.)
Removing gravetat ...
/var/lib/dpkg/info/gravetat.postrm: line 4: fg: no job control
dpkg: error processing gravetat (--remove):
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 gravetat
E: Sub-process /usr/bin/dpkg returned an error code (1)

With scripts:

Code:
shelnutt@K-Server:~/Downloads$ su -c "alien -d --scripts Gravetat-0.9.1-1.i386.rpm"
Password: 
gravetat_0.9.1-2_i386.deb generated


K-Server:/home/shelnutt/Downloads# dpkg -i gravetat_0.9.1-2_i386.deb
Selecting previously deselected package gravetat.
(Reading database ... 290660 files and directories currently installed.)
Preparing to replace gravetat 0.9.1-2 (using gravetat_0.9.1-2_i386.deb) ...
Unpacking replacement gravetat ...
/var/lib/dpkg/info/gravetat.postrm: line 4: fg: no job control
dpkg: warning - old post-removal script returned error exit status 1
dpkg - trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/postrm: line 4: fg: no job control
dpkg: error processing gravetat_0.9.1-2_i386.deb (--install):
 subprocess new post-removal script returned error exit status 1
/var/lib/dpkg/tmp.ci/postrm: line 4: fg: no job control
dpkg: error while cleaning up:
 subprocess post-removal script returned error exit status 1
Errors were encountered while processing:
 gravetat_0.9.1-2_i386.deb


K-Server:/home/shelnutt/Downloads# dpkg --purge gravetat
dpkg: error processing gravetat (--purge):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting a removal.
Errors were encountered while processing:
 gravetat


K-Server:/home/shelnutt/Downloads# apt-get --purge remove gravetat
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: The package gravetat needs to be reinstalled, but I can't find an archive for it.
 
let the scripts use only "/bin/true" as content.

And I really hope you learned your lessen to NEVER EVER use alien to build a .deb. NEVER.
If you must use rpms, make a .tgz from it and install in /usr/local (stow or whatever) or /opt
 
let the scripts use only "/bin/true" as content.

And I really hope you learned your lessen to NEVER EVER use alien to build a .deb. NEVER.
If you must use rpms, make a .tgz from it and install in /usr/local (stow or whatever) or /opt

That worked!

Well I've converted a few before with alien and never ran into an issue. I'll be much more careful from now on.

I just need to get back to gentoo.
 
Back