GhostBSD pkg(8) Repository on FreeBSD

While FreeBSD UNIX generally has lots of great features – Quare FreeBSD – some of them described here – it also has its quirks.

One of such quirks is that pkg(8) packages for each major version – such as 13.x or 14.x – are always build against the sources of ‘oldest’ supported release. This is not a problem when first version of a tree is released – such as 13.0-RELEASE or 14.0-RELEASE for example.

The problem occurs when there is ‘any’ FreeBSD version from that tree already existing – like 14.1-RELEASE – and 14.2-RELEASE is released. Then the ‘older’ version from the tree – the 14.1-RELEASE in that case – will still be supported for 3 months since the release date of 14.2-RELEASE … but all pkg(8) packages will still be built on 14.1-RELEASE for these 3 months.

Its usually not a problem for applications that does not talk to kernel – so GIMP or Firefox will work without a problem.

The problem are kernel related packages – such as graphics/drm-kmod or emulators/virtualbox-ose-kmod packages – because they bring built kernel modules … and if something changed in 14.2-RELEASE then kernel modules built against 14.1-RELEASE kernel sources would just not work … and probably even KERNEL PANIC your system.

While FreeBSD developers do really good job at keeping the ABI stable in each FreeBSD tree – from time to time even they fail to sustain that.

Its even officially mentioned in the FreeBSD 14.2-RELEASE Errata page:

Also in the text form for convenience:

  • drm-kmod packages compiled on FreeBSD 14.1 result in the text console being inoperative when the kernel module is loaded. Recompiling the package from the ports tree will restore the lost functionality. This issue will also resolve itself after the FreeBSD 14.1 EoL, when packages for 14-STABLE will start being built on FreeBSD 14.2-RELEASE.

GhostBSD to the Rescue

Even 3 days ago the only solutions to this problem would be either to recompile all kernel related packages from FreeBSD Ports or recompiling them using Poudriere … both far from ideal and requiring time and experience.

Thanks to recent What is Coming for Future Releases of GhostBSD? announcement there is a lot better and seamless way.

What exactly changed? In the past GhostBSD used FreeBSD STABLE tree – so pkg(8) packages built on GhostBSD were useless on FreeBSD RELEASE systems – but now GhostBSD will now use RELEASE – and this means packages will be build against it.

Using GhostBSD Repository on FreeBSD

While all of this is still new – there already is first testing GhostBSD image based on FreeBSD RELEASE available here.

It has two pkg(8) repositories defined.

As GhostBSD already uses PKGBASE – one repo is for that purpose. Another one is for ‘regular’ packages – this one we will use.

Below You are instructions how to disable original FreeBSD pkg(8) repository and switch to GhostBSD one.

First – disable the default FreeBSD repository.


FreeBSD # mkdir -p /usr/local/etc/pkg/repos

FreeBSD # echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf

Next – create /usr/local/etc/pkg/repos/GhostBSD.conf file with following contents.

FreeBSD # cat /usr/local/etc/pkg/repos/GhostBSD.conf
GhostBSD: {
  url: "https://pkg.ghostbsd.org/unstable/${ABI}/latest",
  enabled: yes
}

DONE! Your FreeBSD 14.2-RELEASE-p1 system now uses GhostBSD packages that are also built on 14.2-RELEASE-p1.

FreeBSD # pkg -vvv | grep -A 256 '^Repositories'
Repositories:
  GhostBSD: { 
    url             : "https://pkg.ghostbsd.org/unstable/FreeBSD:14:amd64/latest",
    enabled         : yes,
    priority        : 0
  }

Lets install something …

FreeBSD # pkg install -y beadm
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from https://pkg.ghostbsd.org/unstable/FreeBSD:14:amd64/latest, please wait...
[ghostrepo] Installing pkg-1.21.3...
[ghostrepo] Extracting pkg-1.21.3: 100%
Updating GhostBSD repository catalogue...
[ghostrepo] Fetching meta.conf: 100%    178 B   0.2kB/s    00:01    
[ghostrepo] Fetching data.pkg: 100%    7 MiB   1.9MB/s    00:04    
Processing entries: 100%
GhostBSD repository update completed. 35990 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        beadm: 1.3.5_1

Number of packages to be installed: 1

11 KiB to be downloaded.

[ghostrepo] [1/1] Fetching beadm-1.3.5_1.pkg: 100%   11 KiB  10.9kB/s    00:01    
Checking integrity... done (0 conflicting)
[ghostrepo] [1/1] Installing beadm-1.3.5_1...
[ghostrepo] [1/1] Extracting beadm-1.3.5_1: 100%

FreeBSD # pkg info 
beadm-1.3.5_1                  Solaris-like utility to manage Boot Environments on ZFS
pkg-1.21.3                     Package manager

FreeBSD # beadm version
                                                        
      ___                     ___          __ ____ __   
     /  /                    /  /         / //    \\ \ 
    /  /   ____   ____   ___/  /___ ___  / //  /  / \ \ 
   /    \ /  _ \ /    \ /     //   \   \/ / \     \ / / 
  /  /  //  ___//  /  //  /  //  /  /  /\ \ /  /  // /  
  \____/ \____/ \_____\\____//__/__/__/  \_\\____//_/ 

beadm 1.3.5 2022/05/06

Viola!

You will no longer suffer from broken kernel related packages such as graphics/drm-kmod or emulators/virtualbox-ose-kmod on FreeBSD.

You can also just customize GhostBSD to your needs instead as showed for example in the XFCE Cupertino Way article.

UPDATE 1 – Unofficial KMOD Repositories

At first I wanted to reply to each comment about that – but as the reply is longer then most platforms allow – I will just reply ‘once’ here – and send links.

I have seen these various discussions about additional pkg(8) repositories with kernel modules built against proper FreeBSD version on FreeBSD Forums and/or Mailing Lists and/or Reddit – including kernel related packages names versioning changes to include kernel source against which these packages were built – but its just another unofficial way to overcome that problem.

There is no official announcement of this solution with these repositories on https://freebsd.org page – there is zero information about them in FreeBSD Handbook and/or FreeBSD FAQ – the FreeBSD 14.2-RELEASE Errata page does not mention them in any way …

… and while the questions are asked – why they are named kmods_quarterly_2 and kmods_latest_2 names? Something bad happened to kmods_quarterly and kmods_latest ones … or maybe the _2 suffix means something important?

Also – are they updated like regular latest and quarterly branches or its just a ‘one shot’ repos? For example – I know that the GhostBSD repository will be updated.

I assume as the release process for FreeBSD 13.5-RELEASE already started and soon it starts for FreeBSD 14.3-RELEASE – that these kmods_quarterly and kmods_latest repos will officially land in /etc/pkg/FreeBSD.conf file for each of these new releases and be enabled by default?

Right?

UPDATE 2 – FreeBSD Provided Repository for Kernel Modules

It was broadcasted on FreeBSD Mailing Lists as CFT (Call for Testing).

Many FreeBSD project members say that this is ‘THE’ official way of handling that problem.

There seems to be no plan to provide similar facilities for FreeBSD 13.x series – so 13.5-RELEASE can have 3 months without working kernel related packages – but maybe not – lets have some hope.

For FreeBSD 14.2-RELEASE the kmods_latest_2 and kmods_quarterly_2 repos are provided and the _2 part means the minor .2 version – so the kmods_latest_3 and kmods_quarterly_3 will be provided for FreeBSD 14.3-RELEASE and so on. I wonder what the naming will be when we will see FreeBSD 15.1-RELEASE πŸ™‚

The problem with these ‘OFFICIAL’ repositories is that they … do not contain all kernel related packages – for example emulators/virtualbox-ose-kmod is missing – and several others.

Another level of bandage for ‘OFFICIAL’ bandage seems to be some additional GitHub FreeBSD-kmod repo – which contains VirtualBox kernel module and also DRM related packages – which you need to fetch manually and install manually.

EOF

15 thoughts on “GhostBSD pkg(8) Repository on FreeBSD

      1. vermaden Post author

        … and that is another reason why this is just so unofficial πŸ™‚

        … and do not let me start where are the additional repos for 13.x series and how they would be named πŸ˜€

        Like

      2. Emrion

        I think it will become official if no serious problem is encountered. It just needs time.

        I believe this is THE solution. At worst, if this try is abandoned for whatever reason, I will return to compile the kernel modules, as I did before.

        The 13 branch is likely to never get these specific repos.

        Like

      1. Emmanuel Vadot

        What modules are missing ? iirc bapt extract the list of ports with USES=kmod to build them for those repositories.

        For the _2 it’s because the kmods are build for 14.2, it will be _3 for 14.3

        Also it’s not unofficial, it’s 100% official. It’s true that it’s not documented but this is pretty new (it was done for 14.2).

        About the update frequency I have no idea but looking at the directories timestamp it’s not a one shot repo.

        Like

      2. vermaden Post author

        For the _2 it’s because the kmods are build for 14.2, it will be _3 for 14.3

        … and how they are named for 13.x series then? πŸ™‚

        Its one big ‘on the fly’ bandage made to quickly ‘patch’ the problem – not to solve the problem permanently.

        Also it’s not unofficial, it’s 100% official. It’s true that it’s not documented but this is pretty new (it was done for 14.2).

        I can understand that ‘main’ FreeBSD website may not be notified by such things – but not a single mention in official documentation (Handbook/FAQ) and Errata page for the FreeBSD RELEASE its relevant – that is 100% UNOFFICIAL.

        What modules are missing?

        I did not used it – but even in the comments people reported that VirtualBox module was/is missing – which is a big drawback both for desktop/laptop and server users.

        Put yourself in a person that just decided to switch from Solaris/Illumos or Linux … or even Windows or macOS system. Such person relies on official project documentation – such person tries to setup their new home in some X11 environment – and is hit by something that should not be there … I would be REALLY PISSED OFF bu such thing.

        Unless its REALLY official and documented and maintained for this and next releases – its just another community workaround …

        Like

  1. BigSneakyDuck

    “if something changed in 14.2-RELEASE then kernel modules built against 14.1-RELEASE kernel sources would just now work”

    Should “now” be “not”?

    Liked by 1 person

    Reply
    1. vermaden Post author

      Thank You for that reply – fixed – when I check spelling of the article both ‘now’ and ‘not’ words are correct – but that does not mean they are logically correct πŸ˜€

      Like

      Reply
  2. Pingback: GhostBSD Pkg(8) ε­˜ε‚¨εΊ“δ½δΊŽ FreeBSD 上 - εζ‰§ηš„η ε†œ

  3. Pingback: Valuable News – 2025/02/17 | πšŸπšŽπš›πš–πšŠπšπšŽπš—

Leave a comment