It's pretty common to find instructions for adding an deb repository source as a shell script. They normally append stuff to /etc/apt/sources.list
, while I prefer creating a separate file for each repo on /etc/apt/sources.list.d
.
Here's how I do:
1. Create a /etc/apt/sources.list.d/{repo name}.list
file with its content being the repository source (some at the end of this post):
sudo vim /etc/apt/sources.list.d/{repo name}.list
2. Download the repo GPG key (as text):
curl {gpg key url} > {repo name}
3. Convert it to a .gpg
(binary):
gpg --dearmor {repo name}
4. Delete the original file and move the .gpg
one to /etc/apt/trusted.gpg.d/
:
rm {repo name} && sudo mv {repo name}.gpg /etc/apt/trusted.gpg.d/
Now you can sudo apt update
and sudo apt install {your package}
.
Here's some of my repos (Ubuntu 20.04):
-
Dropbox:
deb [arch=i386,amd64] http://linux.dropbox.com/ubuntu disco main
- https://linux.dropbox.com/ubuntu/dists/disco/Release.gpg
-
Microsoft (for code and dotnet):
deb [arch=amd64,arm64,armhf] https://packages.microsoft.com/ubuntu/22.04/prod jammy main
- https://packages.microsoft.com/keys/microsoft.asc
-
NodeSource (for node and npm):
deb https://deb.nodesource.com/node_14.x focal main
- https://deb.nodesource.com/gpgkey/nodesource.gpg.key
-
Libcontainers (for buildah, podman, and skopeo):
deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /
- https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/Release.gpg
-
Libretro (for RetroArch):
deb http://ppa.launchpad.net/libretro/stable/ubuntu jammy main
- See "Signing key" in "Technical details about this PPA" for the GPG key.
-
AppImageLauncher:
deb https://ppa.launchpadcontent.net/appimagelauncher-team/stable/ubuntu jammy main
- See "Signing key" in "Technical details about this PPA" for the GPG key.
Top comments (0)