title: Apt-get commands from within a deb postinst
body: <p>I have a deb package that I've created.  From the postinst script, I would like to  run:</p>
  
  <pre><code>apt-get update
  </code></pre>
  
  <p>The package adds a proxy to the apt system by dropping a file in /etc/apt/apt.conf.d/.  I would like to force the apt system to do the equivalent of "apt-get update".  However, I cannot run that command directly from postinst, since the apt lock file has already been placed by dpkg which is installing this package!  Is there some debconf tools/commands to do this?</p>
  
  <p>As a bonus, I would love to be able to remove a package from within preinst/postinst:</p>
  
  <pre><code>apt-get remove popularitycontest
  </code></pre>
  
  <p>NOTE - this package is for an internal project - not a deb that will ever be released into the wild or submitted to Debian.</p>