A shell script that checks and automatically installs the RPM required by oralce

Source: Internet
Author: User

When installing oralce in Linux, you must first check whether one pair of RPM has been installed. If you check them one by one each time, it will be very troublesome, so a script is simplified.

This script takes only three steps:

1) Save the following shell script as orarpm. Sh. In this article, put the file in the home directory:

#! /Bin/bash </P> <p> If [$ #-ne 1]; then <br/> echo "Usage: $0 rpmlist "<br/> Exit 1 <br/> fi </P> <p> rpmlist = $1 <br/> errfile = ~ /Rpminst 'date + % Y % m % d % H % m % s '. err <br/> for PKG in 'cat $ rpmlist' <br/> DO <br/> rpm-Qa | grep $ PKG &>/dev/null <br/> If [$? -Ne 0]; then <br/> echo $ PKG is not installed yet, starting to install... <br/> rpm-uvh $ PKG * 2> $ errfile <br/> else <br/> echo $ PKG already installed. <br/> fi <br/> done

2) In the Oracle Installation documentation, find the RPM list to be checked and copy it to save it as a file. Here I use PKG. lst:
Binutils-2.17.50.0.6 <br/> compat-libstdc ++-33-3.2.3 <br/> elfutils-libelf-0.125 <br/> elfutils-libelf-devel-0.125 <br/> elfutils-libelf-devel-static-0.125 <br/> gcc-4.1.2 <br/> gcc-C + +-4.1.2 <br/> glibc-2.5-24 <br/> glibc-common-2.5 <br/> glibc-devel-2.5 <br/> glibc-headers-2.5 <br/> kernel-headers-2.6.18 <br/> ksh-20060214 <br/>/> libaio-0.3.106 <br/> libaio-devel-0.3.106 <br/> libgcc-4.1.2 <br/> libgomp-4.1.2 <br/> libstdc ++-4.1.2 <br/> libstdc ++-devel-4.1.2 <br/> make -3.81 <br/> sysstat-7.0.2 <br/> unixODBC-2.2.11 <br/> unixODBC-devel-2.2.11

3) switch to the RPM directory of the CD and run the following command to automatically check and install the RPM package.

If the script fails to be automatically installed, you only need to check the rpminst *. Err file in the home directory after the script is executed, and then manually install the failed package.
~ /Orarpm. Sh ~ /PKG. lst

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.