2010-09-30 94 views
6

我想在Ubuntu 10.04本地工作postgresql。我得到這個錯誤後,我與Ubuntu:如何安裝flex來創建postgres?

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

配置時,我讓& & make install的我得到這個錯誤:

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 

我試圖

apt-get install flex但我得到相同的錯誤。我如何安裝flex以使其可以工作?

回答

2

您可以直接使用安裝PostgreSQL:

sudo apt-get install postgresql-8.4 

我不明白,如果你跑,你如何能得到同樣的錯誤:

sudo apt-get install flex 

MYPC:〜/> sudo易於得到安裝flex

正在讀取軟件包列表...完成

構建依賴項樹

讀取狀態信息...完成

建議安裝的軟件包:

野牛

下列新軟件包將被安裝:

柔性

0升級,1新裝,0刪除和0未升級。

需要獲得261kB的檔案。

執行此操作後,將使用1,032kB的額外磁盤空間。

得到:1 http://us.archive.ubuntu.com/ubuntu/清醒/主撓曲2.5.35-9 [261KB]

擷取的261KB在1秒(247KB /秒)

選擇先前取消選擇的軟件包彎曲。

(讀取數據庫... 208958個文件和目錄當前安裝的。)

開箱彎曲(從.../flex_2.5.35-9_amd64.deb)...

處理觸發器install-信息...

處理觸發器人-DB ...

設置柔性(2.5.35-9)...

因爲這個軟件包不會構建任何東西。當我在KUbuntu 10.04下運行上述命令時,我得到以下輸出:

+0

我需要能夠編輯pg源碼然後重新生成 – James 2010-09-30 05:23:55

+0

運行時會出現什麼錯誤:'sudo apt-get install flex'?請包括確切的回報。 – 2010-09-30 05:40:27

+0

正確安裝:解壓Flex(從.../flex_2.5.35-9_i386.deb)... 處理安裝信息的觸發器... 處理man-db的觸發器... 設置flex(2.5 .35-9)..但我得到同樣的錯誤,當我嘗試使&&使安裝 – James 2010-09-30 05:46:00

0

配置腳本應該有其讀四行:

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

你看到這些?

16

您需要再次運行./configure以使make文件「知道」flex。

+0

謝謝!它擺脫了'錯誤:您的系統上缺少flex'。 – 2013-10-28 13:38:34

+0

謝謝。這個答案解決了我的問題,同樣的錯誤,但在我的情況下,不彎曲,它的野牛。 – Suniel 2016-09-30 08:50:14