> For the complete documentation index, see [llms.txt](https://blogs.cracksoft.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blogs.cracksoft.in/problems/install-oracle-database-on-kali-linux.md).

# Install Oracle Database on Kali Linux

<figure><img src="/files/3RO1XjBxO5PDUz3hu5xM" alt=""><figcaption></figcaption></figure>

There’s a thrill in making software fit where it wasn’t designed. Picture yourself: a powerful penetration tester running enterprise-grade Oracle on Kali Linux, all within a single system. That’s what you’re about to achieve.

Oracle XE 21c comes as an `.rpm` from Oracle Linux or Red Hat environments. Kali, being Debian-based, uses `.deb`, so—naturally—we need to bridge that gap.

#### Setting the Stage: System Prep and Prerequisites

Open your terminal, take a deep breath, and start with:

```bash
sudo apt update
sudo apt full-upgrade -y
```

This ensures your system has the latest packages, patches, and compatible libraries. Think of it as calibrating your tools before the build.

Next, install the essential tools and dependencies:

```bash
sudo apt install alien libaio1 libaio-dev unixodbc net-tools lsb-rpm libnsl2 -y
```

Each package plays a critical role:

* `alien`: converts the `.rpm` into a `.deb`, essential for Debian compatibility.
* `libaio1`/`libaio-dev`: allows asynchronous IO, used heavily by Oracle for performance.
* `unixodbc`, `net-tools`, `lsb-rpm`, `libnsl2`: support networking, OS binds, and package inspection.

Without these, keepers of Oracle’s magic, the installation will falter.

***

#### Retrieving the Oracle RPM

Head to Oracle’s official download page, log in or create an account, and download:

```
oracle-database-xe-21c-1.0-1.ol7.x86_64.rpm
```

Save it in your home or Downloads folder. This `.rpm` file is our raw material.

***

#### Transforming `.RPM` into `.DEB`

Switch to the directory containing the RPM, and execute:

```bash
cd ~/Downloads
sudo alien -d --scripts oracle-database-xe-21c-1.0-1.ol7.x86_64.rpm
```

This script turns it into:

```
oracle-database-xe-21c_1.0-2_amd64.deb
```

Be patient—this can take several minutes. You’re rewrapping Oracle in Debian format, effectively telling Kali you’re serious.

***

#### Installing Oracle XE on Kali

Now install the newly created `.deb`:

```bash
sudo dpkg -i oracle-database-xe-21c_1.0-2_amd64.deb
```

If you encounter dependency errors, resolve them with:

```bash
sudo apt --fix-broken install
sudo dpkg -i oracle-database-xe-21c_1.0-2_amd64.deb
```

At this point, Oracle XE is installed—but not yet running.

***

#### Bringing Oracle to Life: Configuration

Run the built-in configuration script:

```bash
sudo /etc/init.d/oracle-xe-21c configure
```

You’ll be prompted to:

1. Enter a password for SYS, SYSTEM, PDBADMIN (you might use something like `cracksoft`).
2. Choose a listener port—default 1521 is fine.
3. Decide whether to auto-start XE with the system.
4. Let configuration run—it may take several minutes.

Under the hood, this script:

* Configures the listener via `listener.ora`.
* Initializes the root container and a pluggable database (`XEPDB1`).
* Sets environment variables and system service entries.

***

#### Ensuring Oracle Starts Clean

After config completes, start the service:

```bash
sudo systemctl start oracle-xe-21c
sudo systemctl enable oracle-xe-21c
```

Check listener status:

```bash
lsnrctl status
```

You should see output like:

> Service "XE" has 1 instance(s), Service "XEPDB1" has 1 instance(s) … ([mikedietrichde.com](https://mikedietrichde.com/2021/09/22/oracle-database-21c-xe-express-edition-for-linux/?utm_source=chatgpt.com), [stackoverflow.com](https://stackoverflow.com/questions/73241024/oracle-xe-21c-listener-wont-start?utm_source=chatgpt.com), [oracle.com](https://www.oracle.com/linux/technologies/articles/xe-on-kubuntu.html?utm_source=chatgpt.com), [docs.oracle.com](https://docs.oracle.com/en/database/oracle/oracle-database/21/xeinw/connecting-oracle-database-xe.html?utm_source=chatgpt.com), [youtube.com](https://www.youtube.com/watch?v=SQ0C1Xg7p7A\&utm_source=chatgpt.com))

If errors appear (`TNS-12560`, permission denied), it might be due to missing `$ORACLE_HOME/lib`, incorrect script permissions on `/opt/oracle/...`, or missing groups like `dba`. Use `sudo groupadd dba` and re-add your user to that group, then restart.

***

#### Connecting to Your Database

Set environment variables, typically in `~/.bashrc`:

```bash
export ORACLE_SID=XE
export ORACLE_HOME=/opt/oracle/product/21c/dbhomeXE
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
```

Reload with:

```bash
source ~/.bashrc
```

Then, connect via SQL\*Plus:

```bash
sqlplus sys@localhost:1521/XEPDB1 as sysdba
```

This uses the Easy Connect syntax, specifying the pluggable database `XEPDB1` ([stackoverflow.com](https://stackoverflow.com/questions/73241024/oracle-xe-21c-listener-wont-start?utm_source=chatgpt.com), [docs.oracle.com](https://docs.oracle.com/en/database/oracle/oracle-database/21/xeinw/connecting-oracle-database-xe.html?utm_source=chatgpt.com)).

***

#### Understanding Oracle's Network Config Files

Oracle uses:

* `listener.ora` (server listener settings)
* `tnsnames.ora` (client connection aliases)
* `sqlnet.ora` (client connection order preferences) ([oracle-base.com](https://oracle-base.com/articles/misc/oracle-network-configuration?utm_source=chatgpt.com))

Oracle XE's network directory is typically in a read-only `homes/<unique_home>` subfolder. After install, ensure listener binds to your host:

Edit:

```bash
sudo nano $ORACLE_HOME/network/admin/listener.ora
```

Change `HOST = localhost` to either `0.0.0.0` (listen on all interfaces) or your Kali IP, then reload:

```bash
lsnrctl stop
lsnrctl start
```

This enables remote connections ([oracle-base.com](https://oracle-base.com/articles/misc/oracle-network-configuration?utm_source=chatgpt.com), [gist.github.com](https://gist.github.com/jniltinho/327266096f9a4e6169a806c09e10a039?utm_source=chatgpt.com)).

***

#### Accessing Oracle Remotely and via GUI

You can now connect with tools such as DBeaver or SQL Developer. Easy Connect string:

```
system@<kali-ip>:1521/XEPDB1
```

Inside SQL Developer or DBeaver, use that for host/port/service name ([docs.oracle.com](https://docs.oracle.com/en/database/oracle/oracle-database/21/xeinw/connecting-oracle-database-xe.html?utm_source=chatgpt.com)).

Optionally, add a `tnsnames.ora` entry:

```
XEPDB1 =
 (DESCRIPTION =
   (ADDRESS = (PROTOCOL = TCP)(HOST = <kali-ip>)(PORT = 1521))
   (CONNECT_DATA = (SERVICE_NAME = XEPDB1))
 )
```

***

#### Backup, Shutdown, and Uninstall Paths

To stop entirely:

```bash
sudo systemctl stop oracle-xe-21c
```

Backup a database with:

```bash
expdp system/cracksoft DIRECTORY=DATA_PUMP_DIR DUMPFILE=exp.dmp FULL=Y
```

To uninstall everything:

```bash
sudo systemctl stop oracle-xe-21c
sudo dpkg --purge oracle-database-xe-21c
sudo rm -rf /opt/oracle
sudo rm /etc/init.d/oracle-xe-21c
```

***

#### Pro Tips & Troubleshooting

* If dependencies aren’t found, installing `alien` from source or enabling nonfree/unstable repos may help ([oracle-base.com](https://oracle-base.com/articles/misc/oracle-network-configuration?utm_source=chatgpt.com), [oracle.com](https://www.oracle.com/linux/technologies/articles/xe-on-kubuntu.html?utm_source=chatgpt.com)).
* Listener errors (`TNS-12560`, missing message strings) often stem from incorrect `$ORACLE_HOME/lib` or missing READ/EXEC permissions ([stackoverflow.com](https://stackoverflow.com/questions/73241024/oracle-xe-21c-listener-wont-start?utm_source=chatgpt.com)).
* Want to experiment with multiple PDBs? Use Oracle’s `CREATE PLUGGABLE DATABASE` and edit TNS entries accordingly.

***

#### Final Reflections

With Oracle XE 21c running on Kali, you’re equipped to:

* Test Oracle-specific injections and stored procedure issues.
* Explore security misconfigurations and mimic enterprise setups.
* Use Oracle tools (SQL\*Plus, Data Pump, ODAC) natively.

You’ve bridged a distro divide, rewrote package formats, configured full database services, and opened network access. All within a pentesting environment. That’s the kind of flexibility that makes Kali more than a toolkit—it makes it a canvas.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://blogs.cracksoft.in/problems/install-oracle-database-on-kali-linux.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
