Ubuntu:如何安装flex来制作postgres?

时间:2022-09-23 09:46:28

I'm trying to work on postgresql locally with ubuntu 10.04. I get this error after I configure with

我正在尝试使用ubuntu 10.04在本地处理postgresql。我在配置之后会得到这个错误

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

when I make && 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 to

我试着

apt-get install flex but I get the same error. How can I install flex so that this will work?

apt-get安装flex,但我有同样的错误。如何安装flex以使其正常工作?

3 个解决方案

#1


16  

You need to run ./configure again so that the make files are "aware" of flex.

您需要再次运行。/配置,使make文件“意识到”flex。

#2


2  

You can install postgresql directly using:

您可以直接使用以下工具安装postgresql:

sudo apt-get install postgresql-8.4

I don't understand how you could get the same error if you ran:

我不明白如果你跑的话,你怎么能得到同样的错误:

sudo apt-get install flex

mypc:~/> sudo apt-get install flex

mypc:~/> sudo apt-get install flex

Reading package lists... Done

阅读包列表…完成

Building dependency tree

构建依赖关系树

Reading state information... Done

阅读状态信息…完成

Suggested packages:

建议方案:

bison

野牛

The following NEW packages will be installed:

将安装以下新包:

flex

flex

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

0升级,1新安装,0删除,0未升级。

Need to get 261kB of archives.

需要获得261kB的档案。

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

在此操作之后,将使用1032kb的额外磁盘空间。

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

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

Fetched 261kB in 1s (247kB/s)

在1小时内取回261kB (247kB/s)

Selecting previously deselected package flex.

选择先前取消选择的包flex。

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

(阅读数据库……208958当前安装的文件和目录。

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

解包flex(从…/flex_2.5.35-9_amd64.deb)…

Processing triggers for install-info ...

为安装信息处理触发器…

Processing triggers for man-db ...

对于man-db的处理触发器…

Setting up flex (2.5.35-9) ...

安装flex(2.5.35-9)…

Because this package doesn't build anything. When I run the above command under KUbuntu 10.04, I get the following output:

因为这个包不构建任何东西。当我在kubuntu10.04下运行上述命令时,我得到以下输出:

.

#3


0  

The configure script should have four lines which 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 these?

你看到这些吗?

#1


16  

You need to run ./configure again so that the make files are "aware" of flex.

您需要再次运行。/配置,使make文件“意识到”flex。

#2


2  

You can install postgresql directly using:

您可以直接使用以下工具安装postgresql:

sudo apt-get install postgresql-8.4

I don't understand how you could get the same error if you ran:

我不明白如果你跑的话,你怎么能得到同样的错误:

sudo apt-get install flex

mypc:~/> sudo apt-get install flex

mypc:~/> sudo apt-get install flex

Reading package lists... Done

阅读包列表…完成

Building dependency tree

构建依赖关系树

Reading state information... Done

阅读状态信息…完成

Suggested packages:

建议方案:

bison

野牛

The following NEW packages will be installed:

将安装以下新包:

flex

flex

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

0升级,1新安装,0删除,0未升级。

Need to get 261kB of archives.

需要获得261kB的档案。

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

在此操作之后,将使用1032kb的额外磁盘空间。

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

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

Fetched 261kB in 1s (247kB/s)

在1小时内取回261kB (247kB/s)

Selecting previously deselected package flex.

选择先前取消选择的包flex。

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

(阅读数据库……208958当前安装的文件和目录。

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

解包flex(从…/flex_2.5.35-9_amd64.deb)…

Processing triggers for install-info ...

为安装信息处理触发器…

Processing triggers for man-db ...

对于man-db的处理触发器…

Setting up flex (2.5.35-9) ...

安装flex(2.5.35-9)…

Because this package doesn't build anything. When I run the above command under KUbuntu 10.04, I get the following output:

因为这个包不构建任何东西。当我在kubuntu10.04下运行上述命令时,我得到以下输出:

.

#3


0  

The configure script should have four lines which 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 these?

你看到这些吗?