Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

rhel3, rpm not working

SOLVED
Go to solution
Dan_394
Advisor

rhel3, rpm not working

Hi

Hope someone can help. Basically when I run the following:

rpm -Uvh hpasm-7.3.0c-67.rhel3.i386.rpm

I get:

[root@zircon root]# rpm -Uvh hpasm-7.3.0c-67.rhel3.i386.rpm
Preparing... ########################################### [100%]
This release of hpasm cannot be installed because it
will conflict with a package already installed.
Please remove the current hpasm or cpqhealth that
is installed before upgrading to this release.
Use 'rpm -e' to remove the old package.
error: %pre(hpasm-7.3.0c-67.rhel3) scriptlet failed, exit status 1
error: install: %pre scriptlet failed (2), skipping hpasm-7.3.0c-67.rhel3


I haven't installed any hp related tools on this server. This is the first rpm. So I don't know whats happening. Any ideas why the scriptlet is failing?

Many Thanks
Dan
8 REPLIES
Hoefnix
Honored Contributor

Re: rhel3, rpm not working

Dan,

If you did not install hpasm on this system why did you use the upgrade command instead of:
rpm -ivh hpasm-7.3.0c-67.rhel3.i386.rpm

That should install it.

Otherwise check using:
rpm -qva | grep -i hpasm

If this is not resulting in any hpasm rpm installed then you can alway's use the force option of rpm (but you have to very sure if you do not introduce conflicts!)

rpm -ihv --force hpasm-7.3.0c-67.rhel3.i386.rpm

HTH,
Peter
Dan_394
Advisor

Re: rhel3, rpm not working

Thanks for the reply.

I used "-Uvh" instead of "ivh" out of force of habit. the "U" option will still install the package if it doesn't exist. I tried with the "i" option and got the same scriplet error.

I tried using force already. But it still failed with the scriptlet error. The only way to get it to install is by using the "--noscripts" option. Now this is dangerous because it obviously will not run certain necessary scripts.

There must be some sort of bug in the rpm. I don't even know what it is checking against to come to the conclusion about there being an existing installation.

Any ideas

Thanks in advance
Dan
Alexander Chuzhoy
Honored Contributor

Re: rhel3, rpm not working

use the command:
rpm -qlp path/packagename
this will give you all the files installed by this package with their path.
Veryfy non-existance of each file.
If some file does exist-use
rpm -qf path/file
This will give you the name of conflicting package.
remove that conflicting package with:
rpm -e packagename
And then you'll be able to install your new package without errors/warnings.

I think that if you use:
rpm -Uvh --force --nodeps packagename
when installing the package,the installation also won't prompt.
Best regards.
Rajesh SB
Esteemed Contributor

Re: rhel3, rpm not working

Hi,

First remove the old package hpasm using

# rpm -e --noscripts

Then you carry out the installation.

REgards,
Rajesh
Gopi Sekar
Honored Contributor
Solution

Re: rhel3, rpm not working


first try 'rpm -qa|grep hpasm' see whether it returns any package name, if so try removing it and install the new package.

if nothing is listed, retrieve the pre-install script from the rpm by 'rpm -qp --scripts ' paste the screen output (it will give scripts) here and let us take a look at it for possible bug.

Hope this helps,
Gopi
Never Never Never Giveup
Dan_394
Advisor

Re: rhel3, rpm not working

Hi

Thanks for all the replies, but unfortunately none of them have worked. They keep giving the scriplets error.

Here's the output of:

rpm -qp --scripts hpasm-7.3.0c-67.rhel3.i386.rpm
preinstall scriptlet (using /bin/sh):

#Upgrade - stop everything
if [ "$1" = "2" ]; then
if [ -x /opt/compaq/hpasm/etc/hpasm ]; then
#silentstop takes everything down (even other dependent services NOT contained in package)
# Do the silent stop feature first
sh /opt/compaq/hpasm/etc/hpasm silentstop
if [ $? -ne 0 ]; then
# If this did not work, go for the regular stop
sh /opt/compaq/hpasm/etc/hpasm stop
fi
# No unconfigure necessary, since we will reconfigure anyway
fi
fi

# Make some directories
if [ ! -d /var/spool/compaq/foundation/registry ]; then
mkdir -p /var/spool/compaq/foundation/registry
chmod 700 /var/spool/compaq
chmod 700 /var/spool/compaq/foundation
chmod 700 /var/spool/compaq/foundation/registry
fi
if [ ! -d /var/spool/compaq/server/registry ]; then
mkdir -p /var/spool/compaq/server/registry
chmod 700 /var/spool/compaq
chmod 700 /var/spool/compaq/server
chmod 700 /var/spool/compaq/server/registry
fi
#Debian does not have this directory predefined.
if [ ! -d /var/lock/subsys ]; then
mkdir -p /var/lock/subsys
chmod 700 /var/lock/subsys
fi

# group add hpsmh - this is for cleansweep
if [ ! -z `egrep "^hpsmh" /etc/group | grep -v ":79:"` ]; then
groupdel hpsmh > /dev/null 2> /dev/null
fi
if [ -z `egrep "^hpsmh" /etc/group` ]; then
groupadd -g 79 hpsmh > /dev/null 2> /dev/null
fi
#user add hpsmh - for cleansweep
if [ ! -z `egrep "^hpsmh" /etc/passwd| grep -v ":79:"` ]; then
userdel hpsmh > /dev/null 2> /dev/null
fi
if [ -z `egrep "^hpsmh" /etc/passwd` ]; then
useradd -u 79 -g 79 -s /sbin/nologin -M -r -d /opt/hp/hpsmh hpsmh > /dev/null 2> /dev/null
fi

#Legacy Maintenance

#Old hpasm or cpqhealth
if [ -d /opt/compaq/cpqhealth ]; then
echo "This release of hpasm cannot be installed because it"
echo "will conflict with a package already installed."
echo "Please remove the current hpasm or cpqhealth that"
echo "is installed before upgrading to this release."
echo "Use 'rpm -e' to remove the old package."
exit 1
fi

#Old Foundation
if [ -f /etc/init.d/cmafdtn ]; then
echo "This release of cmafdtn cannot be upgraded."
echo "Please remove the installed 'cmafdtn' RPM before upgrading"
echo "to this release. Use 'rpm -e cmafdtn' to remove."
echo "You may also want to remove the cmaX enabled snmp stack and"
echo "reinstall the standard snmp package from your Linux distribution."
exit 1
fi

#Old Server
if [ -f /etc/init.d/cmasvr ]; then
echo "This release of cmasvr cannot be upgraded."
echo "Please remove the installed 'cmasvr' RPM before upgrading"
echo "to this release. Use 'rpm -e cmasvr' to remove."
echo "You may also want to remove the cmaX enabled snmp stack and"
echo "reinstall the standard snmp package from your Linux distribution."
exit 1
fi

#Old Storage
if [ -f /etc/init.d/cmastor ]; then
echo "This release of cmastor cannot be upgraded."
echo "Please remove the installed 'cmastor' RPM before upgrading"
echo "to this release. Use 'rpm -e cmastor' to remove."
echo "You may also want to remove the cmaX enabled snmp stack and"
echo "reinstall the standard snmp package from your Linux distribution."
exit 1
fi

#TODO: Old Nic agents

#
# We need to clean up from previously installed versions which
# did not delete all instances of the driver
#

for OS_VER in `ls -d /lib/modules/*`; do
#Now wipe all occurences of cpqhealth and cpqrom in the current directory.
rm -f $OS_VER/misc/cpqhealth.o
rm -f $OS_VER/misc/cpqrom.o
rm -f $OS_VER/kernel/drivers/char/cpqhealth.o
rm -f $OS_VER/kernel/drivers/char/cpqrom.o
done;

CPQASM=`/sbin/lsmod |fgrep cpqasm`
if [ ${#CPQASM} -ne 0 ]; then
echo "WARNING! Not able to stop the cpqasm device driver!"
exit 1
fi


#
# RPM Upgrade may be in process. We need to clean up a bit
#
if [ -f /sbin/cpqimlview ]; then
echo "Starting hpasm package Upgrade. . ."
rm -f /lib/modules/Compaq/drivers/up/cpqasm.o
rm -f /lib/modules/Compaq/drivers/smp/cpqasm.o
rm -f /lib/modules/Compaq/drivers/ent/cpqasm.o
rm -f /opt/compaq/cpqhealth/cpqasm/casmw_linux.o
rm -f /sbin/cpqimlview
rm -f /sbin/cpqimlview.tcl
rm -f /sbin/imlbe
rm -f /sbin/hpimlview
rm -f /usr/share/pixmaps/compred.xbm
rm -f /usr/share/pixmaps/hplogo.xbm
rm -f /usr/share/pixmaps/m_blue.gif
rm -f /usr/share/pixmaps/m_fail.gif
rm -f /usr/share/pixmaps/m_green.gif
rm -f /usr/share/pixmaps/m_red.gif
rm -f /usr/share/pixmaps/m_yellow.gif
for NODE in \
casm casr cecc ccsm cmca cside cevt cpci cdt cpqw crom cwell cpqevt
do
rm -f /dev/$NODE
rm -f /dev/cpqhealth/$NODE
done
rm -f /lib/modules/Compaq/drivers/up/cpqevt.o
rm -f /lib/modules/Compaq/drivers/smp/cpqevt.o
rm -f /lib/modules/Compaq/drivers/ent/cpqevt.o
rm -f /opt/compaq/cpqhealth/cpqevt/cpqevtw_linux.o
rm -rf /opt/compaq/cpqhealth
fi

#remove old cmhp driver
if [ -d /opt/compaq/cmhp ]; then
rm -rf /opt/compaq/cmhp
fi
postinstall scriptlet (using /bin/sh):
sync
#
# We might be upgrading which in that case, we really do
# not want to do this.
#
if [ $1 -eq 2 ]; then
echo "Completing hpasm package Upgrade. . ."
#silentstop takes everything down (even other dependent services NOT contained in package)
sh /opt/compaq/hpasm/etc/hpasm silentstop
fi

#
# Display EULA for Source Modules
#
echo "Please read the Licence Agreement for this software at"
echo
echo " /opt/compaq/hpasm/hpasm.license"
echo
echo "By not removing this package, you are accepting the terms"
echo "of the \"License for HP Value Added Software\"."

#This gives us a chance to override EVs etc.
if [ -f /etc/hpasmrc ]; then
source /etc/hpasmrc
fi

# Soft link the script to /sbin
ln -sf /opt/compaq/hpasm/etc/hpasm /sbin/hpasm


STARTUP=""
CMASILENT="`echo $CMASILENT | tr "\""[a-z]"\"" "\""[A-Z]"\""`"
CMAFDTNSILENT="`echo $CMAFDTNSILENT | tr "\""[a-z]"\"" "\""[A-Z]"\""`"
if [ "$CMASILENT" = "YES" -o "$CMAFDTNSILENT" = "YES" ]; then
STARTUP=`uname -r | egrep "$CMAKERNELVERSION"`
fi
#construct distro.txt
DISTRO="Unknown"
RELEASE="Unknown"
PRODUCT="Unknown"
if [ -f /etc/SuSE-release ]; then
DISTRO="SuSE"
RELEASE=`cat /etc/SuSE-release | grep VERSION | cut -d' ' -f3`
PRODUCT=`head -n1 /etc/SuSE-release | tr ' ' '\n' | grep -e 'Enterprise' -e 'SLES'`
if [ "$PRODUCT" = "Enterprise" ]; then
PRODUCT="$PRODUCT Server"
fi
elif [ -f /etc/redhat-release ]; then
DISTRO="Red Hat"
RELEASE=`head -n1 /etc/redhat-release | tr ' ' '\n' | egrep -A 1 '[Rr]elease' | tail -n 1`
PRODUCT=`head -n1 /etc/redhat-release | tr ' ' '\n' | grep -e 'Enterprise' -e 'Advanced' -e 'Work'`
if [ "$PRODUCT" = "Enterprise" -o "$PRODUCT" = "Advanced" ]; then
PRODUCT="$PRODUCT Server"
elif [ "$PRODUCT" = "Work" ]; then
PRODUCT="Workstation Edition"
else
PRODUCT="Professional"
fi
elif [ -f /etc/debian_version ]; then
DISTRO="Debian"
RELEASE=`cat /etc/debian_version`
PRODUCT=""
elif [ -f /etc/UnitedLinux-release ]; then
DISTRO="UnitedLinux"
RELEASE=`cat /etc/UnitedLinux-release | grep VERSION | cut -d' ' -f3`
PRODUCT=""
elif [ -d /etc/vmware ]; then
# this could be a VMware Box
DISTRO="VMware"
RELEASE=`cat /etc/issue | grep -e '^VMware' | tr ' ' '\n' | grep -e '^[0-9]'`
PRODUCT="ESX Server"
fi

echo "$DISTRO:$PRODUCT:$RELEASE" >/opt/compaq/hpasm/distro.txt


RC=0
if [ ! -z "$STARTUP" ]; then

sh /opt/compaq/hpasm/etc/hpasm postinstall
RC=$?
else
echo "=============================================================================="
echo "NOTE: In order to activate the software contained in this package, you must"
echo " type 'hpasm activate' as 'root' user."
echo " You may subsequently reset your agent configuration by typing"
echo " '/etc/init.d/hpasm configure' or '/etc/init.d/hpasm reconfigure'."
echo "=============================================================================="
fi

#build a manifest of files/subdirs that were present in the directories we created
#find /opt/compaq/webagent >> /opt/compaq/hpasm/addon/direntries.txt


if [ $RC -eq 0 ]; then
echo "The hpasm RPM has installed successfully."
touch /var/lock/subsys/hpasm
else
echo "The hpasm RPM installation failed!"
echo "See /opt/compaq/cpqhealth/cpqhealth_boot.log for Health Driver details."
echo "See /var/spool/compaq/cma.log for Agent details."
fi
preuninstall scriptlet (using /bin/sh):
sync
#
# We might be upgrading which in that case, we really do
# not want to do this.
#
if [ $1 -ne 0 -a $1 != "remove" ]; then
[ -f /etc/hpasmrc ] && rm -f /etc/hpasmrc
exit 0
fi

#disable
sh /opt/compaq/hpasm/etc/hpasm preuninstall

#remove soft link
rm -f /sbin/hpasm

#we need to remove temporary files/subdirs that were created
#during the operation of hpasm. This is accomplished
#by marking the "original" files/dirs read-only, but all
#other files/dirs read-write (for other).
#find /opt/compaq/cpqhealth | xargs -l1 chmod o+rw
#find /opt/compaq/webagent | xargs -l1 chmod o+rw
#cat /opt/compaq/hpasm/addon/direntries.txt | xargs -l1 chmod o-w 2> /dev/null > /dev/null
#find /opt/compaq/cpqhealth -perm -002 | xargs -l1 rm -rf
#find /opt/compaq/webagent -perm -002 | xargs -l1 rm -rf

#delete the directory manifest
#rm -f /opt/compaq/hpasm/addon/direntries.txt 2> /dev/null > /dev/null
postuninstall scriptlet (using /bin/sh):

#
# We might be upgrading which in that case, we really do
# not want to do this.
#
if [ $1 -ne 0 -a $1 != "remove" ]; then
# echo "Post hpasm package upgrade. . ."
exit 0
fi


INSTALLLOG=/var/spool/compaq/cma.log

#cmhp uninstall
rm -rf /opt/compaq/cmhp

#storage post uninstall

INARG=$1
INSTALLLOG=/var/spool/compaq/cma.log
INSTMSG="cmastor removal"
REGBASE=/var/spool/compaq/storage
REGDIR=/var/spool/compaq/storage/registry
echo "`date`: $INSTMSG: Entering Post Uninstallation ..." >> $INSTALLLOG
if [ "$INARG" = "0" ]; then
rmdir /opt/compaq/storage/bin 2>/dev/null
rmdir /opt/compaq/storage/etc 2>/dev/null
rmdir /opt/compaq/storage/src 2>/dev/null
rmdir /opt/compaq/storage 2>/dev/null
rmdir /opt/compaq 2>/dev/null
rmdir /opt 2>/dev/null
rm -fr $REGBASE
if [ -d /etc/init.d ]; then
rm -f /etc/init.d/cmastor
elif [ -d /etc/rc.d/init.d ]; then
rm -f /etc/rc.d/init.d/cmastor
fi
fi
echo "`date`: $INSTMSG: Post Uninstallation succeeded!" >> $INSTALLLOG


#server post uninstall
echo "`date`: cmasvr: Entering Post Uninstallation ..." >> $INSTALLLOG
rm -rf /var/spool/compaq/server
rm -rf /opt/compaq/server 2>/dev/null
if [ -d /etc/init.d ]; then
rm -f /etc/init.d/cmasvr
elif [ -d /etc/rc.d/init.d ]; then
rm -f /etc/rc.d/init.d/cmasvr
fi

# foundation postuninstall

echo "`date`: cmafdtn: Entering Post Uninstallation ..." >> $INSTALLLOG
rm -rf /var/spool/compaq/foundation
rm -rf /opt/compaq/foundation 2>/dev/null
if [ -d /etc/init.d ]; then
rm -f /etc/init.d/cmafdtn
elif [ -d /etc/rc.d/init.d ]; then
rm -f /etc/rc.d/init.d/cmafdtn
fi

# webagent install
# rm -rf /opt/compaq/webagent

# hpasmd postuninstall
rm -rf /opt/compaq/hpasmd
rm -f /var/lock/subsys/cpqasm

# hpasm_postuninstall

rm -rf /opt/compaq/hpasm
rm -f /var/lock/subsys/hpasm

# Global cleanup; be careful not to blow away any subdirectory.
rm -f /opt/compaq/* 2> /dev/null
rmdir /opt/compaq 2> /dev/null
rmdir /opt 2> /dev/null
echo "The hpasm package has been removed from this system"

Any ideas?

Many Thanks
Dan
Gopi Sekar
Honored Contributor

Re: rhel3, rpm not working

Your problem is in the following part of the script.

#Old hpasm or cpqhealth
if [ -d /opt/compaq/cpqhealth ]; then
echo "This release of hpasm cannot be installed because it"
echo "will conflict with a package already installed."
echo "Please remove the current hpasm or cpqhealth that"
echo "is installed before upgrading to this release."
echo "Use 'rpm -e' to remove the old package."
exit 1
fi


are you having any old version of hpasm installed in your system? just check 'rpm -qa|grep hpasm' if it does not return any results then remove /opt/compaq/cpqhealth (better move it to some other location if it contains any files or folders). Then do the installation, this time it should go through.

Hope this helps,
Gopi
Never Never Never Giveup
Dan_394
Advisor

Re: rhel3, rpm not working

Hi

Thanks for the script advice. Your a star it worked. I had an rsync running that was copying directories and one of them was the compaq directory. I hadn't realised this and was baffled as to why the rpm wouldn't install.

Thanks everyone for all your help.

Dan