Packages and ports are out of sync : how to sync them or...how to upgrade a single package without removing a LOT of dependencies.

Hello.

I'm trying to update all my port tree with portsnap,but I found a problem that I'm not able to fix :

Code:
# portsnap fetch update && portupgrade -a

Looking up portsnap.FreeBSD.org mirrors... 5 mirrors found.
Fetching snapshot tag from dualstack.aws.portsnap.freebsd.org... done.
Latest snapshot on server matches what we already have.
No updates needed.
Ports tree is already up to date.
[Reading data from pkg(8) ... - 1227 packages found - done]
[Updating the portsdb <format:bdb_btree> in /usr/ports

... - 33748 port entries found
.........1000.........2000.........3000.........4000.........5000..
.......6000.........7000.........8000.........9000.........10000...
......11000.........12000.........13000.........14000.........15000
.........16000.........17000.........18000.........19000.........20
000.........21000.........22000.........23000.........24000........
.25000.........26000.........27000.........28000.........29000.....
....30000.........31000.........32000.........33000....... .....
done]

** Port deleted on 2023-03-12: devel/libpthread-stubs
        No consumers left and never supported pthread stubs in libc on FreeBSD

.....

--->  Upgrading 'nettle-3.8.1' to 'nettle-3.9' (security/nettle)
--->  Building '/usr/ports/security/nettle'
===>  Cleaning for nettle-3.9
Dependency error: This port wants the OpenSSL library from the FreeBSD
base system. You can't build against it, while a newer
version is installed by a port.
Please deinstall the port, remove DEFAULT_VERSIONS=ssl=base or
undefine WITH_OPENSSL_BASE.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/security/nettle
*** Error code 1

Stop.
make: stopped in /usr/ports/security/nettle
egrep: empty (sub)expression
** Command failed [exit code 1]: /usr/bin/script -qa
/tmp/portupgrade20230528-50108-1h6510y env UPGRADE_TOOL=portupgrade
UPGRADE_PORT=nettle-3.8.1 UPGRADE_PORT_VER=3.8.1 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        - devel/libpthread-stubs (port deleted)
        ! archivers/unrar (unrar-6.20,6)        (unknown build error)
        ! security/nettle (nettle-3.8.1)        (unknown build error)


nano /usr/ports/security/nettle/distinfo

TIMESTAMP = 1685162040
SHA256 (nettle-3.9.tar.gz) = 0ee7adf5a7201610bb7fe0acbb7c9b3be83be44904dd35ebbcd965cd896bfeaa
SIZE (nettle-3.9.tar.gz) = 2393838

# pkg version | grep nettle
nettle-3.8.1

what to do here ? Should I upgrade the single package nettle-3.8.1
to 3.9 ? Should I remove the nettle from the packages ?
I don't want to do this,because this is what would happens :

Number of packages to be removed: 313

basically the whole system will be uninstalled. And then ?
 
You can't have both of two worlds.
Let me give my example.
I compile with make.conf option mysql-server equals mariadb.
But the packages are compiled with mysql instead of mariadb.
So if i install one i uninstall another and vice-versa. They just conflict.
For me there was only one solution.
Compile everything from ports with mariadb.
[& Remove ports which take too long to compile]
 
You can't have both of two worlds.
Let me give my example.
I compile with make.conf option mysql-server equals mariadb.
But the packages are compiled with mysql instead of mariadb.
So if i install one i uninstall another and vice-versa. They just conflict.
For me there was only one solution.
Compile everything from ports with mariadb.
[& Remove ports which take too long to compile]

I know,I know,but usually I make a mixed installation (with a certain number of packages and ports) and I haven't any problem. This happens as default for me. In this case I can upgrade the packages and the ports simultaneously. Instead,in some particular cases,they go out of sync. Sometime is easier to put them in sync again,sometime it is harder. ok. no more portsnap.
 
** Port deleted on 2023-03-12: devel/libpthread-stubs No consumers left and never supported ...
Looks like you can delete this one. See if other ports depend on it with pkg info -r devel/libpthreads-stubs. If not, delete it with pkg delete -f devel/libpthreads-stubs.

Packages may lag somewhat behind ports. Patience works! Concerning nettle, what is in your /etc/make.conf?
 
Code:
# pkg info -r devel/libpthreads-stubs
pkg: No package(s) matching devel/libpthreads-stubs

# pkg delete -f devel/libpthreads-stubs

Updating database digests format: 100%
No packages matched for pattern 'devel/libpthreads-stubs'

I don't have any /etc/make.conf file.
 
You can't have both of two worlds.
Let me give my example.
I compile with make.conf option mysql-server equals mariadb.
But the packages are compiled with mysql instead of mariadb.
So if i install one i uninstall another and vice-versa. They just conflict.
For me there was only one solution.
Compile everything from ports with mariadb.
[& Remove ports which take too long to compile]

here the problem is that the package nettle 3.9 does not exists yet :


but the port exists :

Code:
/usr/ports/security/nettle # nano distinfo
TIMESTAMP = 1685162040
SHA256 (nettle-3.9.tar.gz) = 0ee7adf5a7201610bb7fe0acbb7c9b3be83be44904dd35ebbcd965cd896bfeaa
SIZE (nettle-3.9.tar.gz) = 2393838

So,there is a delay between the creation of the ports and the packages. This is the main reason why I'm having this problem. And this is the reason why I can't use both,ports and packages. The cause is not a factor that depends about my (possible bad) administration of the system,but it is caused by one external factor.
 
If you can't wait for the official package binary builders to complete their run (which I honestly doubt) you would be better of building everything yourself using something like ports-mgmt/poudriere. There are plenty of guides available if you don't want to read the documentation such as the one I created myself: https://blog.insane.engineer/post/freebsd_poudriere_guide/

The kind of guides I like to read are the ones you wrote. As soon as I saw it,I have immediately understood that it is suitable for the way my mind "love" to process data.
 
I have a rule of thumb for mixing packages and ports.
1. Keep your make.conf as short as possible.
2. Or use mostly packages and a few ports
Or use mostly ports and a few packages
50% ports & 50 % packages is a bad idea.
 
I have a rule of thumb for mixing packages and ports.
1. Keep your make.conf as short as possible.
2. Or use mostly packages and a few ports
Or use mostly ports and a few packages
50% ports & 50 % packages is a bad idea.
I could not agree more strongly :)
I have custom builds of FFMPeG and sox for my own reasons and even with just those two, there are the odd problems caused by mixing packages and ports. Sox not so much, but there are "windows" where FFMPeG can be built against the currently installed ports and other times when building FFMPeG comes back with a load of dependencies that need building too, which I don't to do.

There's also been times, such as just recently, when doing a pkg upgrade (with both sox and FFMPeG pkg locked), has resulted in FFMPeG not being able to run due to "missing" depandancies. The workaround is to install the FFMPeG package and wait for the next "window" where FFMPeg will build against the installed packages, which usually only take a few days to a week.

YMMV etc., so, in strong agreement with Alain De Vos above, choose packages OR ports and, if you have very specific reasons, keep your use of the opposing installation system to as bare a minium as possible and DO expect issues over time.
 
An alternative, if you want some individual pieces of software, is to not use ports or packages at all. Install them to an /opt/specialsoftware/ $PREFIX. You can still use the patches from the FreeBSD port.

The only drawback is that required libraries in /usr/local/ that are needed by /opt/specialsoftware/ have no protection against removal. `pkg autoremove` becomes risky unless you lock all dependencies manually. But you can improve that by also installing the FreeBSD port of the special software.
 
Back
Top