本文以安装postgreSQL为例说明了Gentoo Linux 安装 软件的一般方法,同时总结了USE flag.
运行 emerge -pv postgresql-server 看下USE
- #emerge-pvpostgresql-server
-
- Thesearethepackagesthatwouldbemerged,inorder:
- Calculatingdependencies...done!
- [ebuildN]dev-db/postgresql-server-9.3.3USE="nlspamxml-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"3kB
-
- Total:1package(1new),Sizeofdownloads:3kB
------------------------------------------------------
【附】Gentoo USE:
USE的简单理解如下:一个软件不只包含软件本身,还包括其组件,如,文档,插件,GUI支持等。USE就是用来标记是否要安装软件的同时安装这些组件。
临时USE : USE="-java" emerge seamonkey
USE flag的颜色 红色:enable 蓝色:前面会带一个”-”,表示disable。 绿色:enable但是还没有边进去的use flag 黄色:上一个版本没有,这一个版本新加入的use flag 括号():在你的平台上禁用的use flag
参考:
1.http://www.52php.cn/article/p-bdppkrtg-bcc.html
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="enzh_CN"
- #USE="python"LINGUAS="enzh_CN"emerge-pvpostgresql-server
-
- Thesearethepackagesthatwouldbemerged,inorder:
- Calculatingdependencies...done!
- [ebuildN]dev-db/postgresql-server-9.3.3USE="nlspampythonxml-doc-perl-pg_legacytimestamp(-selinux)-tcl-uuid"LINGUAS="enzh_CN-af-cs-de-es-fa-fr-hr-hu-it-ko-nb-pl-pt_BR-ro-ru-sk-sl-sv-tr-zh_TW"3kB
-
- Total:1package(1new),Sizeofdownloads:3kB
运行:USE="python" LINGUAS="en zh_CN" emerge postgresql-server 安装postgresql-server
- USE="python"LINGUAS="enzh_CN"emergepostgresql-server
等待安装(我安的时候比较费时。。)
完成时有如下提示:
*Ifyouhaveusersand/orservicesthatyouwouldliketoutilizethe
- *socket,youmustaddthemtothe'postgres'systemgroup:
- *usermod-a-Gpostgres<user>
- *
- *Beforeinitializingthedatabase,youmaywanttoeditPG_INITDB_OPTS
- *sothatitcontainsyourpreferredlocalein:
- */etc/conf.d/postgresql-9.3
- *Then,executethefollowingcommandtosetuptheinitialdatabase
- *environment:
- *emerge--config=dev-db/postgresql-server-9.3.3
- gt;>>Auto-cleaningpackages...
按照提示编辑 /etc/conf.d/postgresql-9.3 (可以直接使用默认,不做任何更改,遇到问题了再改)
#配置文件位置
- PGDATA="/etc/postgresql-9.3/"
-
- #数据存放目录/tobecreated
- 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
- ........
- *Theautovacuumfunction,whichwasincontrib,hasbeenmovedtothemain
- *PostgreSQLfunctionsstartingwith8.1,andstartingwith8.4isnowenabled
- *bydefault.Youcandisableitinthecluster's:
- */etc/postgresql-9.3/postgresql.conf
- *
- *ThePostgreSQLserver,bydefault,willlogeventsto:
- */var/lib/postgresql/9.3/data/postmaster.log
- *Youshouldusethe'/etc/init.d/postgresql-9.3'scripttorunPostgreSQL
- *insteadof'pg_ctl'.
然后,继续安装上条命令完成时的提示(Youshouldusethe'/etc/init.d/postgresql-9.3'scripttorunPostgreSQL)
:
启动postgreSQL服务:/etc/init.d/postgresql-9.3 start
#/etc/init.d/postgresql-9.3 start
- *Cachingservicedependencies...[ok]
- */var/run/postgresql:creatingdirectory
- */var/run/postgresql:correctingowner
- *StartingPostgreSQL...[ok]
测试 postgresql
#psql-Upostgres
- psql(9.3.3)
- Type"help"forhelp.
- postgres=#l
- Listofdatabases
- Name|Owner|Encoding|Collate|Ctype|Accessprivileges
- -----------+----------+----------+-------------+-------------+-----------------------
- 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+
- (3rows)
- postgres=#
参考:http://www.52php.cn/article/p-xgvucqzp-ta.html
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|