You are not logged in.

#1 2023-10-21 17:03:35

yogansh
Member
Registered: 2023-10-21
Posts: 7

Pacman not working after using pyenv

I get this output when I run pacman with PATH having /bin or /sbin

$ sudo pacman
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

This error started happening after I pasted this in my profile and continued happening even after removing this and uninstalling pyenv

export PYENV_ROOT="$HOME/.local/pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"

Last edited by yogansh (2023-10-21 17:08:14)

Offline

#2 2023-10-21 17:06:53

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,645

Re: Pacman not working after using pyenv

type -a pacman

Offline

#3 2023-10-21 17:10:28

yogansh
Member
Registered: 2023-10-21
Posts: 7

Re: Pacman not working after using pyenv

$ type -a pacman
pacman is /sbin/pacman
pacman is /bin/pacman
pacman is /usr/bin/pacman
pacman is /usr/sbin/pacman

Last edited by yogansh (2023-10-21 17:11:09)

Offline

#4 2023-10-21 17:15:21

yogansh
Member
Registered: 2023-10-21
Posts: 7

Re: Pacman not working after using pyenv

Everything seems to be fine if I set PATH to /usr/bin

$ PATH="/usr/bin" sudo pacman --version

 .--.                  Pacman v6.0.2 - libalpm v13.0.2
/ _.-' .-.  .-.  .-.   Copyright (C) 2006-2021 Pacman Development Team
\  '-. '-'  '-'  '-'   Copyright (C) 2002-2006 Judd Vinet
 '--'
                       This program may be freely redistributed under
                       the terms of the GNU General Public License.

Offline

#5 2023-10-22 02:50:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,645

Re: Pacman not working after using pyenv

wait, I bet it sudo, not pacman. type -a sudo.

Offline

#6 2023-10-22 04:29:59

yogansh
Member
Registered: 2023-10-21
Posts: 7

Re: Pacman not working after using pyenv

Scimmia wrote:

wait, I bet it sudo, not pacman. type -a sudo.

$ type -a sudo
sudo is /sbin/sudo
sudo is /bin/sudo
sudo is /usr/bin/sudo
sudo is /usr/sbin/sudo

Yes, It seems like it is sudo.

$ sudo ls  
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

Last edited by yogansh (2023-10-22 04:30:39)

Offline

#7 2023-10-22 09:18:28

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,846

Re: Pacman not working after using pyenv

/sbin ,  /bin and /usr/sbin are supposed to  be symlinks , it looks like they are regular folders on your system .

Please post the output of

ls -l /usr/sbin /bin /sbin

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#8 2023-10-22 11:11:02

yogansh
Member
Registered: 2023-10-21
Posts: 7

Re: Pacman not working after using pyenv

Lone_Wolf wrote:

/sbin ,  /bin and /usr/sbin are supposed to  be symlinks , it looks like they are regular folders on your system .

Please post the output of

ls -l /usr/sbin /bin /sbin
$ ls -l /usr/sbin /bin /sbin
lrwxrwxrwx 1 root root 7 Sep 18 18:48 /bin -> usr/bin
lrwxrwxrwx 1 root root 7 Sep 18 18:48 /sbin -> usr/bin
lrwxrwxrwx 1 root root 3 Sep 18 18:48 /usr/sbin -> bin

Offline

#9 2023-10-22 12:43:47

yogansh
Member
Registered: 2023-10-21
Posts: 7

Re: Pacman not working after using pyenv

I was using Howdy. Removing this line from /etc/pam.d/sudo solved this

auth sufficient pam_python.so /lib/security/howdy/pam.py

But I still want to continue using howdy.

Offline

#10 2023-10-22 13:44:22

loqs
Member
Registered: 2014-03-06
Posts: 18,823

Re: Pacman not working after using pyenv

yogansh wrote:
auth sufficient pam_python.so /lib/security/howdy/pam.py

But I still want to continue using howdy.

You do not consider it a vulnerability that by adjusting $PATH you control the interpreter that loads /lib/security/howdy/pam.py and therefore can control the result from /lib/security/howdy/pam.py by using a specially crafted executable?

Offline

#11 2023-10-22 14:25:32

yogansh
Member
Registered: 2023-10-21
Posts: 7

Re: Pacman not working after using pyenv

loqs wrote:

You do not consider it a vulnerability that by adjusting $PATH you control the interpreter that loads /lib/security/howdy/pam.py and therefore can control the result from /lib/security/howdy/pam.py by using a specially crafted executable?

That is how the arch wiki does it https://wiki.archlinux.org/title/Howdy# … hen_needed

Offline

#12 2023-10-22 14:32:38

loqs
Member
Registered: 2014-03-06
Posts: 18,823

Re: Pacman not working after using pyenv

yogansh wrote:
loqs wrote:

You do not consider it a vulnerability that by adjusting $PATH you control the interpreter that loads /lib/security/howdy/pam.py and therefore can control the result from /lib/security/howdy/pam.py by using a specially crafted executable?

That is how the arch wiki does it https://wiki.archlinux.org/title/Howdy# … hen_needed

Does that mean because it is in the Arch wiki you do not consider it to be a security issue?

Offline

#13 2023-10-22 14:42:20

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,791

Re: Pacman not working after using pyenv

The wiki also wrote:

Note: When using Howdy 3.0.0 BETA and above (howdy-beta-gitAUR), the line should be:

auth sufficient /lib/security/pam_howdy.so

I'd look into that instead…

Online

#14 2023-10-22 14:47:22

loqs
Member
Registered: 2014-03-06
Posts: 18,823

Re: Pacman not working after using pyenv

Offline

#15 2023-10-22 15:08:25

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,791

Re: Pacman not working after using pyenv

Oh, and to defend the wiki: it doesn't say anything about adding that to sudo and your ability to impact the interpreter path before logging in is rather limited.

Online

#16 2023-10-23 02:56:54

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,645

Re: Pacman not working after using pyenv

If you want to use something that relies on the system python, how about not completely overriding the system python?

Offline

Board footer

Powered by FluxBB