Thinking Out Loud

March 26, 2020

Query Required RPM Using Text File

Filed under: linux — mdinh @ 12:50 am

There’s request to install 11.2.0.4 database software for RHEL7.

Requirements for Installing Oracle 11.2.0.4 RDBMS on OL7 or RHEL7 64-bit (x86-64) (Doc ID 1962100.1)

binutils-2.23.52.0.1-12.el7.x86_64
compat-libcap1-1.10-3.el7.x86_64
compat-libstdc++-33-3.2.3
gcc-4.8.2-3.el7.x86_64
gcc-c++-4.8.2-3.el7.x86_64
glibc-2.17-36.el7.x86_64
glibc-devel-2.17-36.el7.x86_64
ksh
libaio-0.3.109-9.el7.x86_64
libaio-devel-0.3.109-9.el7.x86_64
libgcc-4.8.2-3.el7.x86_64
libstdc++-4.8.2-3.el7.x86_64
libstdc++-devel-4.8.2-3.el7.x86_64
libXi-1.7.2-1.el7.x86_64
libXtst-1.2.2-1.el7.x86_64
make-3.82-19.el7.x86_64
sysstat-10.1.5-1.el7.x86_64

Create /tmp/req-rpm.txt

[root@ol7-183-rac1 ~]# cat /tmp/req-rpm.txt
binutils
compat-libcap1
compat-libstdc++-33
gcc
gcc-c++
glibc
glibc-devel
ksh
libaio
libaio-devel
libgcc
libstdc++
libstdc++-devel
libXi
libXtst
make
sysstat

Verify required RPM using /tmp/req-rpm.txt

[root@ol7-183-rac1 ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' `awk '{print $1}' /tmp/req-rpm.txt`
binutils-2.27-41.base.0.7.el7_7.3(x86_64)
compat-libcap1-1.10-7.el7(x86_64)
package compat-libstdc++ is not installed
package gcc is not installed
compat-libstdc++-33-3.2.3-72.el7(x86_64)
compat-libstdc++-33-3.2.3-72.el7(i686)
glibc-2.17-292.0.1.el7(x86_64)
glibc-2.17-292.0.1.el7(i686)
glibc-devel-2.17-292.0.1.el7(x86_64)
glibc-devel-2.17-292.0.1.el7(i686)
ksh-20120801-140.0.1.el7_7(x86_64)
libaio-0.3.109-13.el7(x86_64)
libaio-0.3.109-13.el7(i686)
libaio-devel-0.3.109-13.el7(x86_64)
libaio-devel-0.3.109-13.el7(i686)
libgcc-4.8.5-39.0.3.el7(x86_64)
libgcc-4.8.5-39.0.3.el7(i686)
libstdc++-4.8.5-39.0.3.el7(x86_64)
libstdc++-4.8.5-39.0.3.el7(i686)
libstdc++-devel-4.8.5-39.0.3.el7(x86_64)
libstdc++-devel-4.8.5-39.0.3.el7(i686)
libXi-1.7.9-1.el7(x86_64)
libXi-1.7.9-1.el7(i686)
libXtst-1.2.3-1.el7(x86_64)
libXtst-1.2.3-1.el7(i686)
make-3.82-24.el7(x86_64)
sysstat-10.1.5-18.el7_7.1(x86_64)

Find missing RPM.

[root@ol7-183-rac1 ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' `awk '{print $1}' /tmp/req-rpm.txt` | grep not
package gcc is not installed
package gcc-c++ is not installed

Install missing RPM

[root@ol7-183-rac1 ~]# yum -y install gcc gcc-c++

Verify NO MISSING RPM

[root@ol7-183-rac1 ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' `awk '{print $1}' /tmp/req-rpm.txt`
binutils-2.27-41.base.0.7.el7_7.3(x86_64)
compat-libcap1-1.10-7.el7(x86_64)
compat-libstdc++-33-3.2.3-72.el7(x86_64)
compat-libstdc++-33-3.2.3-72.el7(i686)
gcc-4.8.5-39.0.3.el7(x86_64)
gcc-c++-4.8.5-39.0.3.el7(x86_64)
glibc-2.17-292.0.1.el7(x86_64)
glibc-2.17-292.0.1.el7(i686)
glibc-devel-2.17-292.0.1.el7(x86_64)
glibc-devel-2.17-292.0.1.el7(i686)
ksh-20120801-140.0.1.el7_7(x86_64)
libaio-0.3.109-13.el7(x86_64)
libaio-0.3.109-13.el7(i686)
libaio-devel-0.3.109-13.el7(x86_64)
libaio-devel-0.3.109-13.el7(i686)
libgcc-4.8.5-39.0.3.el7(x86_64)
libgcc-4.8.5-39.0.3.el7(i686)
libstdc++-4.8.5-39.0.3.el7(x86_64)
libstdc++-4.8.5-39.0.3.el7(i686)
libstdc++-devel-4.8.5-39.0.3.el7(x86_64)
libstdc++-devel-4.8.5-39.0.3.el7(i686)
libXi-1.7.9-1.el7(x86_64)
libXi-1.7.9-1.el7(i686)
libXtst-1.2.3-1.el7(x86_64)
libXtst-1.2.3-1.el7(i686)
make-3.82-24.el7(x86_64)
sysstat-10.1.5-18.el7_7.1(x86_64)

[root@ol7-183-rac1 ~]# rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n' `awk '{print $1}' /tmp/req-rpm.txt` | grep not
[root@ol7-183-rac1 ~]#

2 Comments »

  1. I like xargs.

    cat /tmp/req-rpm.txt | xargs rpm -q –qf ‘%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n’

    or

    rpm -q –qf ‘%{NAME}-%{VERSION}-%{RELEASE}(%{ARCH})\n’ $(cat /tmp/rpm.txt)

    Comment by zhwsh — April 7, 2020 @ 3:32 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

%d bloggers like this: