Install postgresql in Gentoo emerge USE

Source: Internet
Author: User
Tags psql

This document describes how to install the software in Gentoo Linux by using postgreSQL as an example, and summarizes the USE flag.

Run emerge-pv postgresql-server.

[Plain]View plaincopyprint?
  1. # Emerge-pv postgresql-server
  2. These are the packages that wocould be merged, in order:
  3. Calculating dependencies... done!
  4. [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
  5. Total: 1 package (1 new), Size of downloads: 3 kB

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

[Appendix] Gentoo USE:

The simple understanding of USE is as follows: a software includes not only the software itself, but also its components, such as documentation, plug-ins, and GUI support. USE is used to mark whether to install the software and install these components at the same time.

Temporary USE:USE = "-java" emerge seamonkey

USE flag color
RED: enable
Blue: "-" is included in the front, indicating disable.
Green: enable, but there is no use flag
Yellow: none in the previous version. use flag added to this version
Parentheses (): use flag disabled on your platform

Refer:

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

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

Set USE = "python" LINGUAS = "en zh_CN"

[Plain]View plaincopyprint?
  1. # USE = "python" LINGUAS = "en zh_CN" emerge-pv postgresql-server
  2. These are the packages that wocould be merged, in order:
  3. Calculating dependencies... done!
  4. [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
  5. Total: 1 package (1 new), Size of downloads: 3 kB


Run: USE = "python" LINGUAS = "en zh_CN" emerge postgresql-server to install postgresql-server

[Plain]View plaincopyprint?
  1. USE = "python" LINGUAS = "en zh_CN" emerge postgresql-server
Wait for installation (it takes a long time to install it ..)

The following prompt is displayed when the task is completed:

[Plain]View plaincopyprint?
  1. * If you have users and/or services that you wowould like to utilize
  2. * Socket, you must add them to the 'Seconds s' system group:
  3. * Usermod-a-G postgres <user>
  4. *
  5. * Before initializing the database, you may want to edit PG_INITDB_OPTS
  6. * So that it contains your preferred locale in:
  7. */Etc/conf. d/postgresql-9.3
  8. *
  9. * Then, execute the following command to setup the initial database
  10. * Environment:
  11. * Emerge -- config = dev-db/postgresql-server-9.3.3
  12. Gt;> Auto-cleaning packages...

Follow the prompts to edit/etc/conf. d/postgresql-9.3 (you can directly use the default, do not make any changes, encountered problems and then change)

[Plain]View plaincopyprint?
  1. # Configuration file location
  2. PGDATA = "/etc/postgresql-9.3 /"
  3. # Data storage directory/to be created
  4. DATA_DIR = "/var/lib/postgresql/9.3/data"
  5. # Optional
  6. PG_INITDB_OPTS = "-- locale = en_US.UTF-8"
Run: emerge -- config = dev-db/postgresql-server-9.3.3 as prompted

[Plain]View plaincopyprint?
  1. # Emerge -- config = dev-db/postgresql-server-9.3.3
  2. ........
  3. * The autovacuum function, which was in contrib, has been moved to the main
  4. * PostgreSQL functions starting with 8.1, and starting with 8.4 is now enabled
  5. * By default. You can disable it in the cluster's:
  6. /Etc/postgresql-9.3/postgresql. conf
  7. *
  8. * The PostgreSQL server, by default, will log events:
  9. */Var/lib/postgresql/9.3/data/postmaster. log
  10. *
  11. * You shoshould use the '/etc/init. d/postgresql-9.3' script to run PostgreSQL
  12. * Instead of 'pg _ ctl '.
Then, continue with the prompt when the last command is installed (You shocould use the '/etc/init. d/postgresql-9.3' script to run PostgreSQL ):

Start postgreSQL service:/etc/init. d/postgresql-9.3 start

[Plain]View plaincopyprint?
  1. #/Etc/init. d/postgresql-9.3 start
  2. * Caching service dependencies... [OK]
  3. */Var/run/postgresql: creating directory
  4. */Var/run/postgresql: correcting owner
  5. * Starting PostgreSQL... [OK]

Test postgresql

[Plain]View plaincopyprint?
  1. # Psql-U postgres
  2. Psql (9.3.3)
  3. Type "help" for help.
  4. Postgres = # \ l
  5. List of databases
  6. Name | Owner | Encoding | Collate | Ctype | Access privileges
  7. ----------- + ---------- + ------------- + -----------------------
  8. Postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
  9. Template0 | postgres | UTF8 | en_US.UTF-8 | = c/postgres +
  10. | Postgres = CTc/postgres
  11. Template1 | postgres | UTF8 | en_US.UTF-8 | = c/postgres +
  12. | Postgres = CTc/postgres
  13. (3 rows)
  14. Postgres = #

Reference: http://blog.csdn.net/cenziboy/article/details/7357066

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.