Uploaded image for project: 'CDH (READ-ONLY)'
  1. CDH (READ-ONLY)
  2. DISTRO-302

rpm -e hadoop-hive fails if all alternatives are deleted

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: CDH3u1
    • Fix Version/s: CDH3u2
    • Component/s: Hive, Packaging
    • Labels:
      None

      Description

      When uninstalling hadoop-hive, if, somehow, the alternatives have been blown away, the RPM refuses to uninstall. I recommend changing:

      - alternatives --remove hive-conf /etc/hive/conf.dist
      + alternatives --remove hive-conf /etc/hive/conf.dist || true
      

      I'm not quite sure how the machine I was working with got into that state, but I was able to recover it by re-creating the alternative. The relevant bits of my mucking around are pasted in below.

      [philip@trek23 ~]$ sudo rpm -vv -e hadoop-hive
      D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key
      D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key
      D: loading keyring from rpmdb
      D: opening  db environment /var/lib/rpm cdb:mpool:joinenv
      D: opening  db index       /var/lib/rpm/Packages rdonly mode=0x0
      D: locked   db index       /var/lib/rpm/Packages
      D: opening  db index       /var/lib/rpm/Name rdonly mode=0x0
      D:  read h#     631 Header sanity check: OK
      D: added key gpg-pubkey-0608b895-4bd22942 to keyring
      D: Using legacy gpg-pubkey(s) from rpmdb
      D:  read h#    6131 Header V4 DSA/SHA1 Signature, key ID e8f86acd: NOKEY
      D:  read h#    6131 Header V4 DSA/SHA1 Signature, key ID e8f86acd: NOKEY
      D: ========== --- hadoop-hive-0.7.1+42.4-2 noarch/linux 0x0
      D: opening  db index       /var/lib/rpm/Requirename rdonly mode=0x0
      D: ========== recording tsort relations
      D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
      D:     0    0    0    0    1   -hadoop-hive-0.7.1+42.4-2.noarch
      D: erasing packages
      D: closed   db index       /var/lib/rpm/Requirename
      D: closed   db index       /var/lib/rpm/Name
      D: closed   db index       /var/lib/rpm/Packages
      D: closed   db environment /var/lib/rpm
      D: opening  db environment /var/lib/rpm cdb:mpool:joinenv
      D: opening  db index       /var/lib/rpm/Packages create mode=0x42
      D: sanity checking 1 elements
      D: running pre-transaction scripts
      D: computing 4666 file fingerprints
      D: computing file dispositions
      D: opening  db index       /var/lib/rpm/Basenames create mode=0x42
      D: 0x0000fd00     4096      3677966      1078847 /
      D: ========== +++ hadoop-hive-0.7.1+42.4-2 noarch-linux 0x0
      D:  read h#    6131 Header V4 DSA/SHA1 Signature, key ID e8f86acd: NOKEY
      D:     erase: hadoop-hive-0.7.1+42.4-2 has 4666 files, test = 0
      D: opening  db index       /var/lib/rpm/Name create mode=0x42
      D: opening  db index       /var/lib/rpm/Triggername create mode=0x42
      D:     erase: %preun(hadoop-hive-0.7.1+42.4-2.noarch) scriptlet start
      D:     erase: %preun(hadoop-hive-0.7.1+42.4-2.noarch)   execv(/bin/sh) pid 11515
      + '[' 0 = 0 ']'
      + alternatives --remove hive-conf /etc/hive/conf.dist
      D:     erase: waitpid(11515) rc 11515 status 200 secs 0.002
      error: %preun(hadoop-hive-0.7.1+42.4-2.noarch) scriptlet failed, exit status 2
      D: running post-transaction scripts
      D: closed   db index       /var/lib/rpm/Triggername
      D: closed   db index       /var/lib/rpm/Basenames
      D: closed   db index       /var/lib/rpm/Name
      D: closed   db index       /var/lib/rpm/Packages
      D: closed   db environment /var/lib/rpm
      
      
      
      [philip@trek23 ~]$ sudo alternatives --install / hive-conf / 99
      [philip@trek23 ~]$ sudo alternatives --install / hive-conf /etc/hive/conf.dist 99
      [philip@trek23 ~]$ sudo alternatives --display hive-conf
      hive-conf - status is auto.
       link currently points to /
      / - priority 99
      /etc/hive/conf.dist - priority 99
      Current `best' version is /.
      [philip@trek23 ~]$ sudo alternatives --remove hive-conf /etc/hive/conf.dist || echo hi
      [philip@trek23 ~]$ sudo alternatives --install / hive-conf /etc/hive/conf.dist 99
      [philip@trek23 ~]$ sudo rpm -e hadoop-hive
      [success]
      

        Attachments

          Activity

            People

            • Assignee:
              rvs Roman V Shaposhnik
              Reporter:
              philip Philip Zeyliger
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: