Solved Convert ports to packages

I have a freebsd server that has ~120 ports installed on it. Is there any elegant way to convert these to packages? I am not using any special compile options, so I think I would be just fine with precompiled packages. This is on a VPS that is resource limited so compiling ports takes forever.
 
Once the ports are compiled and installed, they turn into packages. So, in theory, you could simply use # pkg upgrade for keeping the packages updated. There are some obstacles though:
  1. Since FreeBSD 11, the default package repository is quarterly, that means the package repository may be 90 days old. Most probably you want to place the following content into the file /usr/local/etc/pkg/repos/FreeBSD.conf:
    Code:
    FreeBSD: {
      url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
    }
  2. It well might have happened, that some compile time options were changed inadvertently in the course of the installation of the various ports. In this case, pkg(8) wants to reinstall some packages because of changed options, and it prompts you with the list of the changes to be applied. Review the list carefully before continuing by typing y(es).
Later you may clean old cached ports and packages:

# pkg clean
# portmaster --clean-distfiles
# rm -r /usr/ports/*/*/work
 
Ah interesting. I am new to FreeBSD. So as long as I keep up on pkg upgrade I should be good for updates (assuming I use the more up to date repo)?
 
Ah interesting. I am new to FreeBSD. So as long as I keep up on pkg upgrade I should be good for updates (assuming I use the more up to date repo)?
Yes, the quarterly repository receives security, build, and runtime fixes too, so you will be good for updates with either the latest or quarterly repository.
 
Once the ports are compiled and installed, they turn into packages.
More accurately, ports are always compiled into packages and that resulting package is what's actually being installed.
 
This site seems still be under maintenance.
Yeah, it sometimes breaks. I often use it to verify if a port/package is really broken or if it's my own fault. If it builds on the official clusters but not on my systems I probably did something wrong.
 
Back
Top