title: Ubuntu: how to install flex to make postgres?
body: <p>I'm trying to work on postgresql locally with ubuntu 10.04. I get this error after I configure with</p>
  
  <pre><code>./configure --enable-cassert --enable-debug --prefix=$HOME/pgsql
  </code></pre>
  
  <p>when I make &amp;&amp; make install I get this error:</p>
  
  <pre><code>make -C parser all
  make[3]: Entering directory `/home/james/school/db/pg-stuff/hw1/postgresql-8.4.2/src/backend/parser'
  </code></pre>
  
  <hr>
  
  <pre><code>ERROR: `flex' is missing on your system. It is needed to create the
  file `scan.c'. You can either get flex from a GNU mirror site
  or download an official distribution of PostgreSQL, which contains
  pre-packaged flex output.
  </code></pre>
  
  <hr>
  
  <pre><code>make[3]: *** [scan.c] Error 1
  make[3]: Leaving directory `/home/james/school/db/pg-stuff/hw1/postgresql-8.4.2/src/backend/parser'
  make[2]: *** [parser-recursive] Error 2
  make[2]: Leaving directory `/home/james/school/db/pg-stuff/hw1/postgresql-8.4.2/src/backend'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `/home/james/school/db/pg-stuff/hw1/postgresql-8.4.2/src'
  make: *** [all] Error 2
  </code></pre>
  
  <p>I tried to</p>
  
  <p><code>apt-get install flex</code> but I get the same error. How can I install flex so that this will work? </p>