Solved Need guidance on ports / pkg / pkgng

I have become quite confused on the status of package management on FreeBSD. I am coming to the conclusion that this is not necessarily an atypical state of mind. I have spent a fair bit of time searching for information on the web, and from that have also decided that a lot of what I have found is outdated, but it's very hard to separate "fresh" from "stale". I'd very much appreciate being pointed to the "Official" documentation for managing package updates, as well as how I should upgrade from 9.1.

I've been using ports, which has consumed a lot of time and resulted in a surprising amount of broken glass. At the moment a dozen or so packages are broken, most painfully for me editors/emacs (thankfully networking and ssh are ok). This appears to be a cascading problem from "lsof has been marked as IGNORE" (I think there may have been a second IGNORE'ed port). I tried to muddle through the port problems, and did multiple iterations of make deinstall and make reinstall. I edited some Makefiles to include FORCE_PKG_REGISTER= Yes. These fumbling approaches allowed some ports to install, but I still ended up with a significant number that would not, and I never felt that I was comprehending what I was doing.

I then learned that FreeBSD has a mechanism for binary package management. I can understand the power of compiling directly from source, but I would MUCH prefer to use pre-compiled binaries, and use ports as a fallback if problems crop up. But I have not been able to get pkg/pkgng to work. My last attempt was started from the handbook's pkgng intro, where I failed at:

Code:
pkg_add -r pkg
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.1-release/Latest/pkg.tbz: File unavailable (e.g., file not found, no access)
pkg_add: unable to fetch 'ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.1-release/Latest/pkg.tbz' by URL

Checking the FTP site finds that the subdirectory packages-9.1-release is missing. This appears to be... by design? I have skimmed the 2012 Compromise page, and understand that the loss of an SSH key and subsequent intrusion means that people were concerned about the integrity of the ports. It appears that this concern has extended to present day (at least for 9.1) and means that files are not available, at least in some places or through some mechanisms?

Practically, I'm at a loss as to how I should get out of the little hole I seem to be in. At the moment neither ports nor binary packages are working for me, and I'd really like something to allow upgrades. So most critically I'd really appreciate advice on how to get past my short-term problem (getting the system to a upgradable state). I suspect that this involves upgrading to 9.2, but I am not sure how to do that. Long term, advice on how to use binary packages would be greatly appreciated; I suspect that there's an official page for this, but as mentioned, I fear its a small amount of wheat buried in the chaff of all my web searches.

Thank you!

Code:
uname -a
FreeBSD citadel 9.1-RELEASE-p12 FreeBSD 9.1-RELEASE-p12 #0: Tue Apr 29 22:02:25 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
 
First, pick a direction. Ports offer flexibility but must be compiled. Packages are precompiled but the options are already selected and cannot be changed. Some people successfully combine both, but many have trouble with that.

If you use ports (I do), finding yourself modifying port Makefiles is a sign that something is wrong. Shrugging and continuing to do it is just thrashing around in quicksand. For reference, here is a short article on correctly upgrading ports: Upgrading FreeBSD Ports.

If it were me, I'd make a full backup, then upgrade to 10-STABLE (source-based), followed by a rebuild of all ports. I'm not aware of any reason to stick with FreeBSD 9.
 
listentoreason said:
I'd very much appreciate being pointed to the "Official" documentation for managing package updates, as well as how I should upgrade from 9.1.
For updating you have two options: updating from one supported release to another by binary upgrade with freebsd-update() or by sources. Both are described in the handbook Chapter 23. Updating and Upgrading FreeBSD. If you are running a GENERIC kernel, then using freebsd-update is very easy, because you don't even have to compile a new kernel.

listentoreason said:
I've been using ports, which has consumed a lot of time and resulted in a surprising amount of broken glass. At the moment a dozen or so packages are broken, most painfully for me editors/emacs (thankfully networking and ssh are ok).
After you upgrade the system, if you are still having problems with editors/emacs, please post the build log. I'm successfully building and running Emacs on lots of different FreeBSD versions.

listentoreason said:
This appears to be a cascading problem from "lsof has marked as IGNORE".
I'm not sure what's going on here, but I think fstat, which is included in the base system, provides the same/similar functionality to lsof.

listentoreason said:
I then learned that FreeBSD has a mechanism for binary package management. I can understand the power of compiling directly from source, but I would MUCH prefer to use pre-compiled binaries, and use ports as a fallback if problems crop up.
See section 5.4. of the handbook, Using pkgng for Binary Package Management.
 
I would suggest that you back up your data, then install version 10, use pkg (pkgng) to install any extra software: pkg install <packagename> That way you will be on an up to date system.
 
Ok, thanks all. Today is going to be verifying that backups are current, and then I will start the freebsd-update process, targeting 10.0. In addition to:
  • /home/
  • /etc/
  • /var/backups/[/file]
... and the zpool, any suggestions for other directories or files that should make it into a backup? Is /usr/local/etc/ relevant, or anything else in /usr/local/?

Comparing your suggestions to the handbook, would the newrelease parameter -r be "10" or "10.0", and would the suffix be "-RELEASE" or "-STABLE"?

Thanks!
 
Personally, I would make a complete new install if you were using a version less than 10, there have been a lot of changes. Backup anything you think may be necessary, (best to have more than you might need rather than less). I tend to make completely new installs when a version number changes.
 
listentoreason said:
would the newrelease parameter -r be "10" or "10.0"
The latter.
listentoreason said:
and would the suffix be "-RELEASE" or "-STABLE"?
The former. freebsd-update only works with release versions of FreeBSD, not with development branches (i.e. -STABLE and -CURRENT).
 
uname -a
Code:
FreeBSD citadel 10.0-RELEASE-p7 FreeBSD 10.0-RELEASE-p7 #0: Tue Jul  8 06:37:44 UTC 2014     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64
Well that was easy! I had put off doing this waiting for a full weekend to do the update. I was anticipating all sorts of "/sbin/frqx transliteration priority changed from '8' to 'K9/b'. [c]onfirm [d]eny [a]bort [r]eset pset?" and an extended web searching session. In the end I only had to intervene with diffs in /etc/group, /etc/master.passwd, /etc/motd, /etc/ntp.conf, /etc/passwd and /etc/ssh/sshd_config, and all of those were transparent and obvious. The whole process took exactly hour, including a shower while rebooting (my hardware comes up slow).

Thanks everyone for the advice! For what it's worth, this was far easier than updating the family room media computer from Ubuntu 12.04 to 14.04.
 
Last edited:
Back
Top