Date: Mon, 7 Dec 2015 19:12:24 -0600 From: John Aten <welcome.to.eye.o.rama@gmail.com> To: Brandon J. Wandersee <brandon.wandersee@gmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: Migrating to FreeBSD from Debian Message-ID: <D91EEB69-5416-46A4-A420-49E9AB92E910@gmail.com> In-Reply-To: <86io4a6l2w.fsf@WorkBox.Home> References: <CAO-kBwffucnPVphm_ajbtAejjFiAv_Cp%2Bv7jZ-xCTX7YTqk36w@mail.gmail.com> <86io4a6l2w.fsf@WorkBox.Home>
next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 7, 2015, at 2:49 PM, Brandon J. Wandersee wrote: >=20 > Paul Stuffins writes: >=20 >> Hi Everybody, >> As 2016 is fast approaching I want to finally move to FreeBSD and = stay with >> FreeBSD, so my question is, what is the best or most efficient way of >> upgrading all ports on a FreeBSD machine? >=20 >=20 > Right, so since this kinda derailed quickly, I'll try to answer this > clearly and comprehensively. I moved from Arch Linux to FreeBSD myself > just over a year ago, so I'll try to iron some things out for you, = since > it took me some time to sort all this out myself and I sympathize. >=20 > The package package manager isn't drastically different from pacman or > dpkg/apt, so you should find understanding it pretty easy. Just read = the > man pages and the relevant section of the Handbook for the > basics. Beyond that, though, there are some characteristics of the > packages and repository that need to be understood. First, in almost > every case a single port is built into a single package with a fairly > sane set of default options. Even in cases where multiple versions of = an > application exist--such as Emacs--there is a corresponding port with a > different set of options. So if you're lucky, you'll be able to use > packages for everything you need. If there's any application built > without an option you want, you'll have to build it from the ports = tree. >=20 > This raises some caveats. For one thing, while packages are built and > the repository updated several times a week (up from just two or three > times a week when I first started--great work, folks), as of now it's > not a continuous process. This means the ports tree (which works by a > rolling-release model) is always a few hours to a couple days ahead of > what you'll find in the repository, raising the possibility of > dependency conflicts if you mix ports with precompiled packages. For > another, if you try upgrading your binary packages using `pkg update = && > pkg upgrade`, pkg(8) will also replace your personally compiled ports > with the most recent default versions found in the package repository. >=20 > There are two ways to avoid these issues. If you just have, say, two = or > three ports to manage, you can use pkg-lock(8) to prevent pkg(8) from > messing with your ports. You can then upgrade your packages as usual, > and then use ports-mgmt/portmaster or ports-mgmt/portupgrade to = upgrade > your ports afterward. This can be a little tedious, as (a) you'd need = to > use Subversion to synchronize your local ports tree to the revision = used > to build the most recent set of packages, which must be done manually; > and (b) you would need to use `pkg unlock` on your custom package = before > upgrading them (but *after* upgrading your vanilla packages), and then > run `pkg lock` on them again after upgrading. So it would require > building some new habits. There are a couple sripts I've seen that are > supposed to synchronize your ports to the package repo automatically, > but last I checked they hadn't been updated for 10.2 and did not work > for -STABLE or -CURRENT. >=20 > If you have more than a few ports to build, or don't mind waiting a = few > months between package upgrades (you are a Debian user, after all), = you > can just use the quarterly repository and ports tree, which are always > kept in sync and updated every three months. As of FreeBSD 10.2 the > quarterly package repository is used by default on new installs, and > fetching the quarterly ports tree with Subversion is easy enough (it's > in the same SVN repo as the main ports tree). So this is definitely = the > easier way to go if you want to mix ports with packages. >=20 > Of course, if you have lots of ports you want to customize, you might > just skip packages entirely and stick with ports. In that case, > ports-mgmt/portmaster seems to be the semi-official way of handling > things. You'd just run `portmaster -a` to upgrade all installed > ports. If there are any new options available in a new version of the > port, portmaster will prompt you to check your options interactively > before continuing. >=20 > You could also use ports-mgmt/poudriere to build custom packages into = a > locak repository; it's the same build system used for the official > package repository. Setting it up the first time takes a little work, > but it would allow you to build from either the rolling or quarterly > ports tree as you see fit, and updating is just a matter of fetching = the > latest commit of whichever ports tree you're tracking and running the > build command. I use it myself, and love it. Poudriere is quicker and > more efficient than Portmaster on machines with plenty of RAM and > multi-core CPUs. >=20 > Since the ports system and package manager are tied to each other, = once > a port is installed you can perform any actions you see fit on it = using > pkg(8). It's all the same at that point. And as was already mentioned, > always make sure to read /usr/ports/UPDATING (or run `pkg updating`) > before proceeding to see announcements about any special measures that > need to be taken. Hope this all helps a bit. I am coming from Debian also, and I was initially intimidated by ports. = I still am, but I the more I think about it, the more I favor the idea = of ports over packages. One source of confusion is the all the options = one is faced with when installing from ports; I don't know exactly where = to look for documentation on what would be better/worse to select and = why. Is this a matter of checking with the documentation of the program = to be installed? Or is there FreeBSD specific information on this = somewhere?=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D91EEB69-5416-46A4-A420-49E9AB92E910>