# Exclude packages from pkg upgrade



## laufdi (Mar 22, 2014)

How can I exclude packages when doing pkg ugrade?

I have some ports installed with different options. They are always overwritten.


----------



## thommys (Mar 22, 2014)

You can do it with 
	
	



```
pkg lock pkg-name
```


----------



## Beastie (Mar 22, 2014)

Have you tried pkg-lock(8)?


> *pkg lock* is used to lock packages against reinstallation, modification or deletion. *pkg unlock* unlocks the named packages. Either variant only has an effect on currently installed packages. Consequently it is impossible to block installation of a new package by using this mechanism, unless such an installation implies updating a locked package.


----------



## laufdi (Mar 23, 2014)

Thanks, maybe a little hint from the man page of pkg-upgrade(8) would be nice.


----------



## laufdi (Apr 7, 2014)

It doesn't make sense to lock the port, as I can't deinstall it when upgrading by source (pkg_replace)


----------



## Beastie (Apr 7, 2014)

Then unlock it. What's the problem exactly?


----------



## laufdi (Apr 7, 2014)

I want to upgrade certain ports only by source because I have nonstandard options.
To avoid that pkg upgrades them I have to lock them. To upgrade via source I have to unlock them and then lock them again?


----------



## Beastie (Apr 7, 2014)

Well, yes. This seems to be the only way to do what you want.


----------



## Chris_H (Apr 8, 2014)

Just for clarification; I see the OP uses pkg(8). But replies appear to be from the older pkg-tools (pkg-) note the dangling hyphen. It's my understanding, and experience, they're different. Are they somehow the same, in the current context?

--Chris


----------



## wblock@ (Apr 8, 2014)

The man pages for pkg(8) are shown with dashes.  For example, `pkg info` is covered by pkg-info(8).

At this point, anyone still using the old pkg_* programs (with an underscore) should be planning on converting to pkg(8) soon.  The old stuff will be deprecated in September.


----------



## Chris_H (Apr 8, 2014)

wblock@ said:
			
		

> The old stuff will be deprecated in September.


Yes. I've heard. I have a _real_ issue with that. But having already addressed that on the stable@ list. I won't SPAM this thread with it. But rather. Take it up in the form of a pr(). 

Thanks for the clarification, @wblock@.

--Chris


----------

