# Set "/usr/local/bin/bsdtar" as default



## Niatross (Apr 24, 2014)

I have a local package that I want to install on my FreeBSD 9.2-RELEASE box. The `pkg_add` command displays the following error when trying to install this package:


```
tar: Unrecognized archive format: Inapprpropriate file type or format.
```
I then tried to use the `tar` command (instead of `pkg_add`) to manually extract this package but I got the same error (above).

This made me think I had a `bsdtar` that was too old. So I installed a newer version of archivers/libarchive.

Once I installed archivers/libarchive, the `/usr/local/bin/bsdtar` command manually extracted the package just fine.

My two questions are:

How do I tell the `tar` symbolic link to use `/usr/local/bin/bsdtar` instead of `/usr/bin/bsdtar`? I shouldn't have to type out the whole path to (ex: `/usr/local/bin/bsdtar` to use the newer version, right? I also shouldn't have to change my $PATH statement either, correct?

How do I tell the `pkg_add` command to use "`/usr/local/bin/bsdtar`" instead of `/usr/bin/bsdtar`?


----------



## Beastie (Apr 24, 2014)

`cd /usr/bin`
`ln -s /usr/local/bin/bsdtar tar`
?

1. Use at your own risk;
2. It may be useless if pkg_add(1) has the path /usr/bin/bsdtar hardcoded.


----------

