You are not logged in.

#1 2023-03-23 10:26:11

hotpocker-devourer
Member
Registered: 2023-03-23
Posts: 3

Pacman is broken *only* inside of terminal emulator, yet works in TTY

Hello!

I have been banging my head for the past 6 hours trying to fix my pacman so I can install a new package.
I am trying to install Gimp... however when I do "sudo pacman -S gimp" it fails with this output:

❯ sudo pacman -S gimp
resolving dependencies...
looking for conflicting packages...

Packages (1) gimp-2.10.34-1

Total Installed Size:  113.40 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                                [#################################] 100%
downloading required keys...
:: Import PGP key 6D42BDD116E0068F, "Christian Hesse <eworm@archlinux.org>"? [Y/n] Y
error: key "6D42BDD116E0068F" could not be looked up remotely
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

This lead me down a big rabbit hole of trying to refresh my keys.
What I did:

sudo pacman-key --init
sudo pacman-key --populate arch-linux
sudo pacman-key --refresh-keys
sudo pacman -S archlinux-keyring

All of the above steps worked until the last command... which gave the following error:

❯ sudo pacman -S archlinux-keyring
warning: archlinux-keyring-20230320-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) archlinux-keyring-20230320-1

Total Installed Size:  1.61 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                                [#################################] 100%
downloading required keys...
:: Import PGP key 6D42BDD116E0068F, "Christian Hesse <eworm@archlinux.org>"? [Y/n] Y
error: key "6D42BDD116E0068F" could not be looked up remotely
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

Now I got a little confused here as I had *just* refreshed my keys! So I did "sudo pacman --list-keys eworm@archlinux.org"
with the following ouput:

 ❯ sudo pacman-key --list-keys eworm@archlinux.org
pub   rsa2048 2011-08-12 [SC]
      02FD1C7A934E614545849F19A6234074498E9CEE
uid           [  full  ] Christian Hesse <eworm@archlinux.org>
uid           [marginal] Christian Hesse (Arch Linux Package Signing) <arch@eworm.de>
sub   rsa2048 2011-08-12 [E]
sub   ed25519 2019-08-29 [S]
sub   cv25519 2019-08-29 [E]

Now I was **really** confused as the key is indeed on the keyring... this lead me to try it in my TTY.
Suprise! It works, I can install GIMP and reinstall arhclinux-keyring through the TTY!
Keep in mind this is on the SAME user account... so no difference except trying this through the terminal emulator.
Just for reference I am using:
Wayland
Hyprland - Wayland Compositor / Tiling Window Manger
Kitty - Terminal Emulator

I think it may be a problem with kitty?
I am honestly dumbfounded, I am a 3rd year computer science student and I have NO IDEA what I am doing wrong here. I have only been programming/using linux for about 4 years and this is baffling.

If anyone has any ideas or anything that could maybe help you diagnose my issue, I will keep a close tab on this topic.

Thank you so much.

Offline

#2 2023-03-23 13:54:34

seth
Member
Registered: 2012-09-03
Posts: 51,029

Re: Pacman is broken *only* inside of terminal emulator, yet works in TTY

"[sudo] printenv" differences?
Network related co·in·ci·dence? Is this deterministically reproducible?

Online

#3 2023-03-23 18:28:38

hotpocker-devourer
Member
Registered: 2023-03-23
Posts: 3

Re: Pacman is broken *only* inside of terminal emulator, yet works in TTY

Rebooted the system this morning after a full router reset... still happening. I don't think its network related? I can connect to the internet regardless within the terminal emulator (ping google.com works).

Here is the diff between the 2 printenv's:

❯ diff te-printenv.txt tty-printenv.txt
1c1,2
< DISPLAY=
---
> PATH=/home/dan/.nvm/versions/node/v19.8.1/bin:/home/dan/.local/bin/:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/dan/.fzf/bin
> TERM=linux
4,7d4
< XDG_CURRENT_DESKTOP=Hyprland
< TERM=xterm-kitty
< PATH=/home/dan/.local/bin/:/home/dan/.nvm/versions/node/v19.8.1/bin:/home/dan/.local/bin/:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/dan/.fzf/bin
< COLORTERM=truecolor

Offline

#4 2023-03-23 18:38:12

hotpocker-devourer
Member
Registered: 2023-03-23
Posts: 3

Re: Pacman is broken *only* inside of terminal emulator, yet works in TTY

Also, did some more researching... tried a new terminal emulator same error. (tried alacritty)

Tried switching shell's over to bash and same error. (am using zsh as a daily driver)

Offline

#5 2023-03-23 19:22:26

seth
Member
Registered: 2012-09-03
Posts: 51,029

Re: Pacman is broken *only* inside of terminal emulator, yet works in TTY

ls -la /home/dan/.local/bin/

Online

#6 2023-03-23 19:46:46

3beb6e7c46a615a
Member
Registered: 2021-03-27
Posts: 165

Re: Pacman is broken *only* inside of terminal emulator, yet works in TTY

Did you use "sudo" in both cases?  If not then perhaps the output of "sudo -l", to see what environment variables you propagate across sudo.

And also the output of "pacman-key -l" in both cases.

Offline

#7 2023-03-27 13:43:59

cmiles74
Member
Registered: 2011-10-16
Posts: 8

Re: Pacman is broken *only* inside of terminal emulator, yet works in TTY

I think the problem here is that you have the DISPLAY variable in your environment sent to an empty value.

❯ diff te-printenv.txt tty-printenv.txt
1c1,2
< DISPLAY=

I am wondering: if you remove the DISPLAY variable with "unset DISPLAY", does pacman work as expected?

[cmiles@friday ~]$ sudo pacman -Syu imagemagick
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
warning: imagemagick-7.1.1.5-1 is up to date -- reinstalling
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (1) imagemagick-7.1.1.5-1

Total Installed Size:  21.70 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                                                       [------------------------------------------------------------] 100%
downloading required keys...
:: Import PGP key 7A4E76095D8A52E4, "Antonio Rojas <arojas@archlinux.org>"? [Y/n] y
error: key "7A4E76095D8A52E4" could not be looked up remotely
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

[cmiles@friday ~]$ unset DISPLAY
[cmiles@friday ~]$ sudo pacman -Syu imagemagick
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
warning: imagemagick-7.1.1.5-1 is up to date -- reinstalling
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (1) imagemagick-7.1.1.5-1

Total Installed Size:  21.70 MiB
Net Upgrade Size:       0.00 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) reinstalling imagemagick                                                                       [------------------------------------------------------------] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Warn about old perl modules

Offline

#8 2023-03-27 13:51:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Pacman is broken *only* inside of terminal emulator, yet works in TTY

WTF?

I was about to comment on how nonsensical that was as pacman doesn't / shouldn't care at all about whether or not DISPLAY is set.  But I confirmed that setting DISPLAY to an empty string causes pacman to fail for me as well.

This really looks like a pacman edit:gnupg bug.

EDIT: okay, perhaps not pacman itself, but gnupg.  That's less surprising: gnu software making absurd assumptions about the environment it's running in that leads to total failure is much more of the norm.

Last edited by Trilby (2023-03-27 13:56:36)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

#9 2023-03-27 14:05:58

seth
Member
Registered: 2012-09-03
Posts: 51,029

Re: Pacman is broken *only* inside of terminal emulator, yet works in TTY

cmiles74 actually had confirmed that in his on thread about the same problem…
The condition is so wild that if wl compositors now increasingly set bogus DISPLAYs, we might need https://wiki.archlinux.org/title/Pacman … leshooting to specifically mention this.

Online

#10 2023-03-27 15:08:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: Pacman is broken *only* inside of terminal emulator, yet works in TTY

Or just report bugs to the buggy software, both those compositors and gnupg.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Online

Board footer

Powered by FluxBB