pkg info
on the source machine to get a list of all installed packages and then doing a pkg install
on the target machine using that list as an input.It would get the files there, yes. They'll work too. But they won't be registered in the package database. So the system thinks nothing is installed.I was thinking of copying /var/cache/pkg/ and /usr/local/. Would that get me close?
How does 'the system' know what is installed? Where is that info held?It would get the files there, yes. They'll work too. But they won't be registered in the package database. So the system thinks nothing is installed.
It's stored in /var/db/pkg/local.sqliteHow does 'the system' know what is installed? Where is that info held?
So you canAs the name suggests it's an SQLite database.
pkg shell 'vacuum; reindex'
at your own risk.It should be possible, but I prefer to copy complete system if I need to have a clone of some installation.Is there any way of copying pkgs from one system to another without re-installing them?
I guess it would do no harm to copy that file as well... What about the other files under /var/db/pkg/ ?It's stored in /var/db/pkg/local.sqlite
The majority of packages install under /usr/local, but not everything is installed there; some packages install contents only or even in other locations, e.g.:
The list is surely not exhaustive, so you should carefully check that nothing is missing.
- sysutils/e2fsprogs (installs filesystem checking utilities in /sbin)
The list is surely not exhaustive, so you should carefully check that nothing is missing.
pkg shell 'select path from files'|grep -v ^/usr/local
pkg shell 'select path from directories'|grep var
DESCRIPTION
Do not rely on this command.