# How to stop portmaster -a from prompting to delete old pkg



## SpaceCowMan (Sep 25, 2014)

I am doing an update of the ports on my system which is using PKGNG and FreeBSD 9.1.  Here is the command I am running: `# portmaster -a --no-confirm`. Unfortunately, portmaster still keeps prompting me with messages like the following:

```
===>>> Delete pkg-1.3.7.tar.xz? y/n [n]
```

How do I tell portmaster to automatically delete these packages if the upgrade was successful?  I've read the manual several times and tried multiple options but I keep getting these prompts.  I'd really like to automate this process.

*T*hank you in advance!


----------



## talsamon (Sep 25, 2014)

*Re: How to stop portmaster -a from prompting to delete old p*



> man portmaster
> 
> --no-confirm
> do not ask the user to confirm the list of ports to be installed
> ...



If you use the option -D `portmaster` didn't ask in most cases. In some cases it does it still, I don't know why.


----------



## SpaceCowMan (Sep 25, 2014)

*Re: How to stop portmaster -a from prompting to delete old p*

The thing is, this is not about cleaning distfiles, this is about cleaning the installed packages which are in .tar.xz format.  The distfiles are a whole separate nightmare.


----------



## talsamon (Sep 25, 2014)

*Re: How to stop portmaster -a from prompting to delete old p*

I never looked in this, maybe you find the options you need here: /usr/local/etc/portmaster.rc.sample.


----------



## SirDice (Sep 26, 2014)

*Re: How to stop portmaster -a from prompting to delete old p*



			
				SpaceCowMan said:
			
		

> The thing is, this is not about cleaning distfiles, this is about cleaning the installed packages which are in .tar.xz format.  The distfiles are a whole separate nightmare.


Am I right to understand you want to keep the package that was just built? Try adding the -g switch:

```
-g  create a package of the new port
```
It's what I always used before I set up ports-mgmt/poudriere.


----------



## talsamon (Sep 26, 2014)

*Re: How to stop portmaster -a from prompting to delete old p*

Portmaster is a script. Another way could be to copy the script rename it as you like, change it and work with your own "portmaster".
You can alter the lines with 
	
	



```
get_answer_g
```
 e.g. comment it out and/or set a fix return-value.


----------

