# Prevent a package from being installed



## sk8harddiefast (Feb 23, 2014)

Trying to set FreeBSD on Angie's computer I have a serious issue. Angie's computer have an old graphics card and needs nvidia-driver-304. But when I go to rebuild all packages with `pkg2ng` tries to update to the latest nvidia-driver and of course this two nvidia-drivers, conficts. How can I say to `pkg2ng` to do not upgrade nvidia-driver during the process of rebuild all packages? Is the first time that I use precompiled packages and `pkg2ng` and I stack.


----------



## trh411 (Feb 23, 2014)

*Re: Prevent a package from being install*



			
				sk8harddiefast said:
			
		

> Trying to set Freebsd on Angie's computer I have a serious issue. Angie's computer have an old graphics card and needs nvidia-driver-304.
> But when I go to rebuild all packages with pkg2ng tries to update to the latest nvidia-driver and of course this two nvidia-drivers, conficts.
> How can I say to pkg2ng to do not upgrade nvidia-driver during the process of rebuild all packages? Is the first time that I use precompiled packages and pkg2ng and I stack.


I remember another post on this topic awhile back and the solution was to use `pkg lock`. See pkg-lock(8).


----------



## sk8harddiefast (Feb 23, 2014)

*Re: Prevent a package from being install*

How to rebuild all packages on my system with pkg2ng? I cannot remember the command


----------



## wblock@ (Feb 23, 2014)

*Re: Prevent a package from being install*

pkg(8) shows all the subcommands.


----------



## trh411 (Feb 23, 2014)

*Re: Prevent a package from being install*



			
				sk8harddiefast said:
			
		

> How to rebuild all packages on my system with pkg2ng? I cannot remember the command


`pkg upgrade -f` should work. See pkg-upgrade(8).


----------



## sk8harddiefast (Feb 23, 2014)

*Re: Prevent a package from being install*

I read the manual but I don't find the command  and If I will not rebuild all packages I cannot tell you if `pkg lock` worked.


----------



## trh411 (Feb 23, 2014)

*Re: Prevent a package from being install*



			
				sk8harddiefast said:
			
		

> I read the manual but I don't find the command  and If I will not rebuild all packages I cannot tell you if pkg lock worked


You should not have to re-install all packages to verify `pkg lock pkg-name` works as you need it to. Just try upgrading the locked package. The lock should prevent it.


----------



## sk8harddiefast (Feb 24, 2014)

Sorry that I answered too late just a friend come to my home to drink a beer.
Is not preventing it.
I run `sudo pkg lock nvidia-driver` and `pkg lock nvidia-driver-331.20` but none of theme worked.
`sudo pkg check -d -a` tells me that wants to reinstall nvidia-driver-331.20
Also I ask the command to rebuild all the packages using pkgng because I want thinking that I know it but is not this that I had in my mind and I want know it.
Was a general question. Not only for the specific problem. Just is a usefull command.


----------

