Skip to content

Cleanup a failed Oracle XE installation on Linux Mint

On this Blog I described on how to install Oracle XE on a current Linux Mint version (19.3. Tricia when writing the Blog). After the conversion of the Oracle provided rpm to a deb installation file with the tool alien, you can install the Oracle XE software with a simple command


root@clemens-TravelMate:/opt/distr# dpkg -i oracle-database-xe-18c_1.0-2_amd64.deb

If the installation fails or the XE database cannot be created with the configuration script later on, then you have to be able to remove the software again and do the cleanup on the system. However, this is often not possible that easily with “dpkg -r oracle-database-xe-18c”, because the pre-removal script or post-removal script may fail leaving the deb-repository untouched.

To remove the software you may follow the steps below:

REMARK: It is assumed here that there is no other Oracle installation in the oraInventory.

1.) Make sure the Listener and the XE database is stopped

If there is no other way then you may kill the listener and pmon process with e.g.


root@clemens-TravelMate:~# kill -9 $(ps -ef | grep tnslsnr | grep -v grep | tr -s " " | cut -d " " -f2)
root@clemens-TravelMate:~# kill -9 $(ps -ef | grep pmon | grep -v grep | tr -s " " | cut -d " " -f2)

2.) Skip the pre-removal skript by just putting an “exit 0” at the beginning of it


root@clemens-TravelMate:~# vi /var/lib/dpkg/info/oracle-database-xe-18c.prerm
...
root@clemens-TravelMate:~# head -2 /var/lib/dpkg/info/oracle-database-xe-18c.prerm
#!/bin/bash
exit 0

3.) Remove the Oracle installation


root@clemens-TravelMate:~# rm /etc/oratab /etc/oraInst.loc
root@clemens-TravelMate:~# rm -rf /opt/oracle/*

Remark: Removing the oraInst.loc ensures that the postrm-script /var/lib/dpkg/info/oracle-database-xe-18c.postrm is skipped.

4.) Remove the deb-package


root@clemens-TravelMate:~# dpkg --purge --force-all oracle-database-xe-18c

5.) Cleanup some other files


root@clemens-TravelMate:~# rm -rf /var/tmp/.oracle
root@clemens-TravelMate:~# rm -rf /opt/ORCLfmap/

Done.

Let’s work together

Ready to operate at
the next level?

Tell us about your challenge. We’ll bring the depth, the expertise, and the Swiss precision.

Clemens Bleile

Clemens Bleile

Clemens Bleile has more than 30 years of IT experience, including 13 years in Oracle Support and 15 years in Oracle Consulting. He specializes in Oracle Database performance tuning and highly available, cost-efficient database architecture design. He holds Oracle Certified Professional (11g, 12c) and Oracle Certified Expert for Performance Management and Tuning credentials. Prior to dbi services, he managed the EMEA Database Performance team at Oracle Global Customer Support Services. Clemens holds a Master's degree in Business Information Systems from the Fachhochschule Furtwangen, Germany.View Author posts

68 posts since February 2016

Most read in Oracle

The Oracle posts our readers open most: the all-time favourites, and what is trending right now.

Leave a Comment

Your email address will not be published. Required fields are marked *