Suppose you need a newer or specific version of a package that isn't included in your standard linux repo. The standard procedure is to do something like the following...
Depending on how the package is configured, it will put the executable, configurations, and libraries in `/usr/local/` or other places in your system.
The difficulty comes, when it is time to change versions of the software. Some people include a nice `make uninstall` target which can help you track down which files were installed. Other software packages aren't so convinient. This is where stow comes in. It allows you to easily change between software versions.
How does this work? First let's create a stow directory in `/usr/local`
```bash
sudo mkdir /usr/local/stow
```
Then let's go to the project we want to install and add a flag to configure to tell it where to install
You'll notice here that we'll have the same setup as `/usr/local/etc/`, `/usr/local/lib/` and `/usr/local/bin`. That's because when we run `stow` it'll go through and create the appropriate symlinks to the files.
```bash
cd /usr/local/stow
sudo stow project-v1
```
## Stow Flags
Stow will go into the folder and then create the appropriate symlinks relative to the parent directory of stow, which in this case is `/usr/local`. If you don't want it to create the symlinks in the parent directory then you can set the target somewhere else with `--target` or `-t`.
```bash
cd /home/brandon/stow
sudo stow --target /usr/local project-v1
```
If you don't want to `cd` into your stow directory, you can set `--dir` or `-d` to indicate where that is.
| `--no` | Do not perform any operations that modify the filesystem; merely show what would happen. |
| `--dir=DIR` | Set the stow directory to "DIR" instead of the current directory. This also has the effect of making the default target directory be the parent of "DIR". |
| `--target=DIR` | Set the target directory to "DIR" instead of the parent of the stow directory. |
| `--stow` | Stow the packages that follow this option into the target directory. This is the default action and so can be omitted if you are only stowing packages rather than performing a mixture of stow/delete/restow actions. |
| `--delete` | Unstow the packages that follow this option from the target directory rather than installing them. |