GentooemergeUSE安裝postgresql

來源:互聯網
上載者:User

本文以安裝postgreSQL為例說明了Gentoo Linux 安裝 軟體的一般方法,同時總結了USE flag. 

1.運行 emerge -pv postgresql-server 看下USE

[plain] view plaincopyprint?# emerge -pv postgresql-server
 These are the packages that would be merged, in order:
 Calculating dependencies... done![ebuild N ] dev-db/postgresql-server-9.3.3 USE="nls pam xml -doc -perl -pg_legacytimestamp -python (-selinux) -tcl -uuid" LINGUAS="-af -cs -de -en -es -fa -fr -hr -hu -it -ko -nb -pl -pt_BR -ro -ru -sk -sl -sv -tr -zh_CN -zh_TW" 3 kB
Total: 1 package (1 new), Size of downloads: 3 kB

------------------------------------------------------

【附】Gentoo USE:

USE的簡單理解如下:一個軟體不只包含軟體本身,還包括其組件,如,文檔,外掛程式,GUI支援等。USE就是用來標記是否要安裝軟體的同時安裝這些組件。

臨時USE : USE="-java" emerge seamonkey

USE flag的顏色
紅色:enable
藍色:前面會帶一個”-”,表示disable。
綠色:enable但是還沒有邊進去的use flag
黃色:上一個版本沒有,這一個版本新加入的use flag
括弧():在你的平台上禁用的use flag

------------------------------------------------------

設定 USE="python" LINGUAS="en zh_CN"

[plain] view plaincopyprint?# USE="python" LINGUAS="en zh_CN" emerge -pv postgresql-server
 These are the packages that would be merged, in order:
 Calculating dependencies... done![ebuild N ] dev-db/postgresql-server-9.3.3 USE="nls pam python xml -doc -perl -pg_legacytimestamp (-selinux) -tcl -uuid" LINGUAS="en zh_CN -af -cs -de -es -fa -fr -hr -hu -it -ko -nb -pl -pt_BR -ro -ru -sk -sl -sv -tr -zh_TW" 3 kB

Total: 1 package (1 new), Size of downloads: 3 kB

運行: USE="python" LINGUAS="en zh_CN" emerge postgresql-server 安裝postgresql-server

[plain] view plaincopyprint?USE="python" LINGUAS="en zh_CN" emerge postgresql-server 等待安裝(我安的時候比較費時。。) [plain] view plaincopyprint?* If you have users and/or services that you would like to utilize the* socket, you must add them to the 'postgres' system group:
* usermod -a -G postgres <user>*
* Before initializing the database, you may want to edit PG_INITDB_OPTS* so that it contains your preferred locale in:
* /etc/conf.d/postgresql-9.3*
* Then, execute the following command to setup the initial database* environment:* emerge --config =dev-db/postgresql-server-9.3.3gt;>> Auto-cleaning packages...

按照提示編輯 /etc/conf.d/postgresql-9.3 (可以直接使用預設,不做任何更改,遇到問題了再改)

[plain] view plaincopyprint?
# 設定檔位置PGDATA="/etc/postgresql-9.3/"

# 資料存放目錄/to be created
DATA_DIR="/var/lib/postgresql/9.3/data"# 可選 選項PG_INITDB_OPTS="--locale=en_US.UTF-8" 按照提示,運行:emerge --config =dev-db/postgresql-server-9.3.3 [plain] view plaincopyprint?
# emerge --config =dev-db/postgresql-server-9.3.3........
* The autovacuum function, which was in contrib, has been moved to the main* PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled
* by default. You can disable it in the cluster's:* /etc/postgresql-9.3/postgresql.conf
** The PostgreSQL server, by default, will log events to:
* /var/lib/postgresql/9.3/data/postmaster.log*
* You should use the '/etc/init.d/postgresql-9.3' script to run PostgreSQL* instead of 'pg_ctl'. 然後,繼續安裝上條命令完成時的提示(You should use the '/etc/init.d/postgresql-9.3' script to run PostgreSQL):

啟動postgreSQL服務:/etc/init.d/postgresql-9.3 start

[plain] view plaincopyprint?# /etc/init.d/postgresql-9.3 start* Caching service dependencies ... [ ok ]
* /var/run/postgresql: creating directory* /var/run/postgresql: correcting owner
* Starting PostgreSQL ... [ ok ]
[plain] view plaincopyprint?# psql -U postgrespsql (9.3.3)
Type "help" for help.
postgres=# \lList of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgrestemplate1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres(3 rows)

postgres=#

1.運行 emerge -pv postgresql-server 看下USE

[plain] view plaincopyprint?
# emerge -pv postgresql-server
 These are the packages that would be merged, in order:
 Calculating dependencies... done![ebuild N ] dev-db/postgresql-server-9.3.3 USE="nls pam xml -doc -perl -pg_legacytimestamp -python (-selinux) -tcl -uuid" LINGUAS="-af -cs -de -en -es -fa -fr -hr -hu -it -ko -nb -pl -pt_BR -ro -ru -sk -sl -sv -tr -zh_CN -zh_TW" 3 kB

Total: 1 package (1 new), Size of downloads: 3 kB

------------------------------------------------------

【附】Gentoo USE:

USE的簡單理解如下:一個軟體不只包含軟體本身,還包括其組件,如,文檔,外掛程式,GUI支援等。USE就是用來標記是否要安裝軟體的同時安裝這些組件。

臨時USE : USE="-java" emerge seamonkey

USE flag的顏色
紅色:enable
藍色:前面會帶一個”-”,表示disable。
綠色:enable但是還沒有邊進去的use flag
黃色:上一個版本沒有,這一個版本新加入的use flag
括弧():在你的平台上禁用的use flag

------------------------------------------------------

設定 USE="python" LINGUAS="en zh_CN"

[plain] view plaincopyprint?
# USE="python" LINGUAS="en zh_CN" emerge -pv postgresql-server
 These are the packages that would be merged, in order:
 Calculating dependencies... done![ebuild N ] dev-db/postgresql-server-9.3.3 USE="nls pam python xml -doc -perl -pg_legacytimestamp (-selinux) -tcl -uuid" LINGUAS="en zh_CN -af -cs -de -es -fa -fr -hr -hu -it -ko -nb -pl -pt_BR -ro -ru -sk -sl -sv -tr -zh_TW" 3 kB

Total: 1 package (1 new), Size of downloads: 3 kB

運行: USE="python" LINGUAS="en zh_CN" emerge postgresql-server 安裝postgresql-server

[plain] view plaincopyprint?
USE="python" LINGUAS="en zh_CN" emerge postgresql-server 等待安裝(我安的時候比較費時。。)
[plain] view plaincopyprint?* If you have users and/or services that you would like to utilize the* socket, you must add them to the 'postgres' system group:
* usermod -a -G postgres <user>*
* Before initializing the database, you may want to edit PG_INITDB_OPTS* so that it contains your preferred locale in:
* /etc/conf.d/postgresql-9.3*
* Then, execute the following command to setup the initial database* environment:
* emerge --config =dev-db/postgresql-server-9.3.3gt;>> Auto-cleaning packages...

按照提示編輯 /etc/conf.d/postgresql-9.3 (可以直接使用預設,不做任何更改,遇到問題了再改)

[plain] view plaincopyprint?
# 設定檔位置PGDATA="/etc/postgresql-9.3/"

# 資料存放目錄/to be created
DATA_DIR="/var/lib/postgresql/9.3/data"
 # 可選 選項PG_INITDB_OPTS="--locale=en_US.UTF-8" 按照提示,運行:emerge --config =dev-db/postgresql-server-9.3.3 [plain] view plaincopyprint?
# emerge --config =dev-db/postgresql-server-9.3.3........
* The autovacuum function, which was in contrib, has been moved to the main* PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled
* by default. You can disable it in the cluster's:* /etc/postgresql-9.3/postgresql.conf
** The PostgreSQL server, by default, will log events to:
* /var/lib/postgresql/9.3/data/postmaster.log*
* You should use the '/etc/init.d/postgresql-9.3' script to run PostgreSQL* instead of 'pg_ctl'. 然後,繼續安裝上條命令完成時的提示(You should use the '/etc/init.d/postgresql-9.3' script to run PostgreSQL):

啟動postgreSQL服務:/etc/init.d/postgresql-9.3 start

[plain] view plaincopyprint?
# /etc/init.d/postgresql-9.3 start* Caching service dependencies ... [ ok ]
* /var/run/postgresql: creating directory* /var/run/postgresql: correcting owner
* Starting PostgreSQL ... [ ok ]
[plain] view plaincopyprint?# psql -U postgrespsql (9.3.3)
Type "help" for help.
postgres=# \lList of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |template0 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgrestemplate1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres(3 rows)

postgres=#

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.