How to copy a port build

If I have built an app from ports how do I copy it to another system? Do I first need to create a pkg and then use pkg install on the other system?
 
make package or pkg create firefox if firefox is installed and scp/rsync
 
So, I've now managed to create my pkg and want to install it from a local repository....

According to https://www.freebsd.org/cgi/man.cgi?query=pkg.conf the system wide configuration file is:-
/usr/local/etc/pkg.conf

and that includes:-
Code:
# Configuration options -- default values.

#PKG_DBDIR = "/var/db/pkg";
#PKG_CACHEDIR = "/var/cache/pkg";
#PORTSDIR = "/usr/ports";
#INDEXDIR = "";
#INDEXFILE = "INDEX-10";        # Autogenerated
#HANDLE_RC_SCRIPTS = false;
#DEFAULT_ALWAYS_YES = false;
#ASSUME_ALWAYS_YES = false;
#REPOS_DIR [
#    "/etc/pkg/",
#    "/usr/local/etc/pkg/repos/",
#]

so even though these values are commented out I assume they are used. But when installing my pkg in /usr/local/etc/pkg/repos/ and running pkg install -n -r /usr/local/etc/pkg/repo kodi I get
No repositories are enabled.
I created a /usr/local/etc/pkg/repo and put my pkg in it.

Then after creating /usr/local/etc/pkg/repo/FreeBSD.conf containing
Code:
FreeBSD: { enabled: YES }
I get the same msg.

Is there a tutorial on this anywhere?
 
You're not supposed to put the packages in /usr/local/etc/pkg/repos, it's for configuration files. Similar to /etc/yum.repos.d/ on CentOS/RedHat. You don't save RPMs in there either.

Is there a tutorial on this anywhere?
Have a read through pkg-repositories(8).

You can install packages from a local directory with pkg-add(8), i.e. pkg add /tmp/mypackage.tgz
 
If you have only one pkg you can do pkg add /tmp/kodi.txz
If you have multiple pkgs, you can create some random dir (see url below), put them here and do pkg repo $url
This is what I have on my system :
Code:
cat /usr/local/etc/pkg/repos/FreeBSD-base.conf
# FreeBSD base system repository
FreeBSD-base: {
  url: "file:///usr/obj/usr/src/repo/${ABI}/latest",
  enabled: no
}

FreeBSD-base2: {
  url: "http://192.168.2.1/repo/FreeBSD:13:aarch64/latest/",
  enabled: yes
}
 
Well I thought I'd finally got the hang of it but it turns out that the pkg was built on 11.2 and that I couldn't install it on 12.0 :(..

So now I have to run:-
Code:
freebsd-update upgrade -r 12.0-RELEASE
freebsd-update install
shutdown -r now
freebsd-update install
pkg-static upgrade -f
freebsd-update install
shutdown -r now

and then I can start to build my app again....

although I'm not sure if I need to upgrade ports... Is the same ports collection used for every architecture and release of FreeBSD?
 
Back
Top