# Accidentally ran make deinstall under port root...



## kscarlet (Feb 16, 2020)

I ran 
	
	



```
sudo make deinstall
```
 under 
	
	



```
/usr/ports/
```
When I noticed that and pressed Ctrl+C it already did damage, not sure how much it did.
Then my applications cannot start because they're missing some libraries. I tried to reinstall
the ports of those applications and they cannot build because of missing packages.
Is there anyway to fix the port tree and dependencies?


----------



## George (Feb 16, 2020)

Is there any specific reason you are using ports, instead of packages?


```
pkg check -d or pkg check --dependencies checks for and installs missing
     dependencies.
```


----------



## obsigna (Feb 16, 2020)

kscarlet said:


> I ran
> 
> 
> 
> ...


Have a look into /var/log/messages. There should have appeared entries for each deinstalled port:
`grep deinstalled /var/log/messages`

If that log file rolled over already, then look into the saved older log files /var/log/messages.0.bz2 to ...4.bz2:
`bzgrep deinstalled /var/log/messages.0.bz2`

In case the list is not too long, you could easily reinstall these ports manually.


----------



## kscarlet (Feb 17, 2020)

Elazar said:


> Is there any specific reason you are using ports, instead of packages?
> 
> 
> ```
> ...


I've heard that using ports and pkg install together is bad for health. Not sure if it's true, but I just took it. I need ports to customize some of my installation.
And it's probably true, right after I deinstall when I tried to make something in ports and when I see it invokes pkg, pkg wasn't complaining... the build just fails afterwards because of missing libraries.
Anyway I've fixed it now. I just make emacs and it pulls nearly all the dependencies down (it even somehow depends on Firefox... based on my config). Now I tried running 
	
	



```
pkg check -d
```
 and it gives no error.


----------



## ShelLuser (Feb 17, 2020)

Although it won't prevent you from making nasty mistakes it helps not to use `make` at all like this. Instead use something like ports-mgmt/portmaster to install ports and pkg to delete them. See also pkg-delete(8).


----------

