Sample Header Ad - 728x90

Now that apt-key is deprecated, how do you add an Ubuntu PPA as a Debian APT source?

29 votes
2 answers
19104 views
## Background In the past, if you wanted to install software from an Ubuntu PPA in Debian, the approach was to 1. import/trust the developer's GPG key from keyserver.ubuntu.com,
$ sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com E58A9D36647CAE7F
2. then add the repository to /etc/apt/sources.list.d/...
# /etc/apt/sources.list.d/papirus-ppa.list
   deb http://ppa.launchpad.net/papirus/papirus/ubuntu  focal main
(Off the top of my head, examples can be found in [this Ubuntu docs wiki for mkusb](https://help.ubuntu.com/community/mkusb/install-to-debian) or [the Papirus icon theme readme](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme).) ## Problem The problem is that **this approach now produces deprecation warnings** (apt-key was deprecated [over a year ago](https://github.com/docker/docker.github.io/issues/11625)) :
$ apt-key adv ...
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8))
> ### Ninja edit > > See [this answer below](https://unix.stackexchange.com/a/679498/176219) for yet another, separate deprecation in this apt-key command! ## Solution? The new approach (as exemplified by, say, [Docker](https://docs.docker.com/engine/install/debian/#install-using-the-repository)) is twofold: 1. Save the developer's GPG key to disk,
$ curl -fsSL https://download.docker.com/linux/debian/gpg  | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
2. then specify the path to that GPG key when defining a new APT source:
# /etc/apt/sources.list.d/docker.list
   deb [... signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian  buster stable
            ⬑------------------ this part is new -----------------⬏
Step 1 is the part that replaces apt-key, but it doesn't seem possible to fetch individual GPG keys off of keyserver.ubuntu.com. Is it possible to adapt this approach for Ubuntu PPAs? If not, how can Ubuntu PPAs be added as software sources in Debian without the use of apt-key?
Asked by Ryan Lue (1176 rep)
Nov 29, 2021, 07:23 AM
Last activity: Jan 24, 2022, 12:49 PM