# Installing Purple Pen on Linux

## The short version

Download the `.deb` or `.rpm` from <https://purple-pen.org> and install it. That is all
there is to it — the package sets up this repository on its own, so from then on
Purple Pen updates along with the rest of your system.

A package built from a prerelease subscribes you to prereleases *and* releases,
so you are offered the stable version as soon as it appears. A package built
from a release subscribes you to releases only.

The file the package writes is
`/etc/apt/sources.list.d/purplepen.sources` (apt) or
`/etc/yum.repos.d/purplepen.repo` (dnf). Its first line says it is managed
by the package. Delete that line and the package will never touch the file
again, leaving it yours to edit. To keep the file but stop following the
repository, set `Enabled: no` or `enabled=0` instead.

Everything here is signed with this key:

    D81754596CF4B29FFC7857CCC31F595BE2DCC2DA

The rest of this page is for setting the repository up by hand.

## By hand: Debian, Ubuntu, Mint and other apt systems

```bash
sudo install -d -m 0755 /etc/apt/keyrings
sudo curl -fsSL https://downloads.purple-pen.org/linux/purplepen-archive-keyring.gpg \
    -o /etc/apt/keyrings/purplepen-archive-keyring.gpg
sudo tee /etc/apt/sources.list.d/purplepen.sources <<'SOURCES'
Types: deb
URIs: https://downloads.purple-pen.org/linux/deb
Suites: stable
Components: main
Enabled: yes
Signed-By: /etc/apt/keyrings/purplepen-archive-keyring.gpg
SOURCES
sudo apt update
sudo apt install purplepen
```

If `curl` is not installed, use `wget -qO` in its place.

This is the same path and the same format the package writes, so installing a
Purple Pen package later will not leave you with two entries for one
repository. It will not overwrite this file either: what you write here has no
"managed by the package" marker on its first line, so the package treats it as
yours and leaves it alone. The trade-off is that it also will not follow you
onto the beta channel or off it — that stays your job.

The dearmored `.gpg` key is used rather than the armored `.asc` because apt
older than 2.4 — Debian 11, Ubuntu 20.04 and earlier — cannot read the armored
form. Newer apt accepts either.

### Prereleases

Add `beta` to the `Suites:` line rather than replacing
`stable`, so the stable release is still offered when it appears:

```
Suites: beta stable
```

## By hand: Fedora, RHEL, openSUSE and other dnf systems

```bash
sudo dnf config-manager --add-repo https://downloads.purple-pen.org/linux/rpm/purplepen.repo
sudo dnf install purplepen
```

On dnf5 — Fedora 41 and later — the first command is spelled:

```bash
sudo dnf config-manager addrepo --from-repofile=https://downloads.purple-pen.org/linux/rpm/purplepen.repo
```

The first install asks you to confirm the signing key; check that the
fingerprint it shows matches the one above.

### Prereleases

The beta repository is installed but disabled. Enable it with:

```bash
sudo dnf config-manager --set-enabled purplepen-beta
```

## Removing the repository

Uninstalling Purple Pen takes the repository configuration with it. To remove
it while keeping the application:

```bash
sudo rm /etc/apt/sources.list.d/purplepen.sources /etc/apt/keyrings/purplepen-archive-keyring.gpg      # apt
sudo rm /etc/yum.repos.d/purplepen.repo               # dnf
```

## Other formats

Purple Pen is also distributed as an AppImage, which needs no repository and
no installation — download it, make it executable and run it:

- <https://downloads.purple-pen.org/linux/appimage/x64/PurplePen-4.0.0-beta2-linux-x64.AppImage>

It configures nothing, and neither apt nor dnf knows anything about it. It stays
up to date on its own instead: Purple Pen notices that a newer AppImage has
been published and replaces its own file with it.
