# Specifying an Older Package on TRAN

TERR and open-source R search for packages differently. By default, the repository search order for `options('repos')` is set to TRAN, Posit, and then CRAN. If a package exists in all repositories, then TERR selects the version in TRAN, but open-source R selects the newest one based on the package version number.

## About this task

This search-order difference is by design, because if a newer package on CRAN causes problems when tested with TERR, then TRAN contains an older version of a package that has been tested successfully with TERR. (The Posit snapshot contains the version of the package available when this version of TERR was made available.)

In some cases, you must use open-source R to install a package to use with TERR. For example, under Linux, packages with source code for use in TERR often need to be installed using open-source R. If you encounter the search-difference issue with such a package, and an older version is available on TRAN, then you must take additional steps to make sure you get the working package version.

## Procedure

1. From open-source R, run `install.packages(pkgname)`.
   The newest version of the package specified by `pkgname` is installed, along with its dependencies.
2. Set `options('repos')` to c("https://tran.tibco.com/terr##").
   The repository search option is set to check only the TRAN site and the version of TERR specified by the version number `##`.
3. Reinstall the needed package.
   The package is installed according to the TRAN site search option.