Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I built a package with the sudo-ldap package defined as a dependency in the control file (please see below). I'm going to have people install using the gdebi command to install which should install the package and any required dependencies. Unfortunately, this will require the export SUDO_FORCE_REMOVE=yes variables to be set or the sudo-ldap package will not be installed and will error out the entire package install. How do I define an environment variable for the whole package creation. My ultimate goal is to have a user install this package without having to manually define environment variables...I know I can call this package with a script, but I'd rather not do that.

Depends: ${misc:Depends} ldap-utils,sudo-ldap

Thanks so much in advance.

share|improve this question
Anyone have any suggestions...pretty please with a cherry on top :). I want to have an unattended install without having to put in any shell environment variables before installing the package. – user2175757 Mar 27 '13 at 16:30

Best I can suggest is two debs. The first one lobotomises sudo's prerm script. The second one depends on sudo-ldap. This approach wouldn't work with APT (installing both in one run) because there's no guarantee that the lobotomisation package would be installed first. However, if driven through gdebi, it should work.

Do you actually need sudo-ldap? Normal sudo works with LDAP, it just doesn't get the sudoers configuration from LDAP...

share|improve this answer
Hmmm..that's ugly. Perhaps my less than ideal option for a wrapper script is necessary. I do need sudo-ldap since we pull sudo information from ldap. Thanks for the help! – user2175757 Mar 27 '13 at 22:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.