Skip to main content

Install|Remove|Upgrade|Re-Install|Verify|Validate Packages using RPM in Linux

Install|Remove|Upgrade|Re-Install|Verify|Validate Packages using RPM in Linux


Installing a Package:

rpm -ivh

rpm -ivh httpd-2.4.6-93.el7.centos.x86_64.rpm

Please note if any dependent package is notinstalled it will fail and you have first install the dependent package.

Uninstalling a Package:

rpm -ev

rpm -ev httpd

Please note this will not remove any dependent package that was installed as part of the "httpd" installation.

Upgrading a Package:

rpm -Uvh

To find out which package need to be upgraded we will use below command and all the packages mentioned in bold would be eligible for upgrade.

yum list installed

I ran the command and found below 2 packages.
tzdata.noarch                      
tzdata-java.noarch 

Note: I have already downloaded the rpm.

Now we will upgrade packages, it will cleanup old version and install new rpm.

[root@lcfs packages]# rpm -Uvh tzdata-2020a-1.el7.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:tzdata-2020a-1.el7               ################################# [ 50%]
Cleaning up / removing...
   2:tzdata-2019c-1.el7               ################################# [100%]


In case there is a dependency problem while upgrade which means it create a deadlock like situation where each package is dependent on other then we can use below option while upgrade which will ignore dependency problem.

rpm -Uvh --nodeps

Freshening a Package:

rpm -F

It works same way as upgrade but the diffrence is that it will only upgrade the packages which are already installed, whereas upgrade will install the package if it is not installed.


Re-Installing a Package:

rpm -ivh --force

[root@lcfs packages]# rpm -ivh --force tzdata-2020a-1.el7.noarch.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:tzdata-2020a-1.el7               ################################# [100%]


Verify Package Attributes:

Attibutes of a files are
S - Size
M - File permission
5 - Checksum
D - Device Number
L - Link Path
U - User ownership
G - Group ownership
T - Last modified Time
C - Capabilities
c - file type


This will help to identify if the files were changed once they were installed.
This information includes file size, file permissions, check sum, device major and minor numbers, link path, user ownership, group ownership, last modify time, and capabilities. Using rpm verify, we can check if files have changed since they were installed. Rpm verify will also show us the file type. This type could be, a configuration file, a documentation file, a ghost file, which is one where the contents were not included in the package itself, a license file, or lastly, a README file.



rpm -V name

 This shows the size has changed, the digest or check sum has changed, and the last modify timestamp has changed. 
[root@lcfs zoneinfo]# rpm -V yum
S.5....T.  c /etc/yum.conf


We can use "v" to get information in detail

[root@lcfs zoneinfo]# rpm -Vv zip
.........    /usr/bin/zip
.........    /usr/bin/zipcloak
.........    /usr/bin/zipnote
.........    /usr/bin/zipsplit
.........    /usr/share/doc/zip-3.0
.........  d /usr/share/doc/zip-3.0/CHANGES
.........  d /usr/share/doc/zip-3.0/LICENSE
.........  d /usr/share/doc/zip-3.0/README
.........  d /usr/share/doc/zip-3.0/README.CR
.........  d /usr/share/doc/zip-3.0/TODO
.........  d /usr/share/doc/zip-3.0/WHATSNEW
.........  d /usr/share/doc/zip-3.0/WHERE
.........  d /usr/share/doc/zip-3.0/algorith.txt
.........  d /usr/share/man/man1/zip.1.gz
.........  d /usr/share/man/man1/zipcloak.1.gz
.........  d /usr/share/man/man1/zipnote.1.gz
.........  d /usr/share/man/man1/zipsplit.1.gz


To verify all files we can use below command. This is a time taking activity

rpm -Va

Validate Package Integrity

It will help validate if the package is not alter or modified or any type of corruption.

Check MD5 checksum

[root@lcfs packages]# rpm -K --nosignature tzdata-java-2020a-1.el7.noarch.rpm
tzdata-java-2020a-1.el7.noarch.rpm: sha1 md5 OK

GPG check

[root@lcfs packages]# rpm -K  tzdata-java-2020a-1.el7.noarch.rpm
tzdata-java-2020a-1.el7.noarch.rpm: rsa sha1 (md5) pgp md5 OK

Check the key information

[root@lcfs packages]# rpm -q gpg-pubkey
gpg-pubkey-f4a80eb5-53a7ff4b

[root@lcfs packages]# rpm -qi gpg-pubkey-f4a80eb5-53a7ff4b
Name        : gpg-pubkey
Version     : f4a80eb5
Release     : 53a7ff4b
Architecture: (none)
Install Date: Thursday 09 April 2020 08:03:16 AM IST
Group       : Public Keys
Size        : 0
License     : pubkey
Signature   : (none)
Source RPM  : (none)
Build Date  : Monday 23 June 2014 03:49:55 PM IST
Build Host  : localhost
Relocations : (not relocatable)
Packager    : CentOS-7 Key (CentOS 7 Official Signing Key)
Summary     : gpg(CentOS-7 Key (CentOS 7 Official Signing Key) )
Description :

Comments

Popular posts from this blog

WebLogic migration to OCI using WDT tool

WebLogic migration to OCI using WDT tool Oracle WebLogic Deploy Tool (WDT) is an open-source project designed to simplify and streamline the management of Oracle WebLogic Server domains. With WDT, you can export configuration and application files from one WebLogic Server domain and import them into another, making it a highly effective tool for tasks like migrating on-premises WebLogic configurations to Oracle Cloud. This blog outlines a detailed step-by-step process for using WDT to migrate WebLogic resources and configurations. Supported WLS versions Why Use WDT for Migration? When moving Oracle WebLogic resources from an on-premises environment to Oracle Cloud (or another WebLogic Server), WDT provides an efficient and reliable approach to: Discover and export domain configurations and application binaries. Create reusable models and archives for deployment in a target domain. Key Pre-Requisites Source System: An Oracle WebLogic Server with pre-configured resources such as: Applica...

How to Validate TDE Wallet Password in Oracle Database

How to Validate TDE Wallet Password in Oracle Database Validating the Transparent Data Encryption (TDE) wallet password is crucial, especially when ensuring that the password is correct without using the OPEN or CLOSE commands in the database. This blog post explains a straightforward method to validate the TDE password using the mkstore utility. Steps to Validate TDE Wallet Password Follow these steps to validate the TDE wallet password: Step 1: Copy the Keystore/Wallet File Navigate to your existing TDE wallet directory. Copy only the ewallet.p12 file to a new directory. If a cwallet.sso file exists, do not copy it . The absence of cwallet.sso ensures that the wallet does not use auto-login, forcing the utility to prompt for the password. Step 2: Validate Using mkstore Use the mkstore utility to check the contents of the wallet file. The mkstore utility will prompt you for the TDE wallet password, allowing you to validate its correctness. Command Syntax To display the conten...

Rename a PDB in Oracle Database Multitenant Architecture in TDE and Non TDE Environment

Rename a PDB in Oracle Database Multitenant Architecture I am sharing a step-by-step guide to help you rename a PDB. This approach uses SQL commands. Without TDE or encryption Wallet Initial Check Check the Current Database Name and Open Mode: SQL > SELECT NAME, OPEN_MODE FROM V$DATABASE; NAME OPEN_MODE --------- -------------------- BEECDB READ WRITE List Current PDBs: SQL > SHOW PDBS; CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 FUAT READ WRITE NO We need to RENAME FUAT to BEE  Steps to Rename the PDB Step 1: Export ORACLE_SID Set the Oracle SID to the Container Database (CDB): export ORACLE_SID=BEECDB Step 2: Verify Target PDB Name Availability If the target PDB name is different from the current PDB name, ensure no service exists with the target PDB name. Run SQL to Check Exi...