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

On 9 RC1 amd64 I got:

Code:
pkg_upgrade -a -C
fetch: ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-stable/INDEX: File unavailable (e.g., file not found, no access)

The correct URL is:

Code:
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current/

How can I fix the URL in the script?
 
# setenv PACKAGESITE [url]ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-9-current//Latest/[/url]
 
Vermaden, great guide. I used your zfs one in the past as well. It's always nice to have condensed information you can quickly check.

I upgraded to FreeBSD 9-RC1. I had to add a line in /usr/local/etc/uma.conf
Code:
BRANCH=9-current
otherwise ports-update fails; it checks 9-stable for packages, which doesn't exist.

Now couple of questions. When portmaster is run in ports-build, it checks for packages on 9.0-release depository, for example:
Code:
===>>> Checking package repository for latest available version
===>>> Package and/or archive not found at:
        http://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9.0-release/audio/

This happens even after I export PACKAGESITE to "ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-9-current/Latest/".

More importantly, if I'm already using portmaster to build from ports, does it really have to check for packages (I thought pkg_update will do that)?

Thanks again for your help.
 
vermaden said:
The only reasons to rebuild the base system are that there has been found and fixed a bug in STABLE that affects You or that You need new features that has been merged into the STABLE branch (from CURRENT for example) like newer ZFS version or whatever.

This is an important point. From the handbook:
...this means that at any given time, the sources for FreeBSD-STABLE may or may not be suitable for any particular purpose. It is simply another engineering development track, not a resource for end-users.
 
The handbook is not the bible, it's just a bunch of advices. There is even a lot of 'nonsense' in it at least nowadays. I'm using stable since 5.0 without any problems, on the other hand you could have severe problems while using releases and your hardware is somewhat picky. It solely depends on your environment and your experience. Don't make the mistake and compare terms like beta, RC, stable etc. pp. with those used in the Linux world. 15+ RCs for the Linux kernel are hardly comparable to the modest use of those in BSD world. The same is true for terms like stable, try to compare it to Debians testing or sid and you'll fail.

Vermadens advices are experience-driven, so are mine. 'It just works' is a completely different world, there is a RC dangerous and betas are almost deadly ;-)

Stick to Vermadens advices and remember: FreeBSD is about quality, not quantity. This is even true for the things in development.
 
oliverh said:
Stick to Vermadens advices...
Sure, like when he says,
The only reasons to rebuild the base system are that there has been found and fixed a bug in STABLE that affects You or that You need new features that has been merged into the STABLE branch.
There have been times when STABLE is, well, stable and there have been times when I really wished I had spent more time reading the stable/current lists before upgrading. To each his own. I just posted to share my experience in case it helps others. In '97 I needed to share a dsl connection with my roommates, so I tried IP masquerading with linux. A friend suggested NAT on FreeBSD might work better. We had a 286 running 2.something (I think) and it ran without problems for the entire year. I don't think I've installed a linux distribution since. :) So, my only advice is to do your research and don't blindly upgrade if there isn't a good reason.
 
Sorry for late response, I have been pretty offline lately ...

bbzz said:
Vermaden, great guide. I used your zfs one in the past as well. It's always nice to have condensed information you can quickly check.
Welcome mate.

bbzz said:
I upgraded to FreeBSD 9-RC1. I had to add a line in /usr/local/etc/uma.conf
Code:
BRANCH=9-current
otherwise ports-update fails; it checks 9-stable for packages, which doesn't exist.

I havent tried that 'guide' on 9.x yet as I use 8.2-* series, havent got time to play more with 9.x series.

bbzz said:
More importantly, if I'm already using portmaster to build from ports, does it really have to check for packages (I thought pkg_update will do that)?
Good point, if pkg_upgrade hasn't found anything, then why would portmaster? ;)

Remove the --packages-if-newer from the ports-build function, I will modify the first post some time when I have more time (about a week from now).
 
Keeping FreeBSD up to date is a nightmare; such a nightmare, that I have abandoned the idea of attempting it anymore. The last time I attempted a binary upgrade from 8.1 to 8.2, it borked my system so bad that I couldn't even perform a clean install without using DBAN to completely erase the hard drive.

I appreciate the effort you've gone to here, but the multitude of steps involved don't really fill me with confidence. I was actually going to abandon FreeBSD altogether after what happened, but my attempts to go back to Linux were bug-filled experiences -- ahh, good ole Linux. Instead, what I'm going to do is not upgrade at all, until a major release comes along; at which point I will backup my home directory to an external HDD, and perform a clean install.

Even now, I'm looking at having to remove and reinstall all the packages I'm using, because I've been installing them from the STABLE branch, when I should have gone RELEASE. Since my clean install, I've been quickly trying to install every package I need, because if I install anything later, chances are it's going to want different versions of packages I already have installed -- such is the incredibly annoying nature of STABLE.

In every other way, I think FreeBSD beats the 'competition,' but upgrades/package management is definitely not one of them.
 
purgatori said:
Keeping FreeBSD up to date is a nightmare; such a nightmare, that I have abandoned the idea of attempting it anymore.

I would disagree with you. My servers are always up-to-date. Both FreeBSD and ports. I've been upgrading between major releases many times without having any problems.

There are few simple rules. If you follow them then all upgrades will be very smooth and nothing will be broken.
 
purgatori said:
Keeping FreeBSD up to date is a nightmare; such a nightmare, that I have abandoned the idea of attempting it anymore.
This will be solved by PKGNG project, take a look here: http://youtu.be/IRa6wFBLU28

purgatori said:
The last time I attempted a binary upgrade from 8.1 to 8.2, it borked my system so bad that I couldn't even perform a clean install without using DBAN to completely erase the hard drive.
I do not remember any 'mine' problems with binary FreeBSD update, but I 'walked' that road: 5.4 -> 6.0 -> 6.1 -> 6.2 -> 7.0 -> 7.1 without any problems by doing source upgrades (make buildworld ...)

purgatori said:
I appreciate the effort you've gone to here, but the multitude of steps involved don't really fill me with confidence.
Its probably the longest HOWTO I have ever written, but maybe because I wanted to explain all the steps and the 'why that way' behind them, seems pretty simple after several tries, try it under clean machine in VirtualBox first to catch some confidence.

purgatori said:
Instead, what I'm going to do is not upgrade at all, until a major release comes along; at which point I will backup my home directory to an external HDD, and perform a clean install.
Its definitely not my problem, but I would at least suggest keeping open eye on FreeBSD Security Advisories and patching when needed, along with portaudit from Ports.

purgatori said:
Even now, I'm looking at having to remove and reinstall all the packages I'm using, because I've been installing them from the STABLE branch, when I should have gone RELEASE.
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:

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

purgatori said:
Since my clean install, I've been quickly trying to install every package I need, because if I install anything later, chances are it's going to want different versions of packages I already have installed -- such is the incredibly annoying nature of STABLE.
It may sound up like an advertising, but using methods described in this HOWTO solves that problem, packages are built every 2 weeks, and if newer version appears, its installed.

purgatori said:
In every other way, I think FreeBSD beats the 'competition,' but upgrades/package management is definitely not one of them.
FreeBSD lacks a lot in serious clustering, like 3+ nodes sharing many resource groups with their services, a shared clustering filesystem, drivers for various Fibre Channel controllers etc, but that is a topic for long discussion on another thread ;)

Regards,
vermaden
 
First off, thanks for your thorough reply vermaden :)

vermaden said:
This will be solved by PKGNG project, take a look here: http://youtu.be/IRa6wFBLU28

Oh wow, it's great to know that something is in the pipeline. I had no knowledge of this project, and was despairing that the only solution anyone had even conceived of was the 'PBI' + jails system that PCBSD uses -- in my opinion, this is a solution that ends up being worst than the problem ]I do not remember any 'mine' problems with binary FreeBSD update, but I 'walked' that road: 5.4 -> 6.0 -> 6.1 -> 6.2 -> 7.0 -> 7.1 without any problems by doing source upgrades (make buildworld ...)[/quote]

Its probably a mistake I made along the way somewhere. I'm not a computer, let-alone FreeBSD, expert. FreeBSD is a tool I use in aid of my profession (writing/editing), and although I have done my best to learn its ins-and-outs, I don't have the time it would take to achieve your level of knowledge.

Despite its reputation, I don't think FreeBSD is terribly difficult to learn and use, even if you're not a computing boffin; that is, with the exception of package management. It would be nice if *that* was a little more idiot-proof, so to speak ;)

vermaden said:
Its probably the longest HOWTO I have ever written, but maybe because I wanted to explain all the steps and the 'why that way' behind them, seems pretty simple after several tries, try it under clean machine in VirtualBox first to catch some confidence.

I was in no way taking issue with your HOWTO. On the contrary, I think your HOWTO was very thorough, and helfpful. It's just the amount of steps that need to be taken in order to 'do it right' are kinda silly compared to:

Code:
apt-get update
apt-get upgrade

That's a fault with FreeBSD's package management system, not your HOWTO. I'm not saying Debian/Ubuntu's system is perfect, of course, but it is a lot more straightforward, and worked... the majority of the time, at least.

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:

Ahhh, very handy, thankyou :)

vermaden said:
FreeBSD lacks a lot in serious clustering, like 3+ nodes sharing many resource groups with their services, a shared clustering filesystem, drivers for various Fibre Channel controllers etc, but that is a topic for long discussion on another thread

Waaaaaay outta my depth, I'm afraid :p I suppose I'm evaluating things more from a desktop-users perspective. My activities on FreeBSD basically consist of: editing/proofreading documents in Emacs (which is as much my operating system as FreeBSD is :p ), writing LaTeX documents, running statistics & generating graphics in R, browsing the web/gopher, and watching videos/listening to music. For all of these activities, I find FreeBSD to perform admirably and with rock-solid stability -- and all on rather ancient hardware. But, as you rightly say, that's the topic of another discussion.
 
purgatori said:
Waaaaaay outta my depth, I'm afraid :p I suppose I'm evaluating things more from a desktop-users perspective. My activities on FreeBSD basically consist of: editing/proofreading documents in Emacs (which is as much my operating system as FreeBSD is :p ), writing LaTeX documents, running statistics & generating graphics in R, browsing the web/gopher, and watching videos/listening to music. For all of these activities, I find FreeBSD to perform admirably and with rock-solid stability -- and all on rather ancient hardware. But, as you rightly say, that's the topic of another discussion.

In this case, PCBSD might be a more convenient choice for you: http://www.pcbsd.org/.
 
Or try GhostBSD (http://ghostbsd.org/)

purgatori, FreeBSD is indeed an excellent choice for the activities you mention (math/R, LaTeX, etc., I use these on a daily basis as well.) If you have a day or two available then just experiment with source upgrades (tracking -STABLE) and port maintenance. The ports that get both (i) regular updates and (ii) need an hour or so to compile (because you may not want to wait for the package) will probably only be your web browser and only if you use e.g. www/chromium or www/firefox. The investment (including headaches) will pay off.
 
purgatori said:
First off, thanks for your thorough reply vermaden :)
Welcome.

purgatori said:
Despite its reputation, I don't think FreeBSD is terribly difficult to learn and use, even if you're not a computing boffin; that is, with the exception of package management. It would be nice if *that* was a little more idiot-proof, so to speak ;)
The good thing about FreeBSD, is when You learn something, that knowledge/experience very rarely outdates, with Linux You need to 'update Your knowledge' every release and as someone stated here, its often a lot different 'procedure' to achieve the same thing in, for example, RHEL 4.x, 5.x and 6.x, so You need to learn 3 different procedures, in FreeBSD, its just one.

purgatori said:
I was in no way taking issue with your HOWTO. On the contrary, I think your HOWTO was very thorough, and helfpful. It's just the amount of steps that need to be taken in order to 'do it right' are kinda silly compared to:

Code:
apt-get update
apt-get upgrade

Its the difference between Linux and FreeBSD world, at Linux, everything is a regular package, even the kernel, or init, or crontab, so the command apt just updates them all.

In FreeBSD lan You have 'most important core', the FreeBSD's base system and optional packages, because these two 'worlds' can be tracked and updated without 'touching' the other one there is separate procedure for updating each of them.

Also, its not typical to update the base system as long as everything is working ok and there are no new security vulnerabilities, for the most part You just update the installed optional packages, which means using only these commands:

Code:
# ports-check
# ports-update

purgatori said:
Waaaaaay outta my depth, I'm afraid :p I suppose I'm evaluating things more from a desktop-users perspective. My activities on FreeBSD basically consist of: editing/proofreading documents in Emacs (which is as much my operating system as FreeBSD is :p ), writing LaTeX documents, running statistics & generating graphics in R, browsing the web/gopher, and watching videos/listening to music. For all of these activities, I find FreeBSD to perform admirably and with rock-solid stability -- and all on rather ancient hardware. But, as you rightly say, that's the topic of another discussion.

In 'that part' we are very similar, I also use FreeBSD as my NAS and as my laptop/workstation: http://browse.deviantart.com/?q=by:vermaden+freebsd
 
vand777 said:
In this case, PCBSD might be a more convenient choice for you: http://www.pcbsd.org/.

I actually used PCBSD this time to install FreeBSD, because it sets up networking and a few other little things for me (for some reason, I couldn't get auto dhcp to discover my settings through Sysintall), but I don't like the PBI system at all.

It's kinda ok if the stuff you want is in the PBI library, but if it's not, then you have to install it through packages or ports anyway. When you do so, you run the risk of borking the system due to version conflicts or whatever else -- in one instance, I lost audio because PCBSD uses some sort of tweaked/driver system to initialize your sound hardware, and an updated package I installed overwrote it -- unless you use jails. Jails are, in my opinion, too inconvenient to bother with.

@SNK: I'm not a Gnome user (I favor Ratpoison, Stumpwm and the like),but GhostBSD looks very cool. I was kinda wondering why someone hadn't made a 'desktop edition' of FreeBSD, other than PCBSD and its problematic PBIs.

As for ports, I have definitely 'experimented' with them. The first two times I installed and operated FreeBSD, I used ports rather than packages, but I ran into similar problems with version conflicts, and no easy way to upgrade installed ports/packages. At least with packages, things don't take too long to install if something goes awry.

vermaden said:
The good thing about FreeBSD, is when You learn something, that knowledge/experience very rarely outdates, with Linux You need to 'update Your knowledge' every release and as someone stated here, its often a lot different 'procedure' to achieve the same thing in, for example, RHEL 4.x, 5.x and 6.x, so You need to learn 3 different procedures, in FreeBSD, its just one.

Tragically true. I remember moving between releases back when I was using Ubuntu, and how there was always some new back-end or protocol succeeding another. Not only would you have to learn how to use it, but it often provided no benefit, and more often than not just broke everything: PulseAudio being a great example. System configuration also seemed to be increasingly opaque with each release]In 'that part' we are very similar, I also use FreeBSD as my NAS and as my laptop/workstation: http://browse.deviantart.com/?q=by:vermaden+freebsd[/quote]

I notice we're also both fans of Fallout/Bethesda games, and have similar views on religion :p
 
purgatori said:
Tragically true. I remember moving between releases back when I was using Ubuntu, and how there was always some new back-end or protocol succeeding another. Not only would you have to learn how to use it, but it often provided no benefit, and more often than not just broke everything: PulseAudio being a great example. System configuration also seemed to be increasingly opaque with each release; there were less human readable configuration files, and more arcane, semi-functional GUI-mediated rituals :p
I forgot about 'Ubuntu problems' as I havent used that distribution since quite long time, 2008 maybe, but Ubuntu changes seem to be much frequent then UpstreamVendor/CentOS ones, it must be a horror to keep up with all thos changes ;)

purgatori said:
That said, I have CentOS on my laptop. It pretty much 'just works,' but I think that's only because I don't mess with it much.
Besides the need to disable SELinux and that its still Linux and the need to always add all these various additional repositories that provide me the packages that I have at FreeBSD from the start, its not that bad, at least comparing to other Linux distributions ;)

purgatori said:
I notice we're also both fans of Fallout/Bethesda games, and have similar views on religion :p
Good to know that there are more people like me, I am a big fan of Fallout series, but definitely pre-Bethesda ones, I would even say pre-Tactics ones ;)

Regards,
ver
 
vermaden said:
PART II. Keeping the FreeBSD packages up-to-date

I have FreeBSD 9.0-RC1. I can't use the ports-check after following the above guide. I tried both bash and sh and it doesn't make any difference. Ports-check doesn't work if it's a root or a user account. What am I doing wrong? Do I need to edit anything else considering I am using 9.0-RC1?

Code:
[root@BSD ~]# ports-check
bash: ports-check: command not found
[root@BSD ~]# ports-audit
bash: ports-audit: command not found
 
You need to have these functions KNOWN by Your shell, for example they need to be at ~/.zshrc for the ZSH shell and You can always 'add' them manually by typing source ~/.zshrc in terminal.

I also do not know where You got the ports-audit, its not part of my HOWTO ;)
 
Back
Top