Skip to content

B. Installation in Ubuntu Linux

Bill Fitzgerald edited this page Jan 29, 2022 · 1 revision

Trapper Keeper was developed on Ubuntu 20.04, and these instructions are specifically for Ubuntu. They should work as written for other Debian-based systems systems. The precise details will vary on non-Debian systems but the process should be pretty similar across other Linux variants.

0. Get everything up to date

  • sudo apt update
  • sudo apt -y upgrade

1. Check Python Version

There are many useful tutorials on installing Python on Linux. I have found the Digital Ocean documentation to be useful over the years. It reads cleanly, provides enough details for beginners to get started, and enough extra information for people to learn more if they are interested. The documentation on this page is all you need to get started, but the Digital Ocean documentation contains additional details for those who are interested.

Ubuntu 20.04 ships with Python 3.8 installed. To check the version, run:

python3 -V

This should return a version of 3.8.x; Trapper Keeper requires 3.6 or greater, so we're all set.

If you absolutely must have the latest/greatest version of Python, you can use Deadsnakes. For Trapper Keeper, it's not necessary.

Install some additional tooling for Python: sudo apt install -y build-essential libssl-dev libffi-dev python3-dev

Install pip: sudo apt install -y python3-pip

2. Get dependencies

Depending on your system setup you might need to preface these commands with sudo.

  • Ghostscript: apt install ghostscript
  • ImageMagick: apt install imagemagick
  • OCRMyPDF: apt install ocrmypdf

Trapper Keeper requires Geckodriver to run.

  • Download the latest version of Geckodriver: https://github.com/mozilla/geckodriver/releases - Generally, you will want the version with linux64 in the filename.
  • Extract the downloaded file.
  • Make it executable: chmod +x geckodriver
  • Move it into a directory that is on your PATH

To see the locations currently on your PATH, use: echo $PATH

In most cases, you will see at least one of these two directories: /home/USERNAME/.local/bin or usr/local/bin.

If you are working on a computer where you are the only user and the computer only has one login, then /home/USERNAME/.local/bin will work as a location. Putting the geckodriver in usr/local/bin could provide more flexibility over time.

PATH is one of many "environment variables" - the Ubuntu wiki gives more information about them: https://help.ubuntu.com/community/EnvironmentVariables

3. Create a Project Directory and a Virtual Environment

Install venv - this allows you to create virtual environments for different projects using Python.

  • sudo apt install -y python3-venv

In this documentation, you will create a project in your Documents directory.

  • cd ~/Documents
  • mkdir python-projects
  • cd python-projects
  • mkdir trap_keep
  • cd trap_keep

Now that you have created a directory at ~/Documents/python-projects/trap_keep you can create the virtual environment for the project.

  • python3 -m venv venv
  • source venv/bin/activate

4. Finish Up!

  • git clone https://github.com/billfitzgerald/trapper-keeper.git
  • cd trapper-keeper/
  • pip install -r requirements.txt

You are now ready to archive some urls!