Sunday, July 15, 2012

Tip: Remove xen-runtime from kernel-xen repository

Lately I've been messing with Xen.

In the process of using the kernel-xen repository I came across the following situation while attempting to uninstall xen-runtime:
  1. # yum remove xen-runtime
    Loaded plugins: fastestmirror, refresh-packagekit, security
    Setting up Remove Process

    Resolving Dependencies

    --> Running transaction check
    ---> Package xen-runtime.x86_64 0:4.1.2-8.el6 will be erased
    --> Finished Dependency Resolution
    Dependencies Resolved
    ==================================================================
      Package Arch Version Repository Size
    ================================================================== Removing:
      xen-runtime x86_64 4.1.2-8.el6 @kernel-xen 8.0 M

    Transaction Summary
    ==================================================================
    Remove 1 Package(s)

    Installed size: 8.0 M
    Is this ok [y/N]: y
    Downloading Packages:
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
    Error in PREUN scriptlet in rpm package xen-runtime
    xen-runtime-4.1.2-8.el6.x86_64 was supposed to be removed but is not!
      Verifying : xen-runtime-4.1.2-8.el6.x86_64 1/1

    Failed:
      xen-runtime.x86_64 0:4.1.2-8.el6
    Complete!
  2. # rpm -e xen-runtime
    /var/tmp/rpm-tmp.LcPd6z: line 5: /bin/systemctl: No such file or directory
    error: %preun(xen-runtime-4.1.2-8.el6.x86_64) scriptlet failed, exit status 127

To remove the little bastard the --nopreun needs to be passed down to rpm -e. By doing so the execution of the %preun scriptlet is turned off thus allowing rpm to uninstall the offending package, like so:
  1. # rpm -e --nopreun xen-runtime

Done!

Now I can go back to messing with Xen ;)

No comments: