Newbie question about package management

I have installed some packages using the pkg_add system. One of them being clamav. Well, I would like to upgrade to the newer package but I have made some changes to configuration files and such. I don't find a pkg_update function, so what would be the best way to upgrade the package and not loose my changes?

Can I uninstall the old package and install the new, or can I just do a pkg_add -f on the package? Simply doing a pkg_add on the new package fails. Am I missing an "update" switch I can throw somewhere?
 
DutchDaemon,

Thanks for the pointer at the pkg_upgrade script. I had seen the information about ports, and had already looked in the handbook and didn't see anything like portsupgrade for packages.
 
There is, and it's called portupgrade ;) If you use portupgrade with the -PP option, it will work with packages only. The downside is that it needs a full ports tree installed (for version information), and it will use the port version to tell you that packages are 'behind'.

Unfortunately, portupgrade doesn't know whether updated packages are actually available, so it will just keep on taunting you with messages about packages being outdated without a solution in sight. Packages can be lagging behind ports several months.

The pkg_upgrade script works with the version information on package sites, so it will always know when an available package is newer than the installed one. And upgrade it for you.
 
ok. One little problem. pkg_upgrade wants to upgrade everything. I don't want to do that. I just want to upgrade one single package to the version which I have downloaded. Specifically, if version 0.93 of clamav is installed, I want to upgrade to version 0.94 (which I have downloaded) of clamav (and only clamav). I use clamav as an example.
 
Since I don't use packages myself, I'm not familiar with the inner workings of pkg_upgrade. I'd assume there was a command-line flag telling it to operate on a single package. But I don't know that for sure. I do know that the author of the script is on this forum, so I hope he chimes in.
 
It seems to me that packages in FreeBSD are in a little bit of limbo. (For one thing they are a part of a google summer of code project).

I read this really nice article about ports and packages in Freebsd, written I think by one of the developers, but I can't find it now. It basically introduced pkg_upgrade, and as far as I can remember it said it was supposed to be used just for major upgrades (e.g. upgrade your entire system after a release). I gave it a try to upgrade from 7.1 to 7.2, and it worked really well. Saved me a lot of build time.

It seems like only in CURRENT are there up-to-date packages. I have never run a -CURRENT system, but on every other system it pretty much seems like packages are built at the beginning of a release, and if you want to keep up to date after that you have to build from ports. (there is only one ports tree, but packages are built separately for the different releases.)

So, for me, if I don't run -CURRENT, it seems like a lot of hassle to ever upgrade my ports tree, because then I have to upgrade everything by compiling from ports, since there seem to be no new packages for releases.
 
mdg583 said:
It seems like only in CURRENT are there up-to-date packages.
<snip>
So, for me, if I don't run -CURRENT, it seems like a lot of hassle to ever upgrade my ports tree, because then I have to upgrade everything by compiling from ports, since there seem to be no new packages for releases.

That's not right. -STABLE has a snapshot of up-to-date packages, and you can use those on any 7.x release too (since the ABI is the same). You just have to point to the right "repository."
 
You have it right now. Note that there is also 6-STABLE, which I did not mention.

The reason, in my opinion, is that 7.2-R (for example) is a well-developed and -tested snapshot of the 7 branch. The packages for that release are the ones current on that day. That does not change as things progress along the branch.

Current of course does not have a release.

This is just a nomenclature quirk, so I'd suggest you get used to it and move on.
 
mdg583 said:
Ah - so why would it be that the releases don't have up-to-date packages? (Does this page show the package status?) I guess I just point my system to here?

Packages are created for new releases, in order to have packages available on the release CDs. After that, packages are only updated if there are major changes to the ports tree (KDE 4 releases, GNOME releases, Xorg releases, things that touch a large portion of the tree). Packages really are only for convenience when setting up a new system, or when upgrading between releases. One should not rely on packages.

Packages for 6-STABLE, 7-STABLE, and -CURRENT are done on a monthly basis, I believe, in order to test changes to the ports tree, among other reasons. One can point the pkg_* tools to the -STABLE/-CURRENT package repos, and hope the packages will run on -RELEASE (they should, but there are no guarantees).

The ports tree is the primary software installation/upgrade mechanism. If one wants to use packages, one of the recommendations is to set up a separate package-building machine (or jail) and use either make package or pkg_create -b to create custom packages from the ports tree. Then copy those over to the other systems and install them using pkg_add.

There are different projects underway to make packages more useful, so maybe in the future one will be able to have a binary-only system.
 
Thank you very much - that helps me understand things a lot better. I think I am happier never upgrading my system for now, but just waiting for the next release. Or I can upgrade using pkg_upgrade every month or so.

Matthew
 
Back
Top