Change in pkg behavior?

Another horror story - running FreeBSD 14.2. Tried pkg upgrade and ended up with completely messed up desktop environment. It appears that pkg now removes all the packages before installing new ones rather than doing it one by one. So, what it did is completely removed 700 or so packages in one go, mostly my GUI apps. Plank has lost its layout config, as it automatically detects if a binary is there. pkg then tried to install new packages, got a "killed" message in the middle of the installation of LibreOffice. No apparent reasons. I've tried to resume by doing pkg upgrade again, but what it did is finished installing just a small number of packages, completely missed a large portion of what I had installed, and I ended up requiring to manually install packages one by one. (Installing LibreOffice the second time went fine.)

I've never seen anything like this since the launch of pkg. Does anyone know why such a radical change in pkg behavior was implemented, and what's the correct way to upgrade packages now?
 
Another horror story - running FreeBSD 14.2. Tried pkg upgrade and ended up with completely messed up desktop environment. It appears that pkg now removes all the packages before installing new ones rather than doing it one by one. So, what it did is completely removed 700 or so packages in one go, mostly my GUI apps. Plank has lost its layout config, as it automatically detects if a binary is there. pkg then tried to install new packages, got a "killed" message in the middle of the installation of LibreOffice. No apparent reasons. I've tried to resume by doing pkg upgrade again, but what it did is finished installing just a small number of packages, completely missed a large portion of what I had installed, and I ended up requiring to manually install packages one by one. (Installing LibreOffice the second time went fine.)

I've never seen anything like this since the launch of pkg. Does anyone know why such a radical change in pkg behavior was implemented, and what's the correct way to upgrade packages now?
Out of curiousity, exactly what pkg command did you run? By default "pkg upgrade" will give you a list of packages to be upgraded, reinstalled and removed AND prompt you for "what next" with a Yes/No option.
So you either accepted the default (Y) or did pkg upgrade -y.

Switching from quarterly to latest can also cause havoc, but if one starts with "-n" you can figure out what may happen.
You need to give a little more info about the "killed" message: did something run out of memory, did you do upgrade from within the DE?
 
mer, I did "pkg upgrade". It did provide me with a sane list, which I accepted. It never finished running through its list. It might have ran out of memory - it has never occurred to me I have to check RAM usage before doing package upgrades, and yes, I upgraded from within the DE, which I know I probably shouldn't have done. I've never seen pkg dropping its intended upgrade list, however, which is odd.
 
  • Like
Reactions: mer
Out of curiousity, exactly what pkg command did you run? By default "pkg upgrade" will give you a list of packages to be upgraded, reinstalled and removed AND prompt you for "what next" with a Yes/No option.
So you either accepted the default (Y) or did pkg upgrade -y.

Switching from quarterly to latest can also cause havoc, but if one starts with "-n" you can figure out what may happen.
You need to give a little more info about the "killed" message: did something run out of memory, did you do upgrade from within the DE?
There was an issue somewhat recently where pkg would just get killed during the upgrade. Since it change its behavior to remove a lot of dependency to avoid cyclic dependency when installing.
You may be in the situation where it removes like 200 packages, install one, and then try to install the other 200 left.
If you are unlucky, and pkg dies after deleting the 200 first packages, then it will not be able to recover them after.
 
There was an issue somewhat recently where pkg would just get killed during the upgrade. Since it change its behavior to remove a lot of dependency to avoid cyclic dependency when installing.
You may be in the situation where it removes like 200 packages, install one, and then try to install the other 200 left.
If you are unlucky, and pkg dies after deleting the 200 first packages, then it will not be able to recover them after.

I have not experienced this issue, but this is a great reason to suggesting periodically cloning your Boot Envrionment. Or even right before a big pkg update.
 
I have not experienced this issue, but this is a great reason to suggesting periodically cloning your Boot Envrionment. Or even right before a big pkg update.
If you are using root on ZFS, then "bectl create BeforePkgUpgrade"

creates a new BE called BeforePkgUpdate that represents the currently working system.
Running "pkg upgrade" then does everything into the current BE, preserving the system.

I run quarterly, and do this before doing pkg upgrades. It's also useful for doing binary system upgrades across releases because you can create a new BE, do chroot stuff for freebsd-update and pkg commands so you can wind up with a consistent system before doing the reboot.
 
Back
Top