package selinux 1:0.3 failed to install/upgrade: subprocess pre-removal script returned error exit status 127

Bug #330286 reported by Parent5446
62
This bug affects 11 people
Affects Status Importance Assigned to Milestone
selinux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: selinux

It seems that if GRUB is upgrade to GRUB2, it attempts to remove selinux as it is a conflicting dependency or something like that. Either way, it fails with the following output:

Removing selinux ...
/var/lib/dpkg/info/selinux.prerm: 55: /etc/init.d/selinux: not found
dpkg: error processing selinux (--remove):
 subprocess pre-removal script returned error exit status 127
Errors were encountered while processing:
 selinux
E: Sub-process /usr/bin/dpkg returned an error code (1)

Other than the error itself there are no problems that seem to be caused by this, but it seems very strange. Here is the the information apt-cache can give me:

selinux:
  Installed: 1:0.3
  Candidate: 1:0.3
  Version table:
 *** 1:0.3 0
        500 http://us.archive.ubuntu.com jaunty/universe Packages
        100 /var/lib/dpkg/status

ProblemType: Package
Architecture: i386
DistroRelease: Ubuntu 9.04
ErrorMessage: subprocess pre-removal script returned error exit status 127
Package: selinux 1:0.3
PackageArchitecture: all
SourcePackage: selinux
Title: package selinux 1:0.3 failed to install/upgrade: subprocess pre-removal script returned error exit status 127
Uname: Linux 2.6.28-6-generic i686

Revision history for this message
Parent5446 (parent5446) wrote :
Revision history for this message
userdce (userdce) wrote :

sudo apt-get remove selinux
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  python-sepolgen python-selinux python-semanage checkpolicy selinux-utils
  libustr-1.0-1 libsemanage1 policycoreutils
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  selinux
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 127kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 401205 files and directories currently installed.)
Removing selinux ...
/var/lib/dpkg/info/selinux.prerm: 55: /etc/init.d/selinux: not found
dpkg: error processing selinux (--remove):
 subprocess installed pre-removal script returned error exit status 127
Errors were encountered while processing:
 selinux
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Stefan Leitner (s-o-l) wrote :

This also happens with selinux 1:0.4

Revision history for this message
Jason Hollis (codebleu) wrote :

This also happens with selinux 1.0.6 and 1.0.9

Revision history for this message
ronin (pgarciab) wrote :

Hi all

A workaround for fixing this problem (it worked for my Jaunty and selinux 1.0.4) is:

1.- Boot from liveCD, mount root partition in hard disk and delete /selinux and /etc/selinux (I got the idea from http://ubuntuforums.org/archive/index.php/t-1063667.html)

2.- After that, I realized that the problem was still the same (the same output that in #2), so I suppose that the last action wasn't relevant. Be free to do it or don't...

3.- then I tried to create the file generating the error...

madcat@chispita:~$ sudo touch /etc/init.d/selinux

4.-...And change the permissions:

madcat@chispita:~$ sudo chmod 0777 /etc/init.d/selinux

5.- And then...

madcat@chispita:~$ sudo dpkg --force-remove-reinstreq -r selinux

And that was all...

Hope this can help to someone, but in any case the bug is still on.

Best regards.

Revision history for this message
andrey_campbell (andreycampbell) wrote :

Thanks, it helped me. Anyone should stay away from SELinux on Ubuntu as it's not well supported and you'll be in for a major headache.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in selinux (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.