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:
.