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}
.
Top comments (0)