# pkg upgrade



## razsnic (Dec 28, 2017)

Hello!

Question #1:
When you run _pkg upgrade_, how does FreeBSD know what packages to install, upgrade or reinstall? Where is the file or database that it reads in order to make the necessary changes?

Question #2:
Is there a way to change the dependency requirements for a package? For example, from PHP5.6 to PHP7.1?

Thank you!
Raz


----------



## SirDice (Dec 28, 2017)

1) It's stored in a database; /var/db/pkg/local.sqlite. Remote package repository information is typically cached in /var/db/pkg/<reponame>.sqlite.

2) No.


----------



## ShelLuser (Dec 28, 2017)

Actually... Although it's not possible to 'simply' change the dependencies for an existing package it is of course easily done to build a new packages which has the dependencies you require. So building a package using the Ports collection.


----------



## SirDice (Dec 28, 2017)

ShelLuser said:


> So building a package using the Ports collection.


Yes. To elaborate, you cannot change dependencies of existing packages. You can however build your own packages using your own defaults.


----------

