No description
  • Go 75.3%
  • HTML 23.7%
  • Shell 0.5%
  • CSS 0.4%
  • Dockerfile 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-04-12 19:49:18 +02:00
.woodpecker Quote manifest pipeline commands 2025-02-13 14:49:10 -08:00
assets Add some hints and improve UI design 2025-02-14 21:02:48 -08:00
internal Add support for Zypper 2025-04-12 19:49:18 +02:00
templates Add hints to Search by Package tab 2025-02-15 18:55:02 -08:00
.gitignore Initial Commit 2025-02-12 19:33:11 -08:00
.nfpm.yaml Create custom CI pipeline 2025-02-13 13:01:20 -08:00
add-icon.sh Fix base directory in add-icon.sh 2025-02-14 19:39:18 -08:00
distrohop.service Fix lack of $HOME in systemd service 2025-02-12 22:55:04 -08:00
distrohop.toml Initial Commit 2025-02-12 19:33:11 -08:00
docker-compose.yml Initial Commit 2025-02-12 19:33:11 -08:00
Dockerfile Create custom CI pipeline 2025-02-13 13:01:20 -08:00
errors.go Initial Commit 2025-02-12 19:33:11 -08:00
go.mod Initial Commit 2025-02-12 19:33:11 -08:00
go.sum Initial Commit 2025-02-12 19:33:11 -08:00
LICENSE Initial Commit 2025-02-12 19:33:11 -08:00
LICENSE-logo Initial Commit 2025-02-12 19:33:11 -08:00
main.go Remove unnecessary condition 2025-02-15 19:07:16 -08:00
README.md Add hosted instance link to README 2025-02-13 22:02:11 +00:00

GitHub go.mod Go version 


DistroHop is a tool that helps you compare Linux packages across different distributions. It lets you search for a package from one distro in another's repositories or look for a specific item you need. You can try it out at hop.lure.sh

How does it work?

Distrohop works by downloading and decoding a file index from each supported repo. It analyzes the information contained in the index to form a generalized list of tags describing the contents of each package, and then stores that list in a database.

When you search for a package from another distro, it resolves the package name to its list of tags, and then searches for any packages that match at least one tag in the other distro's repos. It calculates a confidence score based on how many of the tags match, and then sorts the results by confidence.

Why are some searches so slow?

Each repo can have tens of millions of tags that Distrohop has to churn through. It uses LSM trees and bloom filters to speed the search up as much as possible, and most searches can be measured in milliseconds, but for some searches that contain lots of tags, there may not be any shortcut and DistroHop may have to scan through all or most of the tags stored in the database, which can take a long time.

Installation

You can either install one of the distro packages in the latest Gitea release or the Docker container. This repo contains an example compose file.

The distro packages look for your config file in $XDG_CONFIG_HOME and store data in $XDG_DATA_HOME, or your OS's equivalent.

The container looks for your config file at /distrohop.toml and stores data in /data, so make sure to create volumes for those. You can choose to use environment variables instead of a config file if you'd like. You can see an example docker-compose file here.

Configuration

DistroHop's config file consists of a list of distro repositories. Here's an excerpt from the example config provided in this repo:

[[repo]]
    refresh_schedule = "0 0 * * *" # Every day at 12:00 AM
    name = "debian-bookworm"
    type = "apt"
    base_url = "http://ftp.us.debian.org/debian"
    version = "bookworm"
    repos = ["main", "non-free", "contrib"]
    arch = ["amd64", "all"]
  • refresh_schedule is a crontab string that represents the schedule by which the repo will be updated. All repos will also always be updated on startup. The default for this setting is 0 0 * * *, which means every day at 12:00 AM.
  • name is the name that you'd like DistroHop to reference the repo by.
  • type is one of apt, dnf, or pacman.
  • base_url is the base URL of the repo. For Arch, it accepts variables such as $repo and $arch which will be replaced with the repo/arch value currently being pulled.
  • version is the distro-specific repo version string. For Debian, this is the release codename (buster, bullseye, bookworm, trixie, etc.). Arch doesn't use this variable, so it can be omitted in Arch repos.
  • repos is a list of distro-specific repo names. All Ubuntu versions and Debian versions before Wheezy don't use this, and it should be omitted in those repos to avoid duplicate downloads.
  • arch is a list of distro-specific binary architectures for which indices should be pulled.

There's also a top-level setting outside of any repos called search_threads, which is an integer specifying how many threads should be spawned for database searches. The default is 4.

All the config settings can also be set through environment variables, like this:

DISTROHOP_SEARCH_THREADS=4
DISTROHOP_REPO_0_REFRESH_SCHEDULE="0 0 * * *"
DISTROHOP_REPO_0_NAME="debian-bookworm"
DISTROHOP_REPO_0_TYPE="apt"
DISTROHOP_REPO_0_BASE_URL="http://ftp.us.debian.org/debian"
DISTROHOP_REPO_0_VERSION="bookworm"
DISTROHOP_REPO_0_REPOS="main,non-free,contrib"
DISTROHOP_REPO_0_ARCH="amd64,all"

Attribution

All the icons stored under assets/icons are downloaded from various icon packs on https://iconify.design.