Installing Celestia without apt-key on Debian-based GNU/Linux distros

Nelson Aloysio
2 min readJan 28, 2022
Figure: Celestia application image.

This guide was written with Celestia in mind, but will work for any other software which depends on adding a repository key to Debian-based distros.

Celestia is a well known open-source tool used to visualize real-time 3D space. Now that apt-key has finally been deprecated and is scheduled to last be available in Debian 11 and Ubuntu 22.04, it is recommended to manually store the OpenPGP keys from added repos and point them infile.

First, obtain and decrypt Celestia’s repository key from the official server:

sudo mkdir -p /etc/apt/trusted.gpg.d
curl -s https://celestia.space/packages/celestia.key |
gpg --dearmor |
sudo tee /etc/apt/trusted.gpg.d/celestia.gpg

Now with the key stored, just add the package repository to your system and specify the OpenGPG unencrypted key path before installing:

suite=$(lsb_release -c| cut -f2)
[[ $suite =~ ^(xenial|bionic)$ ]] &&
component=universe ||
component=main
[[ $suite =~ ^(stretch|buster|xenial|bionic|focal)$ ]] ||
suite=focal
echo "deb [signed-by=/etc/apt/trusted.gpg.d/celestia.gpg] $suite $component" |
sudo tee /etc/apt/sources.list.d/celestia.list

If you’re still using a non-LTS Ubuntu release from before 20.04 (Focal Fossa), manually alter suite=focal above to match the previous LTS version released — keep in mind that a Celestia repo for 22.04 (Jammy Jellyfish) isn’t yet available. Otherwise, the one-liner above will handle everything.

--

--