Ubuntu: how to install flex to create postgres?

I am trying to work with postgresql locally using ubuntu 10.04. I get this error after setting using

./configure --enable-cassert --enable-debug --prefix=$HOME/pgsql 

when I do && & make install I get this error:

 make -C parser all make[3]: Entering directory `/home/james/school/db/pg-stuff/hw1/postgresql-8.4.2/src/backend/parser' 

 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. 

 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 

I tried

apt-get install flex , but I get the same error. How can I install flex for this to work?

+6
flex-lexer postgresql ubuntu
source share
3 answers

You need to run ./configure again so that the make files “know” flex.

+16
source share

You can install postgresql directly using:

 sudo apt-get install postgresql-8.4 

I do not understand how you can get the same error if you run:

 sudo apt-get install flex 

mypc: ~ / "> sudo apt-get install flex

Reading package lists ... Done

Creating a dependency tree

Reading Status Information ... Achieved

Suggested packages:

bison

The following NEW packages will be installed:

bends

0 updated, 1 re-installed, 0 removed and 0 not updated.

You need to get 261 KB of archives.

After this operation, 1,032 KB of additional disk space will be used.

Get: 1 http://us.archive.ubuntu.com/ubuntu/ lucid / main flex 2.5.35-9 [261kB]

Received 261 KB in 1 s (247 KB / s)

Select a previously canceled flex package.

(Reading the database ... 208958 files and directories currently installed.)

Unpacking flex (from ... / flex_2.5.35-9_amd64.deb) ...

Handling triggers for install-info ...

Processing triggers for man-db ...

Setting flex (2.5.35-9) ...

Because this package does not create anything. When I run the above command under KUbuntu 10.04, I get the following output:

.

+2
source share

The script configuration should have four lines that are read:

 checking for bison... bison configure: using bison (GNU Bison) 2.4.1 checking for flex... /usr/bin/flex configure: using flex 2.5.35 

Do you see them?

0
source share

All Articles