libratom / libratom

Python library and supporting utilities to parse and process PST and mbox email sources
https://github.com/libratom/libratom/wiki
MIT License
98 stars 15 forks source link

RHEL / CentOS / Fedora / AlmaLinux / Rocky Linux? #191

Closed rhel-user closed 1 year ago

rhel-user commented 1 year ago

Hello, thank you for your efforts in this project. I have successfully installed libratom on Ubuntu 22.04. I see RedHat based distros are not supported... however, I'm hoping someone out here has been successful in getting this package to work on any Red Hat based server? Or does anyone have have any suggestions it getting it to work. I've tries bring it over from ubuntu, but the python module dependencies eventually led me to abandon that approach.

kamwoods commented 1 year ago

Hi @rhel-user! RHEL distros are definitely supported, we just don't have a writeup for an install. RHEL package management is a bit different than Ubuntu, but it's more or less straightforward once you become familiar with the tools. For the following example (to ensure that nothing is omitted) I have deployed a clean RHEL 9 environment in VirtualBox 7.0. (Also, the following commands all assume you have sudo privileges for your user).

First, log in, open a terminal, and at the prompt (my prompt in these examples is [bcadmin@localhost ~]$, you'll only be typing the things that follow the dollar sign) enter the following:

[bcadmin@localhost ~]$ sudo dnf makecache

This will download and cache metadata for all of your enabled repositories (allowing you to search and download the packages you will require. In RHEL 9, Python 3.9 is included by default, but you will need a few related packages, including pip and devel. To install those, run the following commands:

[bcadmin@localhost ~]$ sudo dnf install python3-pip [bcadmin@localhost ~]$ sudo dnf install python3-devel

replying "y" when prompted for the various installs. Finally, you will need to install some development tools, including a C compiler, so libpff-python-ratom can be built correctly. There are several ways to do this, but the easiest (for this quick run through) is to simply install the Development Tools group in bulk:

[bcadmin@localhost ~]$ sudo dnf group install "Development Tools"

Once you have completed these installations, you can set up a venv in the terminal, activate it, upgrade pip, and install libratom. In this example, I'm simply calling my new venv "venv", but you can call it whatever you like (remembering that you'll need to change the venv in the "source" command to whatever the name of the venv you've created is):

[bcadmin@localhost ~]$ python3 -m venv venv [bcadmin@localhost ~]$ source venv/bin/activate (venv)[bcadmin@localhost ~]$ pip install --upgrade pip (venv)[bcadmin@localhost ~]$ pip install libratom

Everything should build cleanly. Finally, run the ratom tool simply by typing "ratom":

(venv)[bcadmin@localhost ~]$ ratom

You can drop out of the venv at any time by simply typing "deactivate".

Hope this helps! As I mentioned before, these instructions were all verified in a clean freshly installed RHEL 9. If you're using an older version of RHEL, or in an institutional environment where administrative privileges are restricted, I'd suggest reaching out to an admin with these instructions, and they should be able to get the correct packages loaded into the environment.

Screenshot from 2022-10-17 13-48-41

rhel-user commented 1 year ago

KamWoods, fantastic assistance. Thank you very much. Your thorough instructions were exactly what I needed and worked beautifully on my almalinux test server. I really appreciate you taking the time to help me on this, especially your including the tip on venv name as well as the deactivate command.

(venv.ratom) [rhel-user@almalinux ~]$ (venv.ratom) [rhel-user@almalinux ~]$ (venv.ratom) [rhel-user@almalinux ~]$ ratom --version ratom, version 0.6.0 (venv.ratom) [rhel-user@almalinux ~]$ (venv.ratom) [rhel-user@almalinux ~]$ (venv.ratom) [rhel-user@almalinux ~]$ deactivate [rhel-user@almalinus ~]$ [rhel-user@almalinux ~]$ [rhel-user@almalinux ~]$ [rhel-user@almalinux ~]$ cat /etc/redhat-release AlmaLinux release 9.0 (Emerald Puma) [rhel-user@almalinux ~]$ [rhel-user@almalinux ~]$ [rhel-user@almalinux ~]$ python --version Python 3.9.10 [rhel-user@almalinux ~]$ [rhel-user@almalinux ~]$

kamwoods commented 1 year ago

Closing. Simplified version of these instructions now in the README.