title: How to install dependencies while creating a .deb installer?
body: <p>I have created a <code>deb</code> package say <code>abc.deb</code>. Now there are few dependencies like <code>python-dev, python-mysql</code> etc., which are needed to be installed as a part of deb installation itself.</p>
  
  <p>(i.e. when user runs <code>dpkg -i abc.deb</code>, the dependencies should also get installed automatically).</p>
  
  <p>I am using a <code>control</code> file which contains few parameters like <code>preinst, postinst</code> etc. I tried to add <code>Depends</code> to the control file, but I guess, <code>Depends</code> only stops package installation if dependencies mentioned are not present. How could I install the dependencies as a part of deb package installation itself? I am looking for a solution that will work on <code>Ubuntu 12.04</code>.</p>
  
  <p>P.S. When I try to install dependencies in my <code>postinst</code> script as </p>
  
  <pre><code>sudo apt-get install python-dev -y
  </code></pre>
  
  <p>I gives me an error: </p>
  
  <pre><code>E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) 
  E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?`
  </code></pre>