# deinstall a port without losing references



## puzor (Jun 29, 2009)

Hey guys,

i installed two webserver (apache and lighttpd) on the same machine. 

first of all i installed apache with php and mysql. now, i use lighttpd as webserver with php and mysql extensions.

i don't work with apache and don't need them.

Question:

_how can i deinstall the apache port without losing the extensions php and mysql?_

Thanks!


----------



## DutchDaemon (Jun 29, 2009)

Deinstalling a port will not deinstall 'what you built with it' -- 'extensions' like mysql and php are not part of Apache, they're entirely separate ports. So you can simply 'pkg_delete apache' (get the correct package name for pkg_info), or run 'make deinstall clean' in the port directory.


----------



## puzor (Jun 29, 2009)

that's it?

ok, i will try it out


----------



## phoenix (Jun 29, 2009)

DutchDaemon said:
			
		

> So you can simply 'pkg_delete apache' (get the correct package name for pkg_info), or run 'make deinstall clean' in the port directory.



`# pkg_delete -xi apache`
The -x tells pkg_delete to do a wildcard search, so you don't have to specify the exact name-version.

The -i tells pkg_delete to ask you whether or not to delete the package(s) that it found.


----------



## puzor (Jun 30, 2009)

Ok, thank you very much. I deinstalled apache on my system and php works still fine.


----------

