Next: , Up: Environment Variables   [Contents][Index]

3.2.1 ‘CPT_PATH

Similar to the ‘PATH’ variable, ‘cpt’ find repositories from the ‘CPT_PATH’ variable. Here is an example:


This is a simplistic and a structured example for repository locations, but it doesn’t necessarily need to be as tidy as the example above. Here is an example for something a little more complex.


This example brings us to the next section of this document.

  1. Repository preferences

    When you are using multiple repositories from multiple vendors, you will find out that some repositories have the same packages. ‘cpt’ doesn’t care about conflicting packages. If you want to build a package that exists on multiple repositories, ‘cpt’ will build the first matching package. This means that if ‘grep’ package (for the sake of an example) exists on both ‘$HOME/repos/personal’ and ‘$HOME/repos/carbs/extra’, and you want to install from your personal repository, you must set ‘CPT_PATH’ so that your personal repository is listed before the ‘extra’ repository.

  2. Setting the ‘CPT_PATH

    You can set the ‘CPT_PATH’ variable on your shell configuration or your ‘.profile’ file in a way that is easy to read.

    The below example sets ‘CPT_PATH’ in a way that is easy to understand which repository comes first:

    export CPT_PATH