本文以安装postgreSQL为例说明了Gentoo Linux 安装 软件的一般方法,同时总结了USE flag.
1.运行 emerge -pv postgresql-server 看下USE
-
# 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
参考:
1.http://blog.csdn.net/aceking10/article/details/17116299
2.http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml?part=2&chap=2
3.http://forums.gentoo.tw/viewtopic.php?f=15&t=44462
------------------------------------------------------
设置 USE="python" LINGUAS="en zh_CN"
-
# 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
-
USE="python" LINGUAS="en zh_CN" emerge postgresql-server
等待安装(我安的时候比较费时。。)
完成时有如下提示:
-
* 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.3
-
gt;>> Auto-cleaning packages...
按照提示编辑 /etc/conf.d/postgresql-9.3 (可以直接使用默认,不做任何更改,遇到问题了再改)
-
# 配置文件位置
-
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
-
# 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
-
# /etc/init.d/postgresql-9.3 start
-
* Caching service dependencies ... [ ok ]
-
* /var/run/postgresql: creating directory
-
* /var/run/postgresql: correcting owner
-
* Starting PostgreSQL ... [ ok ]
2. 测试 postgresql
-
# psql -U postgres
-
psql (9.3.3)
-
Type "help" for help.
-
-
postgres=# \l
-
List 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/postgres
-
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
-
| | | | | postgres=CTc/postgres
-
(3 rows)
-
-
postgres=#
参考:http://blog.csdn.net/cenziboy/article/details/7357066
1.运行 emerge -pv postgresql-server 看下USE
-
# 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
参考:
1.http://blog.csdn.net/aceking10/article/details/17116299
2.http://www.gentoo.org/doc/zh_cn/handbook/handbook-x86.xml?part=2&chap=2
3.http://forums.gentoo.tw/viewtopic.php?f=15&t=44462
------------------------------------------------------
设置 USE="python" LINGUAS="en zh_CN"
-
# 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
-
USE="python" LINGUAS="en zh_CN" emerge postgresql-server
等待安装(我安的时候比较费时。。)
完成时有如下提示:
-
* 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.3
-
gt;>> Auto-cleaning packages...
按照提示编辑 /etc/conf.d/postgresql-9.3 (可以直接使用默认,不做任何更改,遇到问题了再改)
-
# 配置文件位置
-
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
-
# 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
-
# /etc/init.d/postgresql-9.3 start
-
* Caching service dependencies ... [ ok ]
-
* /var/run/postgresql: creating directory
-
* /var/run/postgresql: correcting owner
-
* Starting PostgreSQL ... [ ok ]
测试 postgresql
-
# psql -U postgres
-
psql (9.3.3)
-
Type "help" for help.
-
-
postgres=# \l
-
List 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/postgres
-
template1 | postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +
-
| | | | | postgres=CTc/postgres
-
(3 rows)
-
-
postgres=#
参考:http://blog.csdn.net/cenziboy/article/details/7357066
Gentoo emerge USE 安装postgresql,布布扣,bubuko.com
Gentoo emerge USE 安装postgresql
原文:http://blog.csdn.net/wusuopubupt/article/details/21548575