Creating a local pkg repository

For a long time I have been interested in setting up my own local pkg repository but haven't really set about doing so.... How much space would it take up and how often would I need to update it, and is there a guide on setting up such a thing?
 
Here is how i do.
-I created a jail.
-Within this jail i do the ports building
-I use poudriere for building.
-I jail-zfs so poudriere can make use of zfs-features.
-To serve the build packages i use nginx within this jail.
This setup works fine.
As space requirement at least 30G , 300G is better.

A link,
 
  • Although you can do it manually (pkg-repo(8)), I really recommend using ports-mgmt/poudriere (or ports-mgmt/poudriere-devel for now if you want to mix in official packages) which automates building in clean environments and repository creation.
  • How much space your repository needs depends on the number and size of packages you want to have included, obviously. With the 210 ports I have currently listed, resulting (through dependencies) in 1958 packages, I currently get a repository of 7.4 GiB.
  • How often you "need" to update is up to you. How often do you want to update the machines using your repo? Are there security updates relevant for your ports, and how critical are they? How much time / computing power / energy does your bulk build consume? Find something that's a good balance for you. I normally do a bulk build every 1-2 months, but sometimes more often if I need to test something for ports development or need some security update quickly...
 
Is this still the preferred way to create your own pkg repo. Any caveats I should keep in mind.
My current goal is to get last proftpd version 1.3.9 as a package to deploy on some servers.
 
Is this still the preferred way to create your own pkg repo. Any caveats I should keep in mind.
"Preferred" is just that: personal preference. There are numerous ways to set up & maintain a repository; I myself prefer using Portmaster because it can keep my repository updated based on my installation habits. So basically... an installed and/or updated port gets both added to the system as well as the local repository.

(edit => turns out I even wrote a guide about this, maybe that can give you some ideas as well?).

From what I can tell most "port managers" can handle this process these days (Poudriere, Portmaster, Synth (?)). But at the same time, it's also relatively easy to script something yourself... All you basically need is pkg-create(8) and pkg-repo(8), maybe with a bit of OpenSSL to secure things.

But to actually address your issue:
My current goal is to get last proftpd version 1.3.9 as a package to deploy on some servers.
That shouldn't be too hard... If this is only about one package then you could just build it on your system, use pkg create -x proftp to get the package afterwards (or use the make package build target). Then you can easily distribute the package to your other server(s).

Keep in mind that pkg can use several transfer protocols to access a package. So the main server could even place the package online through a webserver, which can then be addressed by the other servers directly. Something like: pkg add http://my.server/repo/proftpd_latest.pkg.
 
Back
Top