Skip to content

Conversation

@tclementdev
Copy link

@tclementdev tclementdev commented Dec 9, 2025

This fixes an issue on Linux when using sudo which causes the pkgx directory to be located inside the root user home directory. This seems to be due to differences in how operating systems deal with sudo and the HOME environment variable. On macOS, the HOME variable is set to the home directory of the user calling the sudo command, but on Fedora it is set to the root user home directory. By using SUDO_HOME if it set, we fix the Linux behavior to be the same as on macOS.

Together with this other PR in pkgm, this fixes calling sudo pkgm install <package> on Linux to install packages to /usr/local/bin. See full discussion for more information.

… is set. Without this, we might work on the root user directory (as seen on Linux).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant