Siduction Forum

Siduction Forum => Upgrade Warnings => Topic started by: harley-peter on 2022/03/01, 10:14:42

Title: trusted.gpg warning
Post by: harley-peter on 2022/03/01, 10:14:42
At the last du I get some warnings like
Code: [Select]
W: https://wire-app.wire.com/linux/debian/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Is there something to do?
Title: Re: trusted.gpg warning
Post by: devil on 2022/03/01, 11:37:27
Notice in changelog of apt 2.4.0:
[ Julian Andres Klode ]
  * Install an empty /etc/apt/keyrings directory.
    This directory is intended to provide an alternative to
    /usr/share/keyrings for placing keys used with signed-by.
  * Warn if the legacy trusted.gpg keyring is used for verification

More info in this blog post: https://linuxnews.de/2021/04/debian-11-repositories-aus-3-hand-ohne-apt-key-einbinden/

Title: Re: trusted.gpg warning
Post by: harley-peter on 2022/03/01, 16:40:04
Hallo devil,
danke für den Hinweis, ich wusste, dass ich dazu schon mal was gelesen hatte.  :)
Sollen die keys jetzt zukünftig in /etc/apt/keyrings (directory existiert ist aber leer) installiert werden wie im changelog beschrieben oder in /usr/share/keyrings/ wie in deinem Artikel beschrieben?

Ist alles ein wenig verwirrend, einige Schlüssel liegen in /etc/apt/trusted.gpg.d, einige in /usr/share/keyrings/, einige in beiden und einige wohl auch noch in der Datei /etc/apt/trusted.gpg, wie z. B. das die Warnung verursachende Wire.
Apt schaut wohl nur in das Verzeichnis  /etc/apt/trusted.gpg.d und in die Datei, es sei denn die sources.list wurde angepasst mit dem Zusatz [signed-by...], was aber wohl manuell geschehen muss. Alles nix Halbes und nix Ganzes. :-\
Title: Re: trusted.gpg warning
Post by: Camelot on 2022/03/01, 17:38:38
Normalerweise sollten sich die Drittsoftware-Hersteller darum kümmern, dass die Information zur Keyring-Installation aktuell ist, aber momentan hinken viele noch hinterher.
Signal und Vivaldi machen es mit der Erklärung richtig:
https://signal.org/de/download/linux/
https://help.vivaldi.com/desktop/install-update/manual-setup-vivaldi-linux-repositories/

Die Anleitung von Wire for Desktop und Opera dagegen ist veraltet:
https://github.com/wireapp/wire-desktop/wiki/How-to-install-Wire-for-Desktop-on-Linux
https://deb.opera.com/manual.html
Title: Re: trusted.gpg warning
Post by: der_bud on 2022/03/01, 21:55:25
Kleiner Hinweis, oben in harley-peters Codebox steht noch "..see the DEPRECATION section in apt-key(8 ) for details". Die englische manpage für apt-key hat einen Absatz zum neuen Vorgehen (im Prinzip dann so wie von Camelot am Beispiel Signal/Vivaldi verlinkt. Die deutsche manpage hat den Text noch nicht drin.
Title: Re: trusted.gpg warning
Post by: maxhq on 2022/03/22, 00:46:59
Hallo!

Nachdem ich selbiges Problem auch hatte (mit etlichen Repositories), habe ich ein Skript geschrieben, dass die Umstellung auf /usr/share/keyrings/ vornimmt. Es werden alle Listen unter /etc/apt/sources.list.d/ ausgelesen, die entsprechenden Keys aus den Repos ermittelt und via hkp://keyserver.ubuntu.com heruntergeladen und verlinkt. Es wird eine Sicherungskopie der alten *.list-Konfigurationen erstellt.
Vielleicht ist es für jemanden von Nutzen...

https://gist.github.com/maxhq/7dadf55064aaadc4d9e5993f89fad7b0

Grüße,
Jens
Title: Re: trusted.gpg warning
Post by: devil on 2022/03/22, 06:23:55
Erstmal danke dafür, das erspart viel Arbeit.Ich hab es eben getestet und ein Problem entdeckt. Ein apt update nach Umbenennen von /etc/apt/trusted.gpg.d und /etc/apt/trusted.gpg funktioniert nicht wie erwartet, obwohl die Schlüssel alle korrekt unter /usr/share/keyrings liegen. Ein zweiter Durchlauf bestätigt, dass es nichts zu tun gibt. Falsch machen kann man eigentlich auch nichts. Vielleicht liegt's an zu wenig Kaffee :)
Title: Re: trusted.gpg warning
Post by: michaa7 on 2022/03/23, 13:21:30
Danke für das script. Das klappt gut.

Wenn diese apt-key Umstellung sowie kommt, sollte man dann dieses script nicht einfach als siduction Paket ausliefern lassen?

Dieses Umbenennen der sources.list.d files in *.apt-keys Sicherungs Files erzeugt natürlich Warnungen:
Code: [Select]
...N: Datei »fixes.list.apt-key« in Verzeichnis »/etc/apt/sources.list.d/« wird ignoriert, da sie eine ungültige Dateinamen-Erweiterung hat.
...
Das ist temporär sicherlich sinnvoll, aber wenn alles klappt kann man diese Kopien ja löschen, denke ich ...
Title: Re: trusted.gpg warning
Post by: edlin on 2022/03/24, 12:22:59
Ich habe schlicht einen Unterordner angelegt, in den ich die *.apt-key Sicherungsdateien verschoben habe.
Damit sind die Warnungen weg, aber nicht die Sicherheitskopien.

edlin
Title: Re: trusted.gpg warning
Post by: devil on 2022/03/25, 17:28:42
Die hatte ich eh schon verschoben. Ich habe allerdings zwei Repos mit dem Schlüssel im .asc Format. Nachdem ich diese mit
Code: [Select]
gpg --dearmor name.asc umgewandelt hatte, haben sie das Format
Code: [Select]
name.asc.gpg und das Script fasst sie immer noch nicht an, selbst dann nicht, wenn ich sie nach
Quote
name.ggpgpg
umbenenne. Ich steig da gerade nicht durch. Jemand ne Idee?
Title: Re: trusted.gpg warning
Post by: michaa7 on 2022/03/26, 11:09:14
... selbst dann nicht, wenn ich sie nach
Quote
name.ggp
umbenenne. Ich steig da gerade nicht durch. Jemand ne Idee?

Falls dir dort der gleiche typo (ggp) unterlaufen ist wäre das eine Erklärung ...
Title: Re: trusted.gpg warning
Post by: devil on 2022/03/26, 13:55:34
Ups, nö, da ist alles richtig.
Title: Re: trusted.gpg warning
Post by: hendrikL on 2022/03/26, 14:46:22
Wenn die Fehlermeldung in etwa folgende ist,
Code: [Select]
gpg: Empfangen vom Schlüsselserver fehlgeschlagen: Keine Daten
so muss man sich die Mühe machen und das [signed-by=/usr/share/keyrings/name.gpg] in entsprechende source.list händisch eintragen.
Title: Re: trusted.gpg warning
Post by: finotti on 2022/03/31, 20:43:10
OK, so I manually moved the keys to /usr/local/share/keyrings and added "signed-by" to the source lists files.  But some of the packages seem overwrite the .list files.  For me, especially geogebra (http://"https://www.geogebra.org/?lang=en") has this problem.

Everything works fine for a while, and then the .list file is overwritten and I have to add "signed-by" to it again.

Is there a proper way to handle this situation?
Title: Re: trusted.gpg warning
Post by: hendrikL on 2022/04/01, 07:37:30
I think you have to write them and fill a bug.
Explain them the situation and the changes that debian made.
Title: Re: trusted.gpg warning
Post by: towo on 2022/04/01, 08:10:11
Put the keys you trust to /etc/apt/trusted.gpg.d/ then you don't need the [ signed-by ] entrys.
Title: Re: trusted.gpg warning
Post by: devil on 2022/04/01, 09:54:19
That is the behavior that will be deprecated with Debian 12.
Title: Re: trusted.gpg warning
Post by: towo on 2022/04/01, 10:05:08
/etc/apt/trusted.gpg != /etc/apt/trusted.gpg.d/

>From the manual:

Quote
DEPRECATION
       Except for using apt-key del in maintainer scripts, the use of apt-key is deprecated. This section shows how to replace existing use of apt-key.

       If your existing use of apt-key add looks like this:

       wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -

       Then you can directly replace this with (though note the recommendation below):

       wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc

       Make sure to use the "asc" extension for ASCII armored keys and the "gpg" extension for the binary OpenPGP format (also known as "GPG key public ring"). The binary OpenPGP format works for all apt versions, while the ASCII armored format works for apt
       version >= 1.4.

       Recommended: Instead of placing keys into the /etc/apt/trusted.gpg.d directory, you can place them anywhere on your filesystem by using the Signed-By option in your sources.list and pointing to the filename of the key. See sources.list(5) for details.
       Since APT 2.4, /etc/apt/keyrings is provided as the recommended location for keys not managed by packages. When using a deb822-style sources.list, and with apt version >= 2.4, the Signed-By option can also be used to include the full ASCII armored keyring
       directly in the sources.list without an additional file.

And for  the record, vendor keys like debian, ubuntu and so on will default placed in /etc/apt/trusted.gpg.d/
Title: Re: trusted.gpg warning
Post by: devil on 2022/04/01, 12:32:39
Debian has offered different solutions to the long coming apt-key deprecation and there is still no real consensus. And the argument against /etc/apt/trusted.gpg or /etc/apt/trusted.gpg.d is:
Quote
The reason for this change is that when adding an OpenPGP key that's used to sign an APT repository to /etc/apt/trusted.gpg or /etc/apt/trusted.gpg.d, the key is unconditionally trusted by APT on all other repositories configured on the system that don't have a signed-by (see below) option, even the official Debian / Ubuntu repositories. As a result, any unofficial APT repository which has its signing key added to /etc/apt/trusted.gpg or /etc/apt/trusted.gpg.d can replace any package on the system. So this change was made for security reasons

This is also reflected in the Debian Wiki
https://wiki.debian.org/DebianRepository/UseThirdParty
Title: Re: trusted.gpg warning
Post by: Mte90 on 2022/04/21, 12:21:24
I saw now the thread.
To fix the issue I downloaded again all the keys and imported in the new way to avoid any troubles.