# How to reinstall port



## blind0ne (Nov 4, 2021)

I've missconfiigured some options forsing the port to trying install something in the loop, so i would like to know how to start port installation from the begining with confiugring this things again. Thanks


----------



## SirDice (Nov 4, 2021)

When you install a port (or package) any configuration files are left as-is. If they've been modified they will remain, so you need to remove those in order for the reinstall to create the default again. Almost all ports will install the 'default' configuration files as *.sample (there are a few exceptions that use a different extension) if there's an existing configuration file in place. This is done so an update of a port/package doesn't nuke your config by overwriting it with a default configuration file. An update of a port/package is nothing more than a deletion of the old port/package and an installation of the newer version. 

You can force a reinstall of a package by using `pkg install -f <packagename>`. But keep in mind that this won't overwrite existing configuration files.


----------



## bjs (Nov 4, 2021)

SirDice , I think the OP may be asking about the configuration for building of the port, not the one for running an installed port...


----------



## SirDice (Nov 4, 2021)

bjs said:


> I think the OP may be asking about the configuration of the port for building not the one for running of the port...


In that case `make rmconfig` or `make rmconfig-recursive` will remove any configuration you've done (and thus go back to the defaults).


```
rmconfig             Remove OPTIONS config for this port.

     rmconfig-recursive   Remove OPTIONS config for this port and all its
                          dependencies.
```
ports(7)


----------

