Gentoo emerge USE 安装postgresql

前端之家收集整理的这篇文章主要介绍了Gentoo emerge USE 安装postgresql前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

本文以安装postgresql为例说明了Gentoo Linux 安装 软件的一般方法,同时总结了USE flag.

运行 emerge -pv postgresql-server 看下USE

  1. #emerge-pvpostgresql-server
  2. Thesearethepackagesthatwouldbemerged,inorder:
  3. Calculatingdependencies...done!
  4. [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
  5. 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.jb51.cc/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"

?
  1. #USE="python"LINGUAS="enzh_CN"emerge-pvpostgresql-server
  2. Thesearethepackagesthatwouldbemerged,inorder:
  3. Calculatingdependencies...done!
  4. [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
  5. Total:1package(1new),Sizeofdownloads:3kB


运行:USE="python" LINGUAS="en zh_CN" emerge postgresql-server 安装postgresql-server

?
  1. USE="python"LINGUAS="enzh_CN"emergepostgresql-server
等待安装(我安的时候比较费时。。)

完成时有如下提示

?
    *Ifyouhaveusersand/orservicesthatyouwouldliketoutilizethe
  1. *socket,youmustaddthemtothe'postgres'systemgroup:
  2. *usermod-a-Gpostgres<user>
  3. *
  4. *Beforeinitializingthedatabase,youmaywanttoeditPG_INITDB_OPTS
  5. *sothatitcontainsyourpreferredlocalein:
  6. */etc/conf.d/postgresql-9.3
  7. *Then,executethefollowingcommandtosetuptheinitialdatabase
  8. *environment:
  9. *emerge--config=dev-db/postgresql-server-9.3.3
  10. gt;>>Auto-cleaningpackages...

按照提示编辑 /etc/conf.d/postgresql-9.3 (可以直接使用默认,不做任何更改,遇到问题了再改)

?
    #配置文件位置
  1. PGDATA="/etc/postgresql-9.3/"
  2. #数据存放目录/tobecreated
  3. DATA_DIR="/var/lib/postgresql/9.3/data"
  4. #可选选项
  5. 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
  1. ........
  2. *Theautovacuumfunction,whichwasincontrib,hasbeenmovedtothemain
  3. *Postgresqlfunctionsstartingwith8.1,andstartingwith8.4isnowenabled
  4. *bydefault.Youcandisableitinthecluster's:
  5. */etc/postgresql-9.3/postgresql.conf
  6. *
  7. *ThePostgresqlserver,bydefault,willlogeventsto:
  8. */var/lib/postgresql/9.3/data/postmaster.log
  9. *Youshouldusethe'/etc/init.d/postgresql-9.3'scripttorunPostgresql
  10. *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
  1. *Cachingservicedependencies...[ok]
  2. */var/run/postgresql:creatingdirectory
  3. */var/run/postgresql:correctingowner
  4. *StartingPostgresql...[ok]

测试 postgresql

?
    #psql-Upostgres
  1. psql(9.3.3)
  2. Type"help"forhelp.
  3. postgres=#\l
  4. Listofdatabases
  5. Name|Owner|Encoding|Collate|Ctype|Accessprivileges
  6. -----------+----------+----------+-------------+-------------+-----------------------
  7. postgres|postgres|UTF8|en_US.UTF-8|en_US.UTF-8|
  8. template0|postgres|UTF8|en_US.UTF-8|en_US.UTF-8|=c/postgres+
  9. |||||postgres=CTc/postgres
  10. template1|postgres|UTF8|en_US.UTF-8|en_US.UTF-8|=c/postgres+
  11. (3rows)
  12. postgres=#

参考:http://www.jb51.cc/article/p-xgvucqzp-ta.html

原文链接:https://www.f2er.com/postgresql/195826.html

猜你在找的Postgre SQL相关文章