pkg_radd: oddly successful with upgrades

The utility pkg_add has a -u option that tells it to upgrade any existing matched package with a given binary package.  Since pkg_radd passes options on to the underlying use of pkg_add, after automatically setting a remote repository for binary files, pkg_radd -u <packagename> tells pkg_add to automatically find and upgrade a package.

I never thought this would work.  However, I’m building a package on a system that has pkgsrc-2010Q1 packages installed, but a pkgsrc-2010Q3 /usr/pkgsrc.  Every time I’ve encountered an error because installed software was too low a version, pkg_radd -uv <package_name> has resulted in a quick upgrade.

I’m not recommending this as a new upgrade method; I’m noting how unexpectedly well this experiment is going.  It may be just blind luck, but this sure would be nice if it ‘just worked’.

2 Replies to “pkg_radd: oddly successful with upgrades”

  1. i don’t know anything about pkgsrc but openbsd does the same thing pretty well (‘pkg_add -u’ for both local and remote), so i’m curious why you think it shouldn’t work for pkgsrc when the option is provided?

  2. Try a ‘bmake update’ or ‘bmake upgrade’ with pkgsrc, (I forget which it is), and it may work, it may not. I extended the same worry to ‘pkg_add -u’, for valid reasons. I haven’t tried it on less cooperative packages like bmake itself, for instance.

    All the binary packages I upgraded had newer versions available; what would happen if the newer package wasn’t there, or failed? Pkgsrc deletes the existing package and then installs the new. If anything goes wrong with installing the new package… the software is gone.

Comments are closed.