HOWTO: keeping FreeBSD's base system and packages up-to-date

I've just installed FreeBSD 9.0-RELEASE and would like to update to FreeBSD 9.0-STABLE and have my system up-to-date. But it looks like this guide is for FreeBSD 8.2 or some older version?

vermaden said:
cat > /root/stable-supfile << EOF
*default host=cvsup.pl.freebsd.org
*default base=/var/db
*default prefix=/usr
*default release=cvs tag=RELENG_8
*default delete use-rel-suffix
*default compress
src-all
EOF

Should this not be RELENG_9 ? Is it even possible to update with this guide from RELEASE to STABLE? Sorry for the noobish questions, but i don't want to destroy my fresh installed system.
 
First of all, why do you want to go from -RELEASE to -STABLE? Are you sure you know what you are doing?

Remember, you can use all the packages from -STABLE without needing to move base system from -RELEASE.
 
bbzz said:
First of all, why do you want to go from -RELEASE to -STABLE? Are you sure you know what you are doing?

Well, I guess FreeBSD-STABLE is something like Debian Testing or Debian Sid. If I'm right in this case, I think I know what I'm doing. Would just like to have a fully up-to-date system.

bbzz said:
Remember, you can use all the packages from -STABLE without needing to move base system from -RELEASE.

All right. Didn't know that. I've read in the handbook about freebsd-update, but it seems like it is not the best choice. For example, I want to update Opera and Pidgin to the newest STABLE version, how would I do this without also updating the RELEASE base system?
 
The operating system and applications aren't tied together. There is no -stable version of ports, the ports tree always has the latest version that's been ported. The reason to run FreeBSD-STABLE is to get the latest features and bug fixes in the operating system.
 
  • Thanks
Reactions: ryu
wblock@ said:
The reason to run FreeBSD-STABLE is to get the latest features and bug fixes in the operating system.
FWIW: As well as the new bugs. -STABLE doesn't break often, but it does happen occasionally.

Fonz
 
I was using that script in my /etc/profile and when I installed gnome2 with GDM, GDM doesn't want to start with this script! I put it in .profile and the same thing happens when I try to log with my user.

Is there any other place I can put it?
 
vermaden said:
Thats very easy to accomplish, make a list of Your installed packages, then remove all installed packages, then install them again from the list You have just made, like that:

Code:
# pkg_info -qoa > LIST
# pkg_delete -a
# rm -r -f /var/db/pkg /usr/local
# while read I; do pkg_add -r $( basename ${I} ); done < LIST

In case You are using a CSH shell, type sh before while loop, like that:

I have a FreeBSD 8.3-RELEASE system which I just upgraded to FreeBSD 9.0-RELEASE. When I try the above command, most packages install cleanly. But I get a variety of errors, like this:

Code:
# while read I; do pkg_add -r $( basename ${I} ); done < LIST
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.0-release/Latest/ruby-bdb.tbz: File unavailable (e.g., file not found, no access)
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.0-release/Latest/ncftp3.tbz: File unavailable (e.g., file not found, no access)
Error: Unable to get ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.0-release/Latest/perl5.12.tbz: File unavailable (e.g., file not found, no access)
[/CODE]

From what I can tell, according to `pkg_info -qoa`, my system had a package named databases/ruby-bdb . However, there is no package named ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9.0-release/Latest/ruby-bdb.tbz .

What is happening here? Is does ruby-bdb have a different name in ports then as a package?

I can go ahead and install the packages by hand on this one system, but is there a way to cleanly do this automatically with some shell code?
 
I can go ahead and install the packages by hand on this one system, but is there a way to cleanly do this automatically with some shell code?
For next time maybe, you may find the small howto I wrote yesterday useful... Unsure how
it would work for all ports, but I just completed a reinstall seamlessly.
Every so often I'd have to stop/restart it, thereupon I'd check the latest packages saved
to /usr/ports/packages/All and delete the subset (ports already
reinstalled) from the temporary file (package)
list (see the writeup in the How_To section...) with "edit" or "nano -w", to restart the reinstall again.
 
stefanlasiewski said:
What is happening here? Is does ruby-bdb have a different name in ports then as a package?

Yes, its sometimes that way, that package has different name then a port.

stefanlasiewski said:
I can go ahead and install the packages by hand on this one system, but is there a way to cleanly do this automatically with some shell code?
Probably yes, it will require scanning all 23 000 Makefiles in the Ports tree to get create the mapping of port name and a package name, and according to that mapping translate port name to package name and vive versa.
 
Awesome, great, this is what I was looking for. I'm new with FreeBSD but on my environtment at least there are three machines, and I update it manually. Thanks.
 
Thank you so much to @vermaden for this, and all the other wonderful tutorials. Since the HOWTO was written in September 2011 (last edited January 2012), would there be any changes now, for one wishing to track FreeBSD-stable? For example, the HOWTO lists:

# pkg_add -r bsdadminscripts portmaster portaudit

Would there be any change if one would want to use PKGNG?

Thank you so much, once again.
 
Last edited by a moderator:
@@priyadarshan

Welcome.

I used this 'way' for updating quite a long time, but I haven't used it lately. I moved to PKGNG, but I think that PKGNG is not (yet) better then classic pkg_* tools and packages. It WOULD be better if it will add package 'variants' like on OpenBSD when you type pkg_add -i ... and you can make a choice in an interactive menu if you want Conky with TTF built in or without it. On FreeBSD with PKGNG you can only add packages that are built with default WITH/WITHOUT flags, so no TTF in Conky for example. The other issue with PKGNG is that it REINSTALLS the packages that you built from Ports, no matter of newer or older, so after pkg upgrade you will have to rebuild your customized ports, which is pretty annoying.

I currently use PKGNG as 'packages database format' because its faster, even for simple package info, but I very rarely use PKGNG to install/update packages, I just use portmaster which RESPECTS my WITH/WITHOUT flags and previously selected options for Ports.

I have tried the PC-BSD repository for PKGNG, but as its still PKGNG it has the same issues I described above.

There were times, that I would not compile big ones like editors/libreoffice, but now I just do it overnight.
 
Last edited by a moderator:
If you build all PKGNG packages yourself in a jail(8) with for example poudriere you won't have problems with PKGNG packages conflicting with local modifications because pkg install and pkg upgrade will be the only sources of installed ports/packages and you get very good control over the options for built packages.
 
kpa said:
If you build all PKGNG packages yourself in a jail(8) with for example poudriere you won't have problems with PKGNG packages conflicting with local modifications because pkg install and pkg upgrade will be the only sources of installed ports/packages and you get very good control over the options for built packages.

Yes, that is one of the 'solutions', but if I build the packages anyway with portmaster, why then waste time (and space) for poudriere setup and maintenance when I have to build these packages anyway? :)

I only find that useful (setting up poudriere) with more then 2 systems, along with having personal freebsd-update server from 'STABLE'.
 
Building times are roughly the same once you have the system set up, the jail cloning at the start up takes some extra time so if you build only a few ports then the difference may be noticeable. You also get the benefit of getting packages that are guaranteed to have been built in a clean environment where only the required dependencies are installed for building. There's never a possibility that there are leftover files from previous versions of the ports that you're building. Or some unrelated port (like the KDE4 build problems when KDE3 libraries are installed at the same time) interferes with the build. You don't get such guarantees when building ports unjailed with ports-mgmt/portmaster on the same host where you install them.
 
Back
Top