2

I have created few aliases, that I source to shell:

alias apti="apt-fast install -y"
alias aptr="apt-fast remove -y"
alias aptp="apt-fast purge -y"
alias apts="aptitude search"
alias aptu="sudo dpkg --configure -a; apti -f; apt-fast update; apt-fast upgrade -y; apt-fast full-upgrade -y; apt-fast autoremove -y"

and then added exceptions to /etc/sudoers:

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

Cmnd_Alias APT=/usr/local/bin/apt
Cmnd_Alias DPKG=/usr/bin/dpkg
Cmnd_Alias APTGET=/usr/bin/apt-get
Cmnd_Alias APTITUDE=/usr/bin/aptitude
Cmnd_Alias APTFAST=/usr/sbin/apt-fast
Cmnd_Alias PM_SUSPEND=/usr/sbin/pm-suspend

myuser ALL=(ALL:ALL) NOPASSWD: APT, DPKG, APTGET, APTITUDE, PM_SUSPEND, APTFAST

and it worked fine for years. But few weeks ago (linux mint update?) it started giving me error.

$ apti iridium-browser 
sudo: sorry, you are not allowed to set the following environment variables: DEBUG, LCK_FILE, DOWNLOADBEFORE, _APTMGR, APTCACHE, DLDIR, DLLIST, LISTDIR, _MAXNUM, _MAXCONPERSRV, _SPLITCON, _MINSPLITSZ, _PIECEALGO, aptfast_prefix, APT_FAST_TIMEOUT

In /etc/sudoers.d I have two files: README and mintupdate. I have not edited any of them. Only not commented lines are:

Cmnd_Alias UPDATE = /usr/lib/linuxmint/mintUpdate/checkAPT.py

ALL ALL = NOPASSWD:UPDATE

As far as I can see, I am not setting any environment variables that are lissted. What am I doing wrong?

7
  • What is apt-fast? github.com/ilikenwf/apt-fast ?
    – derobert
    Aug 2, 2017 at 21:17
  • Please post your whole sudo configuration (/etc/sudoers and files in /etc/sudoers.d. Also tell us how apt-fast calls sudo. Aug 2, 2017 at 21:58
  • Will it work if you add this to /etc/sudoers: Defaults env_keep="DEBUG"
    – hschou
    Aug 3, 2017 at 5:09
  • @derobert yes, apt-fast is multithreaded apt-get
    – spam
    Aug 3, 2017 at 10:36
  • @Gilles I have added full /etc/sudoers.d and non commented lines from all files in /etc/sudoers.d
    – spam
    Aug 3, 2017 at 10:36

1 Answer 1

0

I also got this error message when executing "sudo command" as a process in a lazarus program, but when I changed it to "/usr/bin/sudo command" it worked ok without the error, so it seems, in my case, that it is the missing path to 'sudo' that generates the error.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .