Когда вы пытаетесь установить программу из сторонних репозиториев разработчика программы или из PPA вы можете столкнуться с ошибкой gpg недоступен открытый ключ. Это не значит, что программа платная и вам надо приобрести к ней ключ. Дело в том, что для защиты репозиториев от подмены используется подписывание пакетов с помощью GPG ключей.
Для того чтобы пакетный менеджер мог проверить подпись пакета, который вы пытаетесь установить необходимо чтобы у вас в системе был GPG ключ этого репозитория. Для официальных репозиториев ключи поставляются автоматически, а вот для сторонних надо их вручную добавить. Давайте рассмотрим пути решения этой проблемы.
Как вы можете видеть на снимке, программа сообщает какой именно репозиторий вызвал проблему и какого ключа не хватает:
Самый простой и правильный способ решить эту проблему — добавить ключ в систему. Обычно, там где вы нашли информацию о том как добавить репозиторий есть и информация как добавить его ключ. К тому же в выводе информации об ошибке пакетный менеджер сообщает какой ключ он ожидает увидеть. Вы можете попытаться искать такой ключ в Google или на серверах ключей Ubuntu.
В данном случае не хватает ключа от репозитория Google — 78BD65473CB3BD13. Можно попытаться получить его с серверов Ubuntu:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 78BD65473CB3BD13
Или с другого сервера:
sudo apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 78BD65473CB3BD13
Если у вас нет ключа от PPA или любого другого репозитория, связанного с разработчиками Ubuntu это должно помочь. Ну и ключ от репозитория Google там есть:
Если же вы получаете ошибку. Ищите данный ключ в интернете, если ключа нет на сайте разработчика, то его можно найти на различных форумах. Скачайте его и добавьте в систему такой командой:
sudo apt-key add /путь/к/файлу.gpg
Ещё одна альтернатива первому способу — попытаться использовать графическую утилиту Y-PPA-Manager от webupd8. Для её установки выполните такие команды:
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
sudo apt install y-ppa-manager
Затем запустите программу из главного меню или терминала. В главном окне программы выберите Advanced:
В открывшемся окне выберите Try to import all missing GPG keys, а потом дождитесь завершения работы утилиты:
После того как ключ добавлен вы можете снова попытаться импортировать репозитории и на этот раз у вас должно всё получится.
Выводы
В этой небольшой статье мы рассмотрели что делать когда возникает ошибка gpg недоступен открытый ключ и как исправить эту ошибку. Даже не думайте, что что можно обойтись без ключа. Все методы, которые позволяли просить APT игнорировать проверку ключей в современных версиях дистрибутива уже не работают. Если у вас остались вопросы, спрашивайте в комментариях!
Статья распространяется под лицензией Creative Commons ShareAlike 4.0 при копировании материала ссылка на источник обязательна .
Об авторе
Основатель и администратор сайта losst.ru, увлекаюсь открытым программным обеспечением и операционной системой Linux. В качестве основной ОС сейчас использую Ubuntu. Кроме Linux, интересуюсь всем, что связано с информационными технологиями и современной наукой.
Всем доброго дня.
Подскажите как это исправить ?
Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY 8B48AD6246925553
Ошк:3 http://deb.debian.org/debian stretch-updates InRelease
Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 638D0442B90D010
Ошк:5 http://deb.debian.org/debian stretch Release.gpg
Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 638D0442B90D010 NO_PUBKEY EF0F382A1A7B6500
deb http://deb.debian.org/debian/ stretch main
#deb-src http://deb.debian.org/debian/ stretch main
deb http://security.debian.org/debian-security stretch/updates main
#deb-src http://security.debian.org/debian-security stretch/updates main
# stretch-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ stretch-updates main
#deb-src http://deb.debian.org/debian/ stretch-updates main
Я всегда с пониманием оцениваю любую помощь !
Гуглом совсем не пользуешься принципиально? Апдейт сделай.
кончно пользуюсь гуглом и на мою проблему нагуглил только это
apt-key adv --keyserver keyring.debian.org KEY
Я всегда с пониманием оцениваю любую помощь !
И каков результат? Кстати , апдейт пробовал сделать?
root@deb17:~# gpg --keyserver keyserver.pgp.com --recv 9D6D8F6BC857C906
gpg: сбой при получении с сервера ключей: Время ожидания соединения истекло
root@deb17:~# apt-key adv --keyserver keyring.debian.org --recv 9D6D8F6BC857C906
Executing: /tmp/apt-key-gpghome.aMfuF2zy11/gpg.1.sh --keyserver keyring.debian.org --recv 9D6D8F6BC857C906
gpg: не найдено данных формата OpenPGP.
gpg: Всего обработано: 0
Я всегда с пониманием оцениваю любую помощь !
Ключи установлены?
dpkg -l |grep keyring
Devuan GNU/Linux 4 Chimaera x86_64
root@deb17:~# dpkg -l |grep keyring
ii debian-archive-keyring 2017.5 all GnuPG archive keys of the Debian archive
Я всегда с пониманием оцениваю любую помощь !
sudo apt install debian-archive-keyring
sudo apt update
Забыл — ii — это установлено или нет? Но про апдейт третий раз повторяю.
Цитата: symon2014 от 16 апреля 2019, 18:26:10ii — это установлено или нет?
нет, его нету. А это что подскажите плиз.
root@deb17:~# apt-key update
Warning: 'apt-key update' is deprecated and should not be used anymore!
Note: In your distribution this command is a no-op and can therefore be removed safely.
Я всегда с пониманием оцениваю любую помощь !
вот еще пробовал это но так все и остается без изменений
root@deb17:~# gpg --recv-keys 9D6D8F6BC857C906
gpg: key 9D6D8F6BC857C906: 12 подписей не проверено за отсутствием ключа
gpg: ключ 9D6D8F6BC857C906: "Debian Security Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" не изменен
gpg: Всего обработано: 1
gpg: неизмененных: 1
root@deb17:~# gpg --recv-keys 8B48AD6246925553
gpg: key 8B48AD6246925553: 28 подписей не проверено за отсутствием ключа
gpg: ключ 8B48AD6246925553: "Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>" не изменен
gpg: Всего обработано: 1
gpg: неизмененных: 1
root@deb17:~# gpg --recv-keys 7638D0442B90D010
gpg: key 7638D0442B90D010: 13 подписей не проверено за отсутствием ключа
gpg: ключ 7638D0442B90D010: "Debian Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" не изменен
gpg: Всего обработано: 1
gpg: неизмененных: 1
Я всегда с пониманием оцениваю любую помощь !
В посте номер 7 я написал пару команд для слепоглухих.
И заодно можно сравнить 1 и 10 посты по ключам и именам релизов , может мысль какая проклюнется.
Цитата: symon2014 от 16 апреля 2019, 19:55:10
В посте номер 7 я написал пару команд для слепоглухих.
sudo apt-get install --reinstall debian-archive-keyring && sudo apt-get update
Интересно, а куда вообще подевались ключи? Почему они пропали?
Я всегда с пониманием оцениваю любую помощь !
ЦитироватьИ это тоже пробовал.
А можно без отсебятины? Лучше текстом терминала , и без выдергиваний , под спойлер.
0
3
/etc/apt/sources.list
deb http://ftp.ru.debian.org/debian/ stretch main contrib non-free
# apt-get update
Пол:1 http://ftp.ru.debian.org/debian stretch InRelease [195 kB]
Игн:1 http://ftp.ru.debian.org/debian stretch InRelease
Получено 195 kБ за 1с (146 kБ/c)
Чтение списков пакетов… Готово
W: Ошибка GPG: http://ftp.ru.debian.org/debian stretch InRelease: Следующие подписи не могут быть проверены, так как недоступен открытый ключ: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010
W: Репозиторий «http://ftp.ru.debian.org/debian stretch InRelease» не подписан.
N: Данные из этого репозитория нельзя аутентифицировать, и поэтому потенциально из небезопасно использовать.
N: Смотрите справочную страницу apt-secure(8) о создании репозитория и настройке пользователя.
#gpg --keyserver pgpkeys.mit.edu --recv-keys 8B48AD6246925553
gpg: key 8B48AD6246925553: "Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
#gpg --keyserver pgpkeys.mit.edu --recv-keys 7638D0442B90D010
gpg: key 7638D0442B90D010: "Debian Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
И что с этим делать? Ключи уже импортировал. Они есть, но apt-get ругается.
В чем я не прав?
При установке пакетов в дистрибутивах, основанных на Debian, и использующих
пакетный менеджер apt, могут возникать ошибки, например, проверки
подлинности пакетов.
При установке пакетов в дистрибутивах, основанных на Debian, и использующих
пакетный менеджер apt, могут возникать ошибки, например, проверки
подлинности пакетов.
Предположим, вы добавили сторонний репозиторий в /etc/apt/sources.list
,
после чего решили установить оттуда пакет. В результате можно получить
такую ошибку:
W: GPG error: ...
Release: The following signatures couldn’t be verified because
the public key is not available: NO_PUBKEY F9A2F76A9D1A0061
С русской локализацией это будет выглядеть так:
W: Ошибка: ...
Release: Следующие подписи не могут быть проверены,
так как недоступен открытый ключ: NO_PUBKEY F9A2F76A9D1A0061
Для того, чтобы её решить, надо добавить публичный GnuPG ключ репозитория
в вашу систему – тогда пакетный менеджер будет знать, что подписанный
соответствующим приватным ключом пакет, от доверенного лица:
gpg --keyserver subkeys.pgp.net --recv F9A2F76A9D1A0061
gpg --export --armor F9A2F76A9D1A0061 | sudo apt-key add -
F9A2F76A9D1A0061 – это хеш ключа, который не смог найти установщик пакетов.
Альтренативный вариант – использовать утилиту apt-key:
sudo apt-key adv
--recv-keys
--keyserver keyserver.ubuntu.com
F9A2F76A9D1A0061
Или же можно установить сразу все недостающие ключи:
sudo apt-key adv
--recv-keys
--keyserver keyserver.ubuntu.com
$(sudo apt-get update 2>&1 | grep -o '[0-9A-Z]{16}$' | xargs)
Если же вы находитесь за proxy, то нужно это указать в команде, добавив ключ
--keyserver-options http-proxy="адрес:порт"
.
При установке пакетов в Ubuntu Linux, например, с помощью команды apt-get иногда возникает ошибка вида «W: GPG error: [..] Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY [..]». Обычно такая ситуация возникает после добавления нового репозитория в /etc/apt/sources.list с последующей попыткой установить пакет из этого репозитория.
Причина происхождения проблемы — отсутствие в вашей системе публичного GnuPG-ключа репозитория, из которого вы пытаетесь инсталлировать пакет (который, в свою очередь, подписан данным ключом). Хеш нужного ключа указывается в тексте ошибки после NO_PUBKEY (т.е. на месте второго «[..]»). Именно его и надо добавить в базу apt вашей системы для успешной установки пакета.
Чтобы это сделать, требуется выполнить две команды:
gpg --keyserver subkeys.pgp.net --recv KEY gpg --export --armor KEY | sudo apt-key add -
Здесь вместо KEY нужно подставить значение того GPG-ключа, который вы хотите добавить в свою базу. Так, например, если вы получали ошибку NO_PUBKEY F120156012B83718, вам потребуется выполнить следующие команды:
gpg --keyserver subkeys.pgp.net --recv F120156012B83718 gpg --export --armor F120156012B83718 | sudo apt-key add -
После успешного экспорта GPG-ключа в свою базу вы можете повторить попытку установить нужный вам пакет.
- Из той же серии:
- Как установить пакеты в Debian/Ubuntu Linux, игнорируя вопросы конфигурации?
- Как отключить автоматическое обновление списка пакетов в Ubuntu Linux?
- Как загружать deb-пакеты многопоточно с помощью metalink (скрипты и инструкция)
ecobeing.ru
Экология и вегетарианство на благо всем живым существам Планеты.
I added some extra repositories with the Software Sources program. But when I reload the package database, I get an error like the following:
W: GPG error: http://ppa.launchpad.net trusty InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 8BAF9A6F
I know I can fix it using apt-key
in a terminal, according to the official Ubuntu documentation. But I would have liked to do it graphically. Is there a way to do this without using a terminal?
Wilf
29.1k16 gold badges103 silver badges162 bronze badges
asked Nov 13, 2010 at 20:27
8
Execute the following commands in terminal
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <PUBKEY>
where <PUBKEY>
is your missing public key for repository, e.g. 8BAF9A6F
.
Then update
sudo apt-get update
ALTERNATE METHOD:
sudo gpg --keyserver pgpkeys.mit.edu --recv-key <PUBKEY>
sudo gpg -a --export <PUBKEY> | sudo apt-key add -
sudo apt-get update
Note that when you import a key like this using apt-key
you are telling the system that you trust the key you’re importing to sign software your system will be using. Do not do this unless you’re sure the key is really the key of the package distributor.
cjs
2851 silver badge11 bronze badges
answered Nov 28, 2010 at 18:49
karthick87karthick87
79.1k59 gold badges192 silver badges232 bronze badges
18
By far the simplest way to handle this now is with Y-PPA-Manager (which now integrates the launchpad-getkeys
script with a graphical interface).
-
To install it, first add the webupd8 repository for this program:
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
-
Update your software list and install Y-PPA-Manager:
sudo apt-get update sudo apt-get install y-ppa-manager
-
Run y-ppa-manager (i.e. type
y-ppa-manager
then press enter key). -
When the main y-ppa-manager window appears, click on «Advanced.»
-
From the list of advanced tasks, select «Try to import all missing GPG keys» and click OK.
You’re done! As the warning dialog says when you start the operation, it may take quite a while (about 2 minutes for me) depending on how many PPA’s you have and the speed of your connection.
answered Dec 4, 2013 at 15:52
monotaskermonotasker
3,6251 gold badge17 silver badges14 bronze badges
18
It happens when you don’t have a suitable public key for a repository.
To solve this problem use this command:
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 9BDB3D89CE49EC21
which retrieves the key from ubuntu key server. And then this:
gpg --export --armor 9BDB3D89CE49EC21 | sudo apt-key add -
which adds the key to apt trusted keys.
The solution can be found here & here & here.
Kevin Bowen
19.1k55 gold badges75 silver badges81 bronze badges
answered Mar 27, 2011 at 22:31
PedramPedram
5,4933 gold badges28 silver badges37 bronze badges
6
You need to get and import the key.
To get the key from a PPA, visit the PPA’s Launchpad page. On every PPA page at Launchpad you will find this link (2), after clicking on ‘Technical details about this PPA’ (1):
Follow it and click on the key ID link (3):
Save the page, this is your key file.
Now it’s time to import it:
Applications > Software Center
,Edit > Software sources...
,- Enter your password,
- Go to the
Authentication
tab and click onImport Key File...
, finally - Select the saved key file and click on
OK
.
xiota
4,6295 gold badges24 silver badges52 bronze badges
answered Nov 13, 2010 at 21:04
htorquehtorque
63.2k39 gold badges193 silver badges218 bronze badges
5
apt can only handle 40 keys in /etc/apt/trusted.gpg.d . 41 keys and you will get the GPG error «no public key found» even if you go through all the steps to add the missing key(s).
Check to see if there are any unused keys in this file from ppa(s) you no longer use. If all are in use, consider removing some ppa(s) along with the corresponding keyfiles in /etc/apt/trusted.gpg.d
Furthermore, using
sudo apt-key adv
Is considered a security risk and is not recommended as you are «undermining the whole security concept as this is not a secure way of recieving keys for various reasons (like: hkp is a plaintext protocol, short and even long keyids can be forged, …)«. http://ubuntuforums.org/showthread.php?t=2195579
I believe the correct way to add missing keys (for example 1ABC2D34EF56GH78) is
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 1ABC2D34EF56GH78
gpg --export --armor 1ABC2D34EF56GH78 | sudo apt-key add -
answered Aug 7, 2014 at 22:33
mchidmchid
40.5k6 gold badges91 silver badges140 bronze badges
10
There is a tiny script packaged in the WebUpd8 PPA which I’ll link as a single .deb download so you don’t have to add the whole PPA — which automatically imports all missing GPG keys.
Download and install Launchpad-getkeys (ignore the ~natty in its version, it works with all Ubuntu versions from Karmic all the way to Oneiric). Once installed, open a terminal and type:
sudo launchpad-getkeys
If you’re behind a proxy, things are a bit more complicated so see this for more info
answered Jun 5, 2011 at 20:15
Alin AndreiAlin Andrei
7,3184 gold badges41 silver badges55 bronze badges
2
I faced the same issue while installing Heroku. The link below solved my problem —
http://naveenubuntu.blogspot.in/2011/08/fixing-gpg-keys-in-ubuntu.html
After fixing the NO_PUBKEY
issue, the below issue remained
W: GPG error: xhttp://toolbelt.heroku.com ./ Release: The following signatures were invalid: BADSIG C927EBE00F1B0520 Heroku Release Engineering <release@heroku.com>
To fix it I executed the following commands in terminal:
sudo -i
apt-get clean
cd /var/lib/apt
mv lists lists.old
mkdir -p lists/partial
apt-get clean
apt-get update
Source — Link to solve it
answered Jan 30, 2013 at 17:12
dennyacdennyac
2175 silver badges7 bronze badges
1
Make sure you have apt-transport-https
installed:
dpkg -s apt-transport-https > /dev/null || bash -c "sudo apt-get update;
sudo apt-get install apt-transport-https -y"
Add repository:
curl https://repo.skype.com/data/SKYPE-GPG-KEY | sudo apt-key add -
echo "deb [arch=amd64] https://repo.skype.com/deb stable main" | sudo tee /etc/apt/sources.list.d/skype-stable.list
Install Skype for Linux:
sudo apt-get update
sudo apt-get install skypeforlinux -y
Source: https://community.skype.com/t5/Linux/Skype-for-Linux-Beta-signatures-couldn-t-be-verified-because-the/td-p/4645756
answered May 27, 2017 at 20:00
More generally, the following method should work for every repository. First of all search, with eventual help of a search engine, for a text on the program provider’s website looking like the following:
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.1 (GNU/Linux)
[...]
-----END PGP PUBLIC KEY BLOCK-----
Such a text is for example displayed on http://deb.opera.com. Copy the passage, paste it in an empty file that you create on your desktop. This results in the key file.
Then continue with the importation of the key:
- Applications > Sofware Center
- Edit > Sofware sources…, enter password
- Authentication tab, click on ‘Import Key File…’
- Select the saved key file and click on ‘Ok’.
You may now remove the previously created key file.
answered Nov 13, 2010 at 21:43
AgmenorAgmenor
15.5k18 gold badges65 silver badges103 bronze badges
0
This error can also occur when the apt list file by the PPA points to a local keyring, like
deb [signed-by=/usr/share/keyrings/SOMETHING.gpg] https://download.something.org/something something/
And while that file may exist on your system (possibly downloaded with a prior command), it may be unreadable due to missing permissions. I just fixed this kind of error by running
chmod 644 /usr/share/keyrings/*
after having fetched the keyring file. The underlying issue was the usage of sudo
when I already was root user. Really weird as all of this is root anyway and there was no access permission failure message anywhere… but that fixed it
answered Jun 12, 2020 at 12:28
phil294phil294
5297 silver badges16 bronze badges
1
Good! I finaly found the way!
I’ve tested all method’s to fix GPG error NO_PUBKEY and nothing working for me.
I’ve deleted the entire contents of the folder /etc/apt/trusted.gpg.d
cd /etc/apt/trusted.gpg.d
sudo rm -R *
sudo apt-get update
And I use the Y-PPA-Manager method because I’m too lazy to create all pubkey’s manually (too many): http://www.unixmen.com/fix-w-gpg-error-no_pubkey-ubuntu/
run sudo apt-get update again and finaly all work great now! Tanks!
Based Source : post #17 on https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1263540
answered Apr 8, 2015 at 13:36
4
I had the same problem with DynDNS’s Updater client.
Turns out it was just expired keys.
Reinstalling the software (downloading a new .deb
from the website, then using Software Centre to reinstall) fixed the problem.
Error message for reference:
W: GPG error: http://cdn.dyn.com stable/ Release: The following signatures were invalid: KEYEXPIRED 141943.......
kos
35k13 gold badges98 silver badges149 bronze badges
answered Jan 8, 2015 at 16:53
CrankyCranky
4245 silver badges11 bronze badges
2021 August. This is what worked for me.
cd /etc/apt/trusted.gpg.d
sudo rm -R *
sudo apt-get update
The last line will raise errors of missing keys.
What you’d then have to do is manually install each of the keys listed in the errors
for example if the error is saying that your missing PUB_KEY
is 9BDB3D89CE49EC21
,
You can manually add the Key with the command sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9BDB3D89CE49EC21
Re-run sudo apt-get update
Repeat the process for the new key raised in the error
Say if the new key was 3BDB3D89CE49EC24
,
Just Manually add the Key with the command sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3BDB3D89CE49EC24
Re-run sudo apt-get update and repeat the process until all the errors are gone.
Then go back to the package site you were trying to install and repeat the installation process.
For my case, the error was coming while I tried installing Sublime Text
Doing the above and returning to the Sublime installation guide here solved the issues.
Don’t forget to upvote if this works for you. And it must do
answered Aug 29, 2021 at 6:20
NMukamaNMukama
2961 silver badge13 bronze badges