# Deinstalling parts of base



## Seeker (Sep 18, 2010)

Is it possible?

```
cd /usr/src/.../$APP
make deinstall
```
Because that would be easier, after adding in src.conf:
WITHOU_$APP

Then rebuilding whole world, just to not have $APP in base.

I tried:

```
make deinstall
make uninstall
```
_And it is a *no go*!_


----------



## Beastie (Sep 18, 2010)

How about removing (rm(1)) what is unneeded?


----------



## Seeker (Sep 18, 2010)

Beastie said:
			
		

> How about removing (rm(1)) what is unneeded?


Isn't that a little bit unhealthy, as I don't have a list of all files, scattered all over OS, that I should target for deletion, for that particular application


----------



## Beastie (Sep 18, 2010)

Seeker said:
			
		

> I don't have a list of all files, scattered all over OS


Is that so? Use whereis(1) or look at the files in the /usr/src/... directories.

For example, /usr/src/usr.bin/bluetooth: each subdirectory is for a different application; all .c files are the applications' binaries and are stored in /usr/bin (src/usr.bin, remember?) and all .<number> files are man pages stored in /usr/share/man (in this case, all section 1 pages).


----------



## fronclynne (Sep 19, 2010)

When it's working correctly the *delete-old* target in conjunction with src.conf(5) is probably going to do what you want.


----------



## Seeker (Sep 19, 2010)

fronclynne said:
			
		

> When it's working correctly the *delete-old* target in conjunction with src.conf(5) is probably going to do what you want.


Can you be more specific?
In this example, of fully installed system, I decide how I don't want to have base sendmail MTA installed, as I'll replace it with Postfix MTA.
I add in src.conf WITHOUT_SENDMAIL, and then I do ... ? (To avoid complete recompilation)


----------



## aragon (Sep 19, 2010)

Seeker said:
			
		

> Can you be more specific?




```
cd /usr/src && make delete-old
```


----------



## Seeker (Sep 19, 2010)

So, in my example, 'make' would parse src.conf and then get rid of sendmail?


----------



## aragon (Sep 19, 2010)

It should, yes.  If you run:


```
make check-old
```

You'll get a list of files that delete-old will delete.


----------



## Seeker (Sep 19, 2010)

Well it works on a per case basis:
*Didn't work* for WITHOUT_OPENSSH=YES, WITHOUT_MAIL=YES, WITHOUT_SENDMAIL=YES
*Did work* for WITHOUT_BIND=YES

I guess a complete recompilation is the only *clean* way?


----------



## Beastie (Sep 19, 2010)

As "clean" (whatever that means) as removing all files installed by make or extracted during the initial setup.


----------



## phoenix (Sep 20, 2010)

The only "clean" way, where you do not have any left-over files, is to buildworld and buildkernel as per normal. Then boot off a LiveCD and format the / filesystem (/, /lib, /bin, /sbin, /libexec, /usr/bin, /usr/lib, /usr/sbin, etc etc etc).  Then mount the clean filesystems, and run through the installkernel and installworld process.  Boot off the harddrive, and then run delete-old and delete-old-libs just to be safe (should be empty operations).


----------



## fronclynne (Sep 20, 2010)

Seeker said:
			
		

> Well it works on a per case basis:
> *Didn't work* for WITHOUT_OPENSSH=YES, WITHOUT_MAIL=YES, WITHOUT_SENDMAIL=YES
> *Did work* for WITHOUT_BIND=YES
> 
> I guess a complete recompilation is the only *clean* way?



Yeah, cheers.  Not every target for delete-old has been set up correctly (yet), obviously.  Sorry, I don't have the commit bit, yo, yeah, cheers?!  Umm, but yeah, installing to another drive, or a clean drive from a live CD might do the trick, as senor Ð¤Ð¸Ð½Ð¸ÐºÑ said.  Yeah, cheers.


----------



## brucec@ (Sep 20, 2010)

> Not every target for delete-old has been set up correctly (yet), obviously. Sorry, I don't have the commit bit, yo, yeah, cheers?



Patches are welcome, as always


----------



## Seeker (Sep 20, 2010)

We should only patch ports.
*src* is a dev's jurisdiction


----------



## Seeker (Sep 21, 2010)

Do we agree, that this is a *mistake* in src, that has to be fixed?
If that is so, then we need to report it as a PR?
Right?
That is, if it hasn't been already?


----------



## phoenix (Sep 24, 2010)

Seeker said:
			
		

> We should only patch ports.
> *src* is a dev's jurisdiction



Anyone can submit patches to the source tree.  How else would one become a dev?  And eventually get punished^W er... rewarded with a commit bit?  

At the very least, if you find a target that doesn't work as advertised, submit a PR.  Listing which files are left behind, contents of make.conf and src.conf, command issued, etc would be best.


----------



## richardpl (Sep 24, 2010)

CURRENT already supports most of what your are seeking (just found that WITHOUT_LOCATE is not supported).
But beware that many tools depends on each other: for example bc(1) on dc(1) on crypto(3) on openssl.


----------



## Seeker (Sep 24, 2010)

I see.
I would like someone else, to submit this PR.
'WITHOUT_*' lines aren't fully obeyed at OS *reinstallation*


----------

