18

I mostly use packages on FreeBSD, because most of them suit me just fine. Some don't suit me, however, like the vim package, which does not include a graphical gvim.

No problem. I can install the port instead, using portmaster editors/vim and selecting the GTK2 option. This works fine.

However, when I run pkg upgrade after a while, I am presented with the following:

        Reinstalling vim-7.4.110_3 (options changed)

What gives? I didn't change any options, and there is no new version (not in ports, either). Is it comparing my installed port to the remote version without GTK2?

Of course I can let pkg upgrade do its work and install the port again afterward, but this is stupid. What is the recommended way to update a mix of packages and ports?

3
  • Is using pkg lock the recommended solution? It works, but I would hope something as simple as this could be handled automatically. Jan 20, 2014 at 20:52
  • Yes, pkg lock is the solution designed for that: from the man page: “pkg lock is used to lock packages against reinstallation, modification or deletion.”.
    – Dereckson
    Aug 28, 2014 at 17:49
  • this post is quit old. But I like to told that I have until now the same problem. I had asking the FreeBSD Forum "Using packages and ports at the same time?" And one member give me the advice to use a script for installation updates, like he has done. You can find it there in his answer.
    – HL1234
    Feb 12, 2017 at 18:40

1 Answer 1

15

You need to remember that pkg and ports register installed software in the same place (an SQLite database in /var/db/pkg). Neither system records any additional information that a particular piece of software was installed as a pre-compiled package, or as a port. Thus, once a piece of software is installed by either approach, the tools have no way of knowing how it was installed.

When you selected GTK2 support for the editors/vim port, that was registered in the package database. When you later ran pkg upgrade, pkg looked at the package data for vim, and found that GTK2 support had been enabled in the installed version, whereas it is not enabled in the pre-compiled package. pkg upgrade is doing exactly what it should - finding any installed packages that are different from the available pre-compiled packages, and attempting to upgrade them. Those differences can be in version number, dependency graph, compile-time options, etc.

The proper way to prevent pkg from considering a port or package (once installed, there is no difference, as far as the tools are concerned) that you want to protect is to use the pkg lock command.

Alternatively, if you find yourself changing options on a number of ports, you might consider installing poudriere and maintaining your own package repository. It takes a bit of setting up, and works best if your build host has a ZFS storage pool, although it will work if you don't have ZFS; it is a very flexible and convenient way to manage custom software builds.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .