To determine if packages are authentic, pacman uses GnuPG keys in a web of trust model. The current Master Signing Keys are found here. At least three of these Master Signing Keys are used to sign the Developer’s and Trusted User’s own keys. They are then used to sign their packages. Each user also has a unique PGP key, which is generated when you configure pacman-key. It is this web of trust that links the user’s key to the master keys.
Examples of webs of trust:
- Custom packages: Packages made and signed with a local key.
- Unofficial packages: Packages made and signed by a developer. Then, a local key was used to sign the developer’s key.
- Official packages: Packages made and signed by a developer. The developer’s key was signed by the Arch Linux master keys. You used your key to sign the master keys, and you trust them to vouch for developers.
Note: The HKP protocol uses 11371/tcp for communication. In order to get the signed keys from the servers (using pacman-key), this port is required for communication.
Setup
Configuring pacman
The SigLevel
option in /etc/pacman.conf
determines the level of trust required to install a package with pacman -S
. For a detailed explanation of SigLevel
, see pacman.conf(5) § PACKAGE AND DATABASE SIGNATURE CHECKING, and the file comments. One can set signature checking globally, or per repository. If SigLevel
is set globally in the [options]
section, all packages installed with pacman -S
will require signing. With the LocalFileSigLevel
setting from the default pacman.conf
, any packages you build, and install with pacman -U
, will not need to be signed using makepkg.
Note: Although all official packages are now signed, as of November 2018 signing of the databases is a work in progress. If Required
is set then DatabaseOptional
should also be set.
For remote packages, the default configuration will only support the installation of packages signed by trusted keys:
/etc/pacman.conf
SigLevel = Required DatabaseOptional
TrustedOnly
is a default compiled-in pacman parameter. The default configuration is identical to using the global option of:
SigLevel = Required DatabaseOptional TrustedOnly
The above can be achieved too on a repository level further below in the configuration, e.g.:
[core] SigLevel = PackageRequired Include = /etc/pacman.d/mirrorlist
explicitly adds signature checking for the packages of the repository, but does not require the database to be signed. Optional
here would turn off a global Required
for this repository.
Warning: The SigLevel TrustAll
option exists for debugging purposes and makes it very easy to trust keys that have not been verified. You should use TrustedOnly
for all official repositories.
Initializing the keyring
To initialize the pacman keyring run:
# pacman-key --init
Initializing the keyring requires entropy. To generate entropy, move your mouse around, press random characters on the keyboard, or run some disk-based activity (for example in another console running ls -R /
or find / -name foo
or dd if=/dev/sda8 of=/dev/tty7
). If your system does not already have sufficient entropy, this step may take hours; if you actively generate entropy, it will complete much more quickly.
The randomness created is used to initialize the keyring (/etc/pacman.d/gnupg
) and the GPG signing key of your system.
Note: If you need to run pacman-key --init
on a computer that does not generate much entropy (e.g. a headless server), key generation may take a very long time. To generate pseudo-entropy, install either haveged or rng-tools on the target machine and start the corresponding service before running pacman-key --init
.
Managing the keyring
Verifying the master keys
The initial setup of keys is achieved using:
# pacman-key --populate
Take time to verify the Master Signing Keys when prompted as these are used to co-sign (and therefore trust) all other packager’s keys.
PGP keys are too large (2048 bits or more) for humans to work with, so they are usually hashed to create a 40-hex-digit fingerprint which can be used to check by hand that two keys are the same. The last eight digits of the fingerprint serve as a name for the key known as the ‘(short) key ID’ (the last sixteen digits of the fingerprint would be the ‘long key ID’).
Adding developer keys
The official developer and Trusted Users (TU) keys are signed by the master keys, so you do not need to use pacman-key to sign them yourself. Whenever pacman encounters a key it does not recognize, it will prompt you to download it from a keyserver
configured in /etc/pacman.d/gnupg/gpg.conf
(or by using the --keyserver
option on the command line). Wikipedia maintains a list of keyservers.
Once you have downloaded a developer key, you will not have to download it again, and it can be used to verify any other packages signed by that developer.
Note: The archlinux-keyring package, which is a dependency of pacman, contains the latest keys. However keys can also be updated manually using pacman-key --refresh-keys
(as root). While doing --refresh-keys
, your local key will also be looked up on the remote keyserver, and you will receive a message about it not being found. This is nothing to be concerned about.
Adding unofficial keys
This article or section needs expansion.
This method can be utilized to add a key to the pacman keyring, or to enable signed unofficial user repositories.
First, get the key ID (keyid
) from its owner. Then add it to the keyring using one of the two methods:
- If the key is found on a keyserver, import it with:
# pacman-key --recv-keys keyid
- If otherwise a link to a keyfile is provided, download it and then run:
# pacman-key --add /path/to/downloaded/keyfile
It is recommended to verify the fingerprint, as with any master key or any other key you are going to sign:
$ pacman-key --finger keyid
Finally, you must locally sign the imported key:
# pacman-key --lsign-key keyid
You now trust this key to sign packages.
Debugging with gpg
For debugging purposes, you can access pacman’s keyring directly with gpg, e.g.:
# gpg --homedir /etc/pacman.d/gnupg --list-keys
Tips and tricks
Upgrade system regularly
Upgrading the system regularly via pacman#Upgrading packages prevents most signing errors. If delay is unavoidable and system upgrade gets delayed for an extended period, manually sync the package database and upgrade the archlinux-keyring package before system upgrade:
# pacman -Sy archlinux-keyring && pacman -Su
This command is not considered a partial upgrade since it syncs the package database and upgrades the keyring package first. Both must be processed just before starting system upgrade to ensure signatures of all upgraded packages can be properly verified.
Update system time regularly
When the system time is faulty, signing keys could be considered expired (or invalid) and signature checks on packages will fail. Synchronize the system clock regularly by using the Network Time Protocol daemon.
Troubleshooting
Invalid signature errors
pacman-key depends on system time. If your system clock is not synchronized, system installation/upgrade may fail with:
error: PackageName: signature from "User <email@archlinux.org>" is invalid error: failed to commit transaction (invalid or corrupted package (PGP signature)) Errors occurred, no packages were upgraded.
If using ntpd, correct the system time (as root) with ntpd -qg
followed by hwclock -w
.
Other NTP clients can be used. See time synchronization.
If correction of the system clock does not resolve the failure, try one of the following approaches:
Removing packages from cache
Some packages could be corrupted or may be unsigned, causing failure. Remove each offending package from the system cache rm /var/cache/pacman/pkg/pkgname
so it gets freshly downloaded, or clear the entire cache.
Resetting all the keys
Remove or reset all the keys installed in your system by removing the /etc/pacman.d/gnupg
directory (as root) and by rerunning pacman-key --init
followed by pacman-key --populate
to re-add the default keys.
Disabling signature checking
Warning: Use with caution. Disabling package signing will allow pacman to install untrusted packages.
If you are not concerned about package signing, you can disable PGP signature checking completely. Edit /etc/pacman.conf
to have the following lines under [options]
:
SigLevel = Never #LocalFileSigLevel = Optional #RemoteFileSigLevel = Required
You need to comment out any repository-specific SigLevel
settings because they override the global settings. This will result in no signature checking, which was the behavior before pacman 4. If you do this, you do not need to set up a keyring with pacman-key. You can change those options later if you decide to enable package verification.
Cannot import keys
This article or section needs language, wiki syntax or style improvements. See Help:Style for reference.
Reason: Instructions could be clearer. Not clear how this section is different from the preceding one. Redundant information. (Discuss in Talk:Pacman/Package signing)
There are multiple possible sources of this problem:
- An outdated archlinux-keyring package.
- The clock being set to an incorrect date.
- Your ISP blocked the port used to import PGP keys.
- Your pacman cache contains copies of unsigned packages from previous attempts.
dirmngr
is not correctly configured.
You might be stuck because of an outdated archlinux-keyring package when doing an upgrade synchronization.
Below are a few solutions that could work depending on your case.
Upgrade the system
See if upgrading the system can fix it first.
Change keyserver
If you suspect that something is not working right with the keyserver, you could try to switch to the Ubuntu keyserver. To do this, edit /etc/pacman.d/gnupg/gpg.conf
and change the keyserver
line to:
keyserver hkp://keyserver.ubuntu.com
Clean cached packages
If you suspect that your pacman cache at /var/cache/pacman/pkg/
might contain unsigned packages, try cleaning the cache manually or run:
# pacman -Sc
which removes all cached packages that have not been installed.
Signature is unknown trust
Sometimes when running pacman -Syu
you might encounter this error:
error: package-name: signature from "packager" is unknown trust
This occurs because the packager
‘s key used in the package package-name
is not present and/or not trusted in the local pacman-key gpg database. Pacman does not seem to always be able to check if the key was received and marked as trusted before continuing. This could also be because a key has expired since it was added to your keychain.
Mitigate by:
- Manually upgrading the archlinux-keyring package prior to the system upgrade, or
- refreshing your keys with
pacman-key --refresh-keys
, or - resetting all the keys, or
- manually signing the untrusted key locally (not recommended), or
- setting temporarily
SigLevel
toTrustAll
(not recommended).
The last two options above break the chain of trust, and should be used with care.
Updating keys via proxy
In order to use a proxy when updating keys the honor-http-proxy
option must be set in both /etc/gnupg/dirmngr.conf
and /etc/pacman.d/gnupg/dirmngr.conf
. See GnuPG#Use a keyserver for more information.
Note: If pacman-key is used without the honor-http-proxy
option and fails, a reboot may solve the issue.
See also
- DeveloperWiki:Package Signing Proposal for Pacman
- Pacman Package Signing – 1: Makepkg and Repo-add
- Pacman Package Signing – 2: Pacman-key
- Pacman Package Signing – 3: Pacman
- Pacman Package Signing – 4: Arch Linux
This brief guide describes how to fix invalid or corrupted package (PGP signature) error in Arch Linux and its variants like EndeavourOS and Manjaro Linux.
Introduction
The other day I encountered with the following error when I tried to upgrade my Arch Linux system using command ‘sudo pacman -Syu
‘:
[...] :: File /var/cache/pacman/pkg/libpsl-0.16.1-1-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n] y error: failed to commit transaction (invalid or corrupted package) Errors occurred, no packages were upgraded.
Then, I ran 'sudo pacman -Syyu'
command, but still no luck. I kept getting the same error every time.
After a bit of search on Google and Arch Linux forums, I found that there are new keys in the archlinux-keyring
package.
Fix «invalid or corrupted package (PGP signature)» error in Arch Linux
To solve «invalid or corrupted package (PGP signature)» error in Arch Linux, we need to update the archlinux-keyring
package.
To do so, run:
$ sudo pacman -S archlinux-keyring
Sample output:
resolving dependencies... looking for conflicting packages... Packages (1) archlinux-keyring-20170104-1 Total Installed Size: 0.81 MiB Net Upgrade Size: 0.04 MiB :: Proceed with installation? [Y/n] y (1/1) checking keys in keyring [######################] 100% (1/1) checking package integrity [######################] 100% (1/1) loading package files [######################] 100% (1/1) checking for file conflicts [######################] 100% (1/1) checking available disk space [######################] 100% :: Processing package changes... (1/1) upgrading archlinux-keyring [######################] 100% ==> Appending keys from archlinux.gpg... gpg: marginals needed: 3 completes needed: 1 trust model: PGP gpg: depth: 0 valid: 1 signed: 6 trust: 0-, 0q, 0n, 0m, 0f, 1u gpg: depth: 1 valid: 6 signed: 69 trust: 0-, 0q, 0n, 6m, 0f, 0u gpg: depth: 2 valid: 69 signed: 7 trust: 69-, 0q, 0n, 0m, 0f, 0u gpg: next trustdb check due at 2017-09-07 ==> Locally signing trusted keys in keyring... -> Locally signing key 0E8B644079F599DFC1DDC3973348882F6AC6A4C2... -> Locally signing key 684148BB25B49E986A4944C55184252D824B18E8... -> Locally signing key 91FFE0700E80619CEB73235CA88E23E377514E00... -> Locally signing key 44D4A033AC140143927397D47EFD567D4C7EA887... -> Locally signing key 27FFC4769E19F096D41D9265A04F9397CDFD6BB0... -> Locally signing key AB19265E5D7D20687D303246BA1DFB64FFF979E7... ==> Importing owner trust values... ==> Disabling revoked keys in keyring... -> Disabling key F5A361A3A13554B85E57DDDAAF7EF7873CFD4BB6... -> Disabling key 7FA647CD89891DEDC060287BB9113D1ED21E1A55... -> Disabling key D4DE5ABDE2A7287644EAC7E36D1A9E70E19DAA50... -> Disabling key BC1FBE4D2826A0B51E47ED62E2539214C6C11350... -> Disabling key 9515D8A8EAB88E49BB65EDBCE6B456CAF15447D5... -> Disabling key 4A8B17E20B88ACA61860009B5CED81B7C2E5C0D2... -> Disabling key 63F395DE2D6398BBE458F281F2DBB4931985A992... -> Disabling key 0B20CA1931F5DA3A70D0F8D2EA6836E1AB441196... -> Disabling key 8F76BEEA0289F9E1D3E229C05F946DED983D4366... -> Disabling key 66BD74A036D522F51DD70A3C7F2A16726521E06D... -> Disabling key 81D7F8241DB38BC759C80FCE3A726C6170E80477... -> Disabling key E7210A59715F6940CF9A4E36A001876699AD6E84... ==> Updating trust database... gpg: next trustdb check due at 2017-09-07
The above command will update the new keys and disable the revoked keys in your Arch Linux system.
Again, I tried to upgrade my Arch Linux using command:
$ sudo pacman -Syu
This time the upgrade process went well without any issues.
22 comments
ph9214
November 12, 2017 — 9:03 pm
How do I add new ones like for mono-addins
Reply
AVL
September 29, 2018 — 8:58 pm
often problems- no key.
sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring fast, important
sudo pacman -Syu big download/install
[clear is deleting operation !]
pacman-key –refresh-keys fast, important, impact
Reply
Manuel
December 9, 2018 — 12:19 am
Worked like a charm! Thank you very much.
Reply
keith sanby
January 7, 2019 — 11:17 pm
Worked for me THANKS
Reply
cereberus
February 15, 2019 — 4:01 am
I got this error out of the blue, your solution helped me to resolve it. Thank you!
Reply
Aaron Geoffrey Blomgren
March 1, 2019 — 11:34 am
OMG Thank you
Reply
sk
March 1, 2019 — 12:36 pm
You’re welcome.
Reply
Mike
April 9, 2019 — 12:02 pm
Thank you!
Reply
at
June 4, 2019 — 2:21 am
thanks x 100000
Reply
Peter
June 21, 2019 — 10:38 pm
Thanks!
Reply
elig0n
July 6, 2019 — 10:18 pm
Reply
Anonymous
July 31, 2019 — 9:22 am
Thanks Man…
Reply
longhairhippy
August 15, 2019 — 10:58 am
Seriously helpful! Thank you!
Reply
B
March 9, 2022 — 3:31 am
THANK YOU. My Arch system was doing this for TWO MONTHS and I just finally fixed it with this! 😀
Reply
Janko
April 29, 2022 — 2:22 pm
Working in 2022 for EndeavourOS as well, thank you a lot!
Reply
Teagan
May 30, 2022 — 11:46 pm
I couldn’t update it because of the missingcorrupted key
Reply
Doria
July 24, 2022 — 12:12 pm
After 1 hour trying different solutions for this problem I found this one and it worked! Updating the keyring did the trick for me.
Thanks a lot!
Reply
sk
July 24, 2022 — 1:20 pm
Glad it worked out for you. Happy to help.
Reply
Kgb
August 5, 2022 — 1:13 am
Thanks
Reply
kapil
October 28, 2022 — 8:43 pm
Thank you very much
Reply
eisGeist
December 22, 2022 — 12:51 pm
Dear SK, thank you so much!
I’m a Arch Linux newbee and your post solved the issue keeping me from successfully update my linux box.
Cheers!
Reply
Urias
December 23, 2022 — 4:35 am
You saved my day. I was having troubles installing python-docutils before I could compile a Wps Office package.
Reply
Leave a Comment
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Содержание
- Ошибка при обновлении
- Arch Linux
- #1 2020-08-17 07:35:30
- [SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
- #2 2020-08-17 07:58:50
- Re: [SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
- #3 2020-08-17 08:10:52
- Re: [SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
- #4 2020-08-17 08:31:05
- Re: [SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
- #5 2020-08-17 08:37:08
- Re: [SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
- pacman (Русский)/Package signing (Русский)
- Настройка
- Настройка pacman
- Инициализация связки ключей
- Управление связкой ключей
- Проверка мастер-ключей
- Добавление ключей разработчика
- Добавление неофициальных ключей
- Отладка при помощи gpg
- Решение проблем
- error: signature from xxx is invalid
- Удаление старых версий пакетов
- Сброс ключей
- Отключение проверки подписи
- Не удаётся импортировать ключи
- Обновление системы
- Смена сервера ключей
- Удаление кэшированных пакетов
- Не удаётся опознать подпись пакета
- Arch Linux
- #1 2013-12-25 04:30:20
- [SOLVED] Invalid or corrupted package (PGP signature)
- #2 2013-12-25 04:49:52
- Re: [SOLVED] Invalid or corrupted package (PGP signature)
- #3 2013-12-25 13:04:12
- Re: [SOLVED] Invalid or corrupted package (PGP signature)
- #4 2013-12-26 17:40:10
- Re: [SOLVED] Invalid or corrupted package (PGP signature)
- #5 2013-12-26 17:44:36
- Re: [SOLVED] Invalid or corrupted package (PGP signature)
Ошибка при обновлении
Признаюсь честно, у меня не Arch, у меня Manjaro, но может вы мне все-таки поможете.
Сразу после установки появилось сообщение, что готовы обновления. Я пытался обновить систему командой
Начинается обновление, но почти сразу появляется сообщение:
File /var/cache/pacman/pkg/udiskie-1.7.1-1-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded
# 5 лет, 2 месяца назад (отредактировано 5 лет, 2 месяца назад)
simulator-t
Что можно сделать в данной ситуации?
simulator-t
File /var/cache/pacman/pkg/udiskie-1.7.1-1-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
# 5 лет, 2 месяца назад (отредактировано 5 лет, 2 месяца назад) Очистить кеш пакетного менеджера, обновить базу данных пакмана и установленные пакеты.
Перевод:
Если вылезает та же ошибка — сменить зеркало, повторить процедуру.
—
Да, если опять фейл — обновлять ключи. simulator-t, да, забыл, предложение Aivar, тоже исключать нельзя.
Вначале попробовал это
но не помогло.
Затем прошел по ссылке
Из ответа, который помог тамошним вопрошающим
sudo rm -r /etc/pacman.d/gnupg
sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring
sudo pacman-key —init
sudo pacman-key —populate archlinux manjaro
sudo pacman-key —refresh-keys
sudo pacman -Sc
Try updating after that. If that does not work, the package might actually be corrupt.
я выбрал только команду
и затем снова выполнил
и это сработало. Ошибок не получал.
Кстати, не по теме, но пользуясь случаем. В Arch при загрузке появляется какой-то drop-down terminal или это фишка Manjaro?
Удивляете. Арч будет таким, каким вы его сделаете. Кто знает, может у манджары guake в автозагрузке.
© 2006-2023, Русскоязычное сообщество Arch Linux.
Название и логотип Arch Linux ™ являются признанными торговыми марками.
Linux ® — зарегистрированная торговая марка Linus Torvalds и LMI.
Источник
Arch Linux
You are not logged in.
#1 2020-08-17 07:35:30
[SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
It has been a month since I started this pc (work) (long vacation) and now I want to update it.
Pacman starts downloading 1099 packages, checks them, and then fails on:
I didn’t find any info about this on the arch news page and a directed search didn’t help either.
So sorry if I overlooked something, but I really don’t know where to go next.
Last edited by scippie (2020-08-17 08:37:37)
#2 2020-08-17 07:58:50
Re: [SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
Update archlinux-keyring first.
This is one of the rare exceptions where a partial update is acceptable, iff directly followed by a full system upgrade:
Солідарність з Україною
Online
#3 2020-08-17 08:10:52
Re: [SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
Yes, that fixed it, thanks.
Can you explain me what is happening? Why I need to do this? And how I can detect it in the future so that I don’t need to ask again?
#4 2020-08-17 08:31:05
Re: [SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
Pacman’s keyring, which contains the public keys of the devs and TUs for package signature checking was out of date on your system.
Hence, packages signed with newer keys by the devs and TUs could not be verified by pacman.
Please also remember to mark this topic as SOLVED.
Last edited by schard (2020-08-17 08:32:58)
Солідарність з Україною
Online
#5 2020-08-17 08:37:08
Re: [SOLVED] invalid or corrupted package (PGP sig.) — pacman can’t update
Pacman’s keyring, which contains the public keys of the devs and TUs for package signature checking was out of date on your system.
But how do I ‘see’ that?
I’ve had keyring updates before, they went fine, so how could I know that this time, I should do it manually?
Please also remember to mark this topic as SOLVED.
Источник
pacman (Русский)/Package signing (Русский)
Для определения подлинности пакетов pacman использует ключи GnuPG и сеть доверия. Действующие мастер-ключи Arch Linux можно найти здесь. Ключи разработчиков и доверенных пользователей, которыми они подписывают свои пакеты, должны быть подписаны минимум тремя мастер-ключами. У каждого пользователя также есть свой уникальный PGP-ключ, сгенерированный при настройке утилиты pacman-key. Сеть доверия связывает ключи пользователей и мастер-ключи.
Примеры сетей доверия:
- Пользовательские пакеты: обычный пользователь создаёт пакет и подписывает его своим локальным ключом.
- Неофициальные пакеты: разработчик создаёт пакет и подписывает его ключом разработчика; обычный пользователь подписывает ключ разработчика локальным ключом.
- Официальные пакеты: разработчик создаёт пакет и подписывает его ключом разработчика, подписанным мастер-ключами Arch Linux; обычный пользователь подписывает локальным ключом мастер-ключ и доверяет последнему поручиться за разработчика.
Настройка
Настройка pacman
Опция SigLevel в файле /etc/pacman.conf определяет необходимый для установки пакета уровень доверия. Подробную информацию о SigLevel можно найти в руководстве pacman.conf(5) § PACKAGE AND DATABASE SIGNATURE CHECKING и в комментариях в самом файле. Можно настроить проверку подписи как глобально, так для каждого репозитория в отдельности. Если задать SigLevel глобально в разделе [options] , то абсолютно все пакеты должны быть подписаны. Пакеты, которые вы собрали сами, необходимо подписывать с помощью утилиты makepkg.
Настройка по умолчанию позволяет устанавливать только те пакеты, которые подписаны доверенными ключами:
Параметр TrustedOnly используется в pacman по умолчанию, то есть настройка ниже аналогична предыдущей:
То же самое можно задать и для отдельного репозитория далее в файле конфигурации:
Здесь явно задаётся проверка подписи для пакетов из этого репозитория, но подпись базы данных не проверяется. Если задать здесь значение Optional , то для этого репозитория глобальное значение Required станет недействительно.
Инициализация связки ключей
Для инициализации связки ключей pacman выполните:
Для инициализации необходима энтропия. Чтобы сгенерировать больше энтропии, активно двигайте мышью, нажимайте случайные клавиши или выполняейте действия, связанные с диском (например, запустите в другой консоли ls -R / , find / -name foo или dd if=/dev/sda8 of=/dev/tty7 ). Если энтропия системы недостаточна, этот этап может занять часы; активная генерация энтропии ускорит процесс.
Генерируемая последовательность случайных чисел используется для создания связки ключей ( /etc/pacman.d/gnupg ) и GPG-ключа вашей системы.
Управление связкой ключей
Проверка мастер-ключей
Первоначальная настройка ключей выполняется командой:
При появлении запроса необходимо проверить подлинность мастер-ключей, поскольку они используются для подписи всех пакетов совместно с ключами разработчиков.
PGP-ключи довольно велики (2048 бит или больше), что делает их неудобными для восприятия людьми. Поэтому на основе ключа вычисляется 40-разрядная шестнадцатеричная хэш-сумма, по которой можно проверить его подлинность. Также нужно помнить, что последние восемь цифр хэш-суммы часто используют как имя или (короткий) ID ключа, а последние шестнадцать — как длинный ID ключа.
Добавление ключей разработчика
Ключи официальных разработчиков и доверенных пользователей подписываются мастер-ключами, так что вам не нужно использовать pacman-key, чтобы подписывать их самостоятельно. Когда pacman встречает в подписи пакета ключ, который не удаётся распознать, то предлагает скачать его с сервера ключей, указанного в параметре keyserver в файле /etc/pacman.d/gnupg/gpg.conf или в опции —keyserver командной строки. Перечень серверов ключей можно найти в Википедии.
Ключ разработчика нужно скачать всего единожды, после этого он будет использоваться для проверки любого пакета от этого разработчика.
Добавление неофициальных ключей
Этим способом можно добавить в связку ключей pacman свой ключ или включить подписанный неофициальный репозиторий.
В первую очередь получите у владельца ключа его ID ( keyid ). Добавьте полученный ключ в связку:
- Если ключ находится на сервере ключей, импортируйте его командой:
- Если у вас есть ссылка на файл ключа, скачайте его и выполните:
Всегда старайтесь проверять отпечаток — как мастер-ключей, так любых других ключей, которые вы собираетесь подписать:
Наконец, подпишите импортированный ключ локально:
Теперь этот ключ будет считаться доверенным.
Отладка при помощи gpg
При отладке доступ к связке ключей pacman можно получить напрямую с помощью gpg, например:
Решение проблем
error: signature from xxx is invalid
Эта ошибка связана с gpg. Она означает, что пакет на диске не сооветствует пакету, который был подписан его сопроводителем. Выяснить причину может быть непросто, но в большинстве случаев удаление файла и скачивание его заново решает проблему. И в любом случае, такое сообщение об ошибке свидетельствует о проблеме с gpg и ключами, которые используются для подписывания пакетов.
Ниже приведены три возможных решения. Если вы не уверены, что выбрать, попросите о помощи на форуме.
Удаление старых версий пакетов
Если постоянно возникает проблема с одним и тем же пакетом и вы уверены, что дело не в pacman-key, попробуйте удалить плохой пакет из кэша командой rm /var/cache/pacman/pkg/плохой_пакет* и скачайте его заново.
Удаление пакета из кэша может помочь при ошибке error: linux: signature from » » is invalid , произошедшей при обновлении. Такое сообщение не обязательно является свидетельством атаки «человек-посередине» — возможно, пакет просто был повреждён при скачивании.
Сброс ключей
Для сброса всех установленных в системе ключей необходимо удалить каталог /etc/pacman.d/gnupg . После этого выполните команды pacman-key —init и pacman-key —populate archlinux , чтобы добавить базовый набор ключей заново.
Отключение проверки подписи
Если подписи пакетов вас не интересуют, можно полностью отключить их проверку. Отредактируйте файл /etc/pacman.conf , раскомментировав следующую строку в разделе [options] :
Также необходимо закомментировать все параметры SigLevel в настройках репозиториев, потому что они имеют приоритет над глобальными настройками. В результате подпись пакетов проверяться не будет, как это было в pacman до четвертой версии. В этом случае устанавливать связку ключей при помощи pacman-key не нужно. Позже при необходимости можно будет включить проверку подписи пакетов обратно.
Не удаётся импортировать ключи
- Устаревший пакет archlinux-keyring ;
- Неправильные настройки даты и времени;
- Интернет-провайдер блокирует порт, используемый для импорта PGP-ключей;
- Кэш pacman содержит неподписанные пакеты, оставшиеся с предыдущих попыток;
- Демон dirmngr не был правильно настроен;
- Вы давно не обновлялись и gpg/pacman не справились с обновлением.
Давно не обновлявшийся пакет archlinux-keyring может привести к проблемам при синхронизации обновлений.
Ниже приведено несколько возможных решений.
Обновление системы
Прежде всего попробуйте обновить систему.
Смена сервера ключей
Если вы предполагаете, что проблема связана с сервером ключей, то можно попробовать переключиться на сервер ключей Ubuntu. Отредактируйте файл /etc/pacman.d/gnupg/gpg.conf , изменив значение keyserver :
Удаление кэшированных пакетов
Возможно, кэш pacman в каталоге /var/cache/pacman/pkg/ содержит неподписанные пакеты. Очистите кеш вручную:
что удалит все пакеты в кэше, которые не были установлены.
Не удаётся опознать подпись пакета
Иногда при выполнении pacman -Syu вы можете столкнуться со следующей ошибкой:
Такое происходит, когда ключ создателя пакета отсутствует в локальной базе данных pacman-key или не является доверенным. Pacman не всегда имеет возможность проверить, был ли ключ скачан и является ли он доверенным, перед тем как продолжить обновление. Также возможно, что срок действия ключа истёк.
- обновить ключи командой pacman-key —refresh-keys ;
- вручную подписать недоверенный ключ локально;
- сбросить ключи;
- временно установить параметр SigLevel в значение TrustAll (не рекомендуется).
Источник
Arch Linux
You are not logged in.
#1 2013-12-25 04:30:20
[SOLVED] Invalid or corrupted package (PGP signature)
I’m making this post as a last resort to solving a problem I’m having with the installation of google chrome via pacman. I’ve scoured the forums and duck/google searched to see if I can find anything. Nothing seems to have helped. The integrity of the three packages below is failing.
I’ve tried (all together and separately):
Changing mirrors in /etc/pacman.d/mirrorlist
Updating signature list via
Purging cache and updating lists after the two above bullets with
Updating the hardware clock with
Changing the pacman.conf SigLevel default of «SigLevel = Required DatabaseOptional» to «SigLevel = Never» (I found that this instead converted my PGP signature error into a checksum error. So I don’t think this helps at all)
I’m at a total loss on what the issue may be. Some packages install fine, but chromium (along with firefox earlier) is giving me grief with the PGP signature being the problem, even though all signatures have been up-to-date.
/var/lib/pacman/sync looks normal with only community.db, core.db, and extra.db files (no part files or anything else)
Contents of my pacman.conf:
Last edited by digitally404 (2013-12-26 19:50:15)
#2 2013-12-25 04:49:52
Re: [SOLVED] Invalid or corrupted package (PGP signature)
What’s the output of ‘pacman -Syu —debug’?
#3 2013-12-25 13:04:12
Re: [SOLVED] Invalid or corrupted package (PGP signature)
Updating the hardware clock with
I don’t know if clock time would give these errors (though it could give related issues) but this command would not likely fix the issue if clock time was the problem — so this step doesn’t rule out clock issues.
Pacman uses the system time, not the hardware clock time. The command you issued sets the hardware clock to the system time — if a problem with the latter was suspected, this command wouldn’t change it.
The proper test would be to see that your system clock (including date) is accurate (matches the clock on your wall). The easiest way to do this is with [extra]/ntp.
«UNIX is simple and coherent. » — Dennis Ritchie, «GNU’s Not UNIX» — Richard Stallman
#4 2013-12-26 17:40:10
Re: [SOLVED] Invalid or corrupted package (PGP signature)
Thanks for the responses.
Output of ‘pacman -Syu —debug’ :
(Note: I can’t even upgrade my system now because of the PGP signature error.)
I think my system clock is fine because if I issue ‘$ date’ I get the correct date/time out.
#5 2013-12-26 17:44:36
Re: [SOLVED] Invalid or corrupted package (PGP signature)
Can you post the debug output when you answer
Источник
I’m trying to do a full system upgrade using pacman -Syu
. It says:
:: File /var/cache/pacman/pkg/turbulence-0.3.5-1-any.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
Is there a way to fix this?
asked May 14, 2014 at 18:31
1
There are tons of topics out there that say you should edit the pacman.config
file and remove the PGP key checks entirely but it’s not a good idea.
simply run this command and wait for refreshing your keys by downloading them from the servers:
$ sudo pacman-key --refresh-keys
and then proceed with you full system upgrade sudo pacman -Syu
answered Apr 20, 2015 at 15:10
Arash MilaniArash Milani
6,1092 gold badges41 silver badges47 bronze badges
2
You may also be interested in running pacman-key --populate
if the keys are massively out of date or if the other given answer of pacman-key --refresh-keys
does not work in practice.
answered Aug 29, 2017 at 22:17
Tech1337Tech1337
1,49813 silver badges16 bronze badges
0
I ran into this problem when using a (ridiculously) outdated Arch version.
In case anyone else runs into this while using Docker, you can try downloading a fresh image (docker pull archlinux
) in lieu of directly refreshing the keys.
I think this is useful because the sibling answers did not work for me.
answered Jun 2, 2022 at 0:46
davidvarela_usdavidvarela_us
6,0781 gold badge22 silver badges42 bronze badges
# |
|
Темы: 89 Сообщения: 1126 Участник с: 09 августа 2011 |
Хотелось поиграть, а тут какая-то фигня…
~]$ sudo pacman -S steam разрешение зависимостей... проверка на взаимную несовместимость... Пакеты (1): steam-1.0.0.39-2 Будет загружено: 2,40 MiB Будет установлено: 2,42 MiB :: Приступить к установке? [Y/n] Y :: Получение пакетов ... steam-1.0.0.39-2-i686 2,4 MiB 2,68M/s 00:01 [######################] 100% (1/1) проверка ключей [######################] 100% (1/1) проверяется целостность пакета [######################] 100% ошибка: steam: key "Daniel Wallace <[email protected]>" is disabled :: Файл /var/cache/pacman/pkg/steam-1.0.0.39-2-i686.pkg.tar.xz поврежден (неверный или поврежденный пакет(PGP-подпись)). Хотите его удалить? [Y/n] Y ошибка: не удалось завершить запрос (неверный или поврежденный пакет(PGP-подпись)) Обнаружены ошибки, пакеты не были обновлены. я так понимаю ключевая фраза в этом сообщении: Арчи ~]$ …as always want ready-made solutions that would make even tastier |
Perfect_Gentleman |
# |
Темы: 55 Сообщения: 1039 Участник с: 29 октября 2012 |
sudo pacman-key —edit-key «Daniel Wallace <[email protected]>» > enable > save > quit может ещё понадобится |
palpalych |
# |
Темы: 89 Сообщения: 1126 Участник с: 09 августа 2011 |
чё то понажимал путем перебора и вроде как заработало, единственное не понял как, ну да ладно, спасибо за подсказку
Арчи ~]$ …as always want ready-made solutions that would make even tastier |
nextdrift |
# |
Темы: 2 Сообщения: 14 Участник с: 15 июня 2013 |
спасибо |
kotnaton |
# |
Темы: 52 Сообщения: 208 Участник с: 28 июня 2012 |
Спасибо ! Возникла вчера точно такая же неприятность с пакетом community/confuse. Помогло после refresh-keys. |
Max-Sk |
# (отредактировано 6 лет, 6 месяцев назад) |
Темы: 6 Сообщения: 37 Участник с: 27 октября 2015 |
объясню подробнее комментарий выше (kotnaton), так как я не сразу понял что, и куда вводить
Решение:
Команда выше обновляет ключи разработчиков (ссылка в arch wiki).
Выдалось такое сообщение:
|
Aivar |
# (отредактировано 6 лет, 6 месяцев назад) |
Темы: 4 Сообщения: 6897 Участник с: 17 февраля 2011 |
Кому? Если себе, то не было никакой необходимости писать об этом на форуме. Заведите блокнот и заносите туда свои озарения. |
Max-Sk |
# |
Темы: 6 Сообщения: 37 Участник с: 27 октября 2015 |
Данный вопрос Вы могли бы задать и в личном сообщении, не увеличивая размер форума. |