<commit_before>The CircleCI environment provides the libraries, languages, and databases needed for most development work
(check out the [comprehensive list)](/docs/environment).
However, if you need to install a particular version of software&mdash;to match your production systems or to test backward compatibility, for example&mdash;or add custom code, CircleCI makes it easy to set up your environment to meet your testing needs.

## Root commands and packages

[Contact us](mailto:<EMAIL>) to add any packages we don't currently have.
We'll add them to your project, and you'll be able to start using them immediately.
We'll add common packages to our VM image too.

We can run any arbitrary command for you in the same way, not just package management.
This means we can tweak our VM in any way you need.
Let us know what commands you need when you [contact us](mailto:<EMAIL>).

In case you're curious, the reason we require this is that our virtualization does not support providing `sudo` to arbitrary users.
We use LXC (the same technology used by Heroku, Docker, and other PaaSes).
LXC is one of the many technologies we use to make your builds run so fast, especially compared to alternatives such as VirtualBox or OpenVZ.
The tradeoff is you need to [contact us](mailto:<EMAIL>) for `sudo` commands. We plan to address this in the future.

## Installing via the circle.yml

If you don't need root to install your custom software, you can do it manually.
You do this by adding extra commands within the dependencies section in your
`circle.yml` file.

For example, if you need to use a specific version of Redis, you would download and compile the needed version as part of your build.

```
dependencies:
  pre:
    - wget http://redis.googlecode.com/files/redis-2.4.18.tar.gz
    - tar xvzf redis-2.4.18.tar.gz
    - cd redis-2.4.18 && make
```

### Caching

Natually, downloading and compiling this custom software can take time, making your build longer.
To reduce the time spent installing dependencies, CircleCI will cache them between builds.
You can add arbitrary directories to this cache, allowing you to avoid the overhead of building your custom software during the build.

Tell CircleCI to save a cached copy using the
[`cache_directories` setting, in your `circle.yml` file](/docs/configuration#cache-directories).

```
dependencies:
  cache_directories:
    - redis-2.4.18   # relative to the build directory
```

### Avoid recompiles

To take advantage of this, you'll need to test for the presence of an existing cached install of your software.
If the software is already present, no need to build it.
You should test that your cache is there by including a
`test` command in the dependencies section in your `circle.yml` file.

```<commit_msg>fix typo, Natually -> Naturally<commit_after>The CircleCI environment provides the libraries, languages, and databases needed for most development work
(check out the [comprehensive list)](/docs/environment).
However, if you need to install a particular version of software&mdash;to match your production systems or to test backward compatibility, for example&mdash;or add custom code, CircleCI makes it easy to set up your environment to meet your testing needs.

## Root commands and packages

[Contact us](mailto:<EMAIL>) to add any packages we don't currently have.
We'll add them to your project, and you'll be able to start using them immediately.
We'll add common packages to our VM image too.

We can run any arbitrary command for you in the same way, not just package management.
This means we can tweak our VM in any way you need.
Let us know what commands you need when you [contact us](mailto:<EMAIL>).

In case you're curious, the reason we require this is that our virtualization does not support providing `sudo` to arbitrary users.
We use LXC (the same technology used by Heroku, Docker, and other PaaSes).
LXC is one of the many technologies we use to make your builds run so fast, especially compared to alternatives such as VirtualBox or OpenVZ.
The tradeoff is you need to [contact us](mailto:<EMAIL>) for `sudo` commands. We plan to address this in the future.

## Installing via the circle.yml

If you don't need root to install your custom software, you can do it manually.
You do this by adding extra commands within the dependencies section in your
`circle.yml` file.

For example, if you need to use a specific version of Redis, you would download and compile the needed version as part of your build.

```
dependencies:
  pre:
    - wget http://redis.googlecode.com/files/redis-2.4.18.tar.gz
    - tar xvzf redis-2.4.18.tar.gz
    - cd redis-2.4.18 && make
```

### Caching

Naturally, downloading and compiling this custom software can take time, making your build longer.
To reduce the time spent installing dependencies, CircleCI will cache them between builds.
You can add arbitrary directories to this cache, allowing you to avoid the overhead of building your custom software during the build.

Tell CircleCI to save a cached copy using the
[`cache_directories` setting, in your `circle.yml` file](/docs/configuration#cache-directories).

```
dependencies:
  cache_directories:
    - redis-2.4.18   # relative to the build directory
```

### Avoid recompiles

To take advantage of this, you'll need to test for the presence of an existing cached install of your software.
If the software is already present, no need to build it.
You should test that your cache is there by including a
`test` command in the dependencies section in your `circle.yml` file.

```
{'fraction_non_alphanumeric': 0.06307277628032346, 'fraction_numerical': 0.005750224618149146, 'mean_word_length': 4.341650671785029, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '345541', 'n_tokens_mistral': 1499, 'n_tokens_neox': 1429, 'n_words': 821}