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?
- # Emerge-pv postgresql-server
- These are the packages that wocould 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
------------------------------------------------------
[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?
- # USE = "python" LINGUAS = "en zh_CN" emerge-pv postgresql-server
- These are the packages that wocould 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
Run: USE = "python" LINGUAS = "en zh_CN" emerge postgresql-server to install postgresql-server
[Plain]View plaincopyprint?
- 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?
- * If you have users and/or services that you wowould like to utilize
- * Socket, you must add them to the 'Seconds s' 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...
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?
- # Configuration file location
- PGDATA = "/etc/postgresql-9.3 /"
- # Data storage directory/to be created
- DATA_DIR = "/var/lib/postgresql/9.3/data"
- # Optional
- PG_INITDB_OPTS = "-- locale = en_US.UTF-8"
Run: emerge -- config = dev-db/postgresql-server-9.3.3 as prompted
[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:
- */Var/lib/postgresql/9.3/data/postmaster. log
- *
- * You shoshould use the '/etc/init. d/postgresql-9.3' script to run PostgreSQL
- * 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?
- #/Etc/init. d/postgresql-9.3 start
- * Caching service dependencies... [OK]
- */Var/run/postgresql: creating directory
- */Var/run/postgresql: correcting owner
- * Starting PostgreSQL... [OK]
Test postgresql
[Plain]View plaincopyprint?
- # Psql-U postgres
- Psql (9.3.3)
- Type "help" for help.
- Postgres = # \ l
- List of databases
- Name | Owner | Encoding | Collate | Ctype | Access privileges
- ----------- + ---------- + ------------- + -----------------------
- Postgres | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
- Template0 | postgres | UTF8 | en_US.UTF-8 | = c/postgres +
- | Postgres = CTc/postgres
- Template1 | postgres | UTF8 | en_US.UTF-8 | = c/postgres +
- | Postgres = CTc/postgres
- (3 rows)
- Postgres = #
Reference: http://blog.csdn.net/cenziboy/article/details/7357066