Feb 28, 2012

How to install packages from a text file with YUM

As you known, It is possible to install RPM packages from a text file with rpm command, that command is like this:
#rpm -ivh -f FILE_NAME

The file that contains packages you want to install must satisfy some conditions:

  • package's name is correct

  • packages' separated each other by a (or more) whitespace characters (such as space, carriage return, tab, ...)




But, with YUM you cannot use that syntax to work. If you want to pass package's names to YUM command, you should use this trick:
#yum install $(cat file_name)

There is a different between text file you want to use with RPM and the one for YUM. That is, for YUM command, you shouldn't specify full version of that package as well as the ".rpm" extension. For example, this is my package list must be installed for Oracle DB 11g
compat-libstdc++-33-3.2.3-69
elfutils-libelf
elfutils-libelf-devel
elfutils-libelf-devel-static
glibc
glibc-devel
glibc-common
gcc
gcc-c++
kernel-headers
ksh
libaio
libaio-devel
libgcc
libaio
libaio-devel
libstdc++
libstdc++-devel
unixODBC
unixODBC-devel
sysstat
binutils
make

So, you can list packages you want to install on a text file and reuse that file on future.

Cheers.

DoubtMan

No comments:

Post a Comment