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


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


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

  • What is apt-fast? github.com/ilikenwf/apt-fast ? – derobert Aug 2 '17 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. – Gilles Aug 2 '17 at 21:58
  • Will it work if you add this to /etc/sudoers: Defaults env_keep="DEBUG" – hschou Aug 3 '17 at 5:09
  • @derobert yes, apt-fast is multithreaded apt-get – spam Aug 3 '17 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 '17 at 10:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.