Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manage RPM Dependencies and Installation

Status
Not open for further replies.

gwinn7

Programmer
Feb 10, 2001
1,004
US
I have noticed that it can be quite a tedious frustrating task to install several RPMs on a system. The frustration comes when you want to install a particular feature, but you don't know exactly which RPM's you need and what corresponding dependencies are.

Being still new to Linux, I am wondering if there is a better way of being able to know which RPMs to install for any feature. For example: If I wanted to install the developer tools so I could compile a binary from source, how could I easily derive what I needed for this?

I would rather know exactly, than guess by their names.

Thanks,
Gary
gwinn7
 
Hello ;-)
I am a new user of linux (RedHat) and i was wondring for the same question as you.

I have recently creat a shell script that list all the packages (*.rpm) from RedHat's CD to a file that you have to give it a name (exemple cd1_package.txt)

Stopping blabla here is my code :
-----------------------------------------------
#!/bin/bash
if [ "$1" = "" ]
then
echo -e "!!!! He give me the path to your packages !!!!"
exit 0
else
chemin=$1
fi

if [ "$2" = "" ]
then
echo -e "The list of the packages is stored in the file : /tmp/packages_cd.txt"
FILE=/tmp/packages_cd.txt
else
FILE=$2
fi

for i in $(ls $chemin)
do
size=`du -h $chemin$i | awk '{print $1}'`
echo "************************************************************"|tee -a $FILE
echo "**Package: $i size=$size"|tee -a $FILE
echo "************************************************************"|tee -a $FILE
rpm -qpl $chemin$i|tee -a $FILE
done
-----------------------------------------

You can name it :"listrpm"
#cd "to listrpm's directory"
#chmod +x listrpm (to make it executable)
#mount -t iso9660 /dev/hdd /mnt/cdrom (hdd=your cdrom/ & /mnt/cdrom must exist)
#./lisrpm /mnt/cdrom/RedHat/RPMS/ /tmp/cd1_rdh_packages.txt

Et Voila ! the file /tmp/cd1_rdh_packages.txt contain all the packages from the cd "Name of package+all its files"

hope this will help ;-)

NB: You must change the ending format of the line (with vi for exemple) because windows and linux do not use the same ending line caracter !
 
Thanks! I will try it.

Gary
gwinn7
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top