Example Unix Installation

Info & Tags

Article #:
555
Created:
08/11/06
Modified:
05/20/08

Links

  1. The Ten-Minute Test Drive
    For Unix or Linux Systems

TASK

How do I install Perforce on a Unix system?

SOLUTION

Since Perforce's minimum hardware requirements allow the use of older hardware, many users not familiar with Unix based systems might find this article helpful. While the commands used are common to most operating systems, there may be some differences.

In order to install Perforce on a Unix based system, you would perform the following steps:
  1. Create a normal user account for Perforce use. Since Perforce does not require special privileges, this can be an ordinary user account without administrator permissions. To simplify things, call this user "perforce".

    The specific instructions to create a new user can differ depending on the operating system -- consult your distribution's documentation for details on how to create a new user.
  1. Log into the "perforce" account before proceeding; this will insure that the permissions are set for Perforce to function correctly.

  2. Choose a location to create the Perforce root directory and create it. Typically you can do this using your OS's command line application and entering the command:
    mkdir p4
    This command will create a directory in the Perforce user's home directory called "p4". Under most systems you can switch to this directory with the command:
    cd ~/p4
    The tilde ("~") at the beginning of the path is a common shortcut that defaults to the home directory of the current user account.

  3. FTP downloads to the directory it was started from by default, so change to the directory into which you would like to install the Perforce server and client software. On most systems this is typically /usr/local/bin:
    cd /usr/local/bin

    Note: Access to /usr/local/bin requires "root" privileges.

  4. Download the executable for the operating system using FTP. From the command line enter:
    ftp ftp.perforce.com
    You will be prompted for a user name -- enter "anonymous":
    Connected to alameda2a.perforce.com.
    220 waypoint.perforce.com FTP server (Version 6.00LS) ready.
    Name (ftp.perforce.com:perforce): anonymous
    When prompted for a password, enter your e-mail address:
    331 Guest login ok, send your email address as password.
    Password: my_email@my_company.com
    The password will not be mirrored (displayed as you type it) on most systems.

    If login was successful, you will see a welcome message and "ftp>" prompt:
    230 Guest login ok, access restrictions apply.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp>
    Switch to the Perforce platform downloads by entering:
    cd perforce/r06.2
    This is for version 2006.2 of Perforce.

    You can get a listing of available platform directories by typing "ls" -- choose yours from the list and "cd" to it. For example, Linux  users would type:
    cd bin.linux26x86
    To set up the server you'll need, at minimum, P4 and P4D. To copy these files, enter:
    mget p4 p4d
    And answer "a" to the prompt to get both files. Once the transfer is complete, exit FTP by typing:
    bye
  5. To run applications under Unix based systems you must set their "executable bit". To do this with the Perforce files you just downloaded, type this on most systems:
    chmod +x p4*
    To check that  the bit was set correctly, and that you have the correct version for your platform, try running each command with the "-V" flag:
    p4 -V

    Perforce - The Fast Software Configuration Management System.
    Copyright 1995-2007 Perforce Software. All rights reserved.
    Rev. P4/LINUX26X86/2006.2/113956 (2007/01/09)
    If you get an error that looks similar to:
    -bash: /usr/local/bin/p4: Permission denied
    Try running the "chmod" command again.

  6. For evaluation purposes you can keep your server startup simple by entering:
    p4d -r ~/p4 -d
    The "-r" points to the directory you've created for your Perforce root directory. The "-d" flag "forks" the server process, which returns control of the terminal window to the user. To test, type:
    p4 info
    You should see a list of server information.
The server is now ready to be used. Your next step will be to install P4V, as illustrated in the "Installing Perforce" section of our 10 minute test drive
 
Note: To avoid potential security issues, never use a "root" account to run Perforce.