diff --git a/pkg/packagemanager/install.go b/pkg/packagemanager/install.go index cea9d95..48c1199 100644 --- a/pkg/packagemanager/install.go +++ b/pkg/packagemanager/install.go @@ -165,13 +165,6 @@ func CloneAndInstallFromAUR(repoURL string, skipConfirmation bool) (string, erro return "", fmt.Errorf("error changing directory: %v", err) } - // Get the username of the user who invoked sudo - sudoUser := os.Getenv("SUDO_USER") - if sudoUser == "" { - logger.Errorf("cannot determine the non-root user to run makepkg") - return "", fmt.Errorf("cannot determine the non-root user to run makepkg") - } - // Build the package using makepkg as the non-root user cmdMakePkg := exec.Command("makepkg", "-si", "--noconfirm") cmdMakePkg.Env = []string{"HOME=" + usr.HomeDir, "USER=" + usr.Username, "LOGNAME=" + usr.Username}