# Reinstall binary packages



## circus78 (Mar 5, 2018)

Hi, I was reading "Modifying Package Metadata" section of this section of FreeBSD Handbook.
It is not perfectly clear to me why it is necessary to reinstall packages that are dependent on some package with modified origin.
I mean: I can understand same situation with ports, because they clearly need to be re-compiled.
According to my understanding, `pkg` only deals with binary (static) software.
So, as in the example, this command:
`# pkg install -Rf graphics/freeglut` will reinstall the same version of dependent packages.. which are the same as before, because they are static.
What am I missing?
Thank you


----------



## SirDice (Mar 5, 2018)

You are -f forcing the reinstall.

```
It then creates a work-list of all the package installations to do.  Any
     already installed and up-to-date packages will be dropped from the list
     unless the -f (force) option is supplied, in which case those packages
     will be reinstalled.
```


```
-R, --recursive
                When used with -f, reinstalls any packages that require the
                given package.
```
pkg-install(8)


----------



## obsigna (Mar 5, 2018)

circus78 said:


> ...
> According to my understanding, `pkg` only deals with binary (static) software.
> ...


That is not exactly true.  In the course of the installation process, a locally compiled port turns into a binary package and it appears in the pkg metadata. For example you can call `pkg delete` on installed port software, like you would do when deleting software which was installed from a binary package repository.


----------



## ShelLuser (Mar 5, 2018)

Quite frankly I'm not even sure why the suggestion to reinstall is even mentioned. Even if you'd be using ports then nothing substantial would change when a package got a different origin. (edit): ... since it wouldn't have any direct impact on the dependencies for example.

(edit2)

_However..._

The requirement to reinstall doesn't come from editing the origin of the package but is rather caused by the actual physical change in the ports directory. That's why it's needed to reinstall: to make sure that you get the latest versions of the packages which would reflect the change in the ports collection.

But if you simply would change a packages origin "because you think it's fun to break your system" then sure: there is no direct need to re-install any package dependencies because nothing substantial would have changed.

But I definitely agree that a bit more context could be useful on that tutorial page.


----------



## circus78 (Mar 6, 2018)

SirDice said:


> You are -f forcing the reinstall.
> 
> 
> ```
> ...



Hi SirDice, ok, but what is the purpose?
Will I reinstall different version of same packages?
There is no need to "recompile" anything, as we are talking about binary packages.
Maybe this step is recommend because one will be sure to get latest version of required packages that belong to the modified one?

Thank you again


----------



## SirDice (Mar 6, 2018)

circus78 said:


> Maybe this step is recommend because one will be sure to get latest version of required packages that belong to the modified one?


Where does it say it's recommended?


----------



## circus78 (Mar 6, 2018)

Hi,
in last note of part 4.4.9:




> When changing package origins, it is important to reinstall packages that are dependent on the package with the modified origin.


----------

