Sometimes a yum/RPM package would get “stuck” and just won’t go away. Actually usually the package is already gone but yum/rpm fails to update it’s internal DB and still thinks it is there.

The error one usually sees in such cases is something like:

Error in PREUN scriptlet in rpm package stlinux23-sh4_uclibc-which
stlinux23-sh4_uclibc-which-2.16-5.sh4_uclibc was supposed to be removed but is not!

So in my case the package stlinux23-sh4_uclibc-which-2.16-5.sh4_uclibc is causing problems, it will be soemthing different in your case

To fix the problem run:

yum --setopt=tsflags=noscripts remove stlinux23-sh4_uclibc-which.sh4_uclibc

You can add more than one package file to the end of the command.

Tagged with:
 

10 Responses to Error in PREUN scriptlet … file was supposed to be removed but is not

  1. Han says:

    That’s not a fix, that’s a workaround.

  2. Kuldeep Kulkarni says:

    Worked fine for me too!

    Thanks 🙂

  3. prass says:

    wow amazing,, thank bro

  4. Hi guys;

    But this procedure remove complete all the rpm with dependencies?, or what is the taks that fix?. I have similar problems but in my case I have like 23 taks inside the rpm and in the task 17/23 fail due a missing folder on the RHEL.

    Any hint to comprobe that all the dependencies are remove!.

    • ench0 says:

      Can you run the command to remove just the problematic package? Besides missing folder sounds like a different type oi problem… and it also seems that you are trying to install somepackage (with dependencies? and one of them is failing?). Here I was talking about UNINSTALLING…

  5. Prashant says:

    Thanks for the solution, it works for me.

  6. Alan says:

    Or just do:
    $ yum clean all

    …also these can help identify the problem:
    package-cleanup --problems
    package-cleanup --dupes

  7. Rakesh says:

    Worked Fine

  8. tahleen says:

    Hi Ench0,

    Thanks for your tips, it works like a charm !

    Have a nice day, be safe 😉

  9. Renee Green says:

    This worked great after trying several other suggestions.
    Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *

Set your Twitter account name in your settings to use the TwitterBar Section.