From owner-freebsd-questions@freebsd.org Tue Dec 8 01:12:29 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45CE49D3C11 for ; Tue, 8 Dec 2015 01:12:29 +0000 (UTC) (envelope-from welcome.to.eye.o.rama@gmail.com) Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 064BA1C2B for ; Tue, 8 Dec 2015 01:12:29 +0000 (UTC) (envelope-from welcome.to.eye.o.rama@gmail.com) Received: by qkht125 with SMTP id t125so7681153qkh.3 for ; Mon, 07 Dec 2015 17:12:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Y2KN2/NFpfre2fRNQvVh4ky2QFYzdpdVDOYvzz6mhhE=; b=AH6yBuGnbgG2qzM2teakyhkqh3KESf6RhOiPFy57xpUgCbOch9CNVbd5ZyrCmyBKZJ NN3aYa4lpB0w9PTtrAt7/jW0c6o01GKx2oWgo3hdSfOZ5omtEbfD1TYjbFxb4lD7N4Tx 0KIM5BQrh5KtdFASUvf59EQ2g6KF22kjOPtCwIPeG3qCg1xuZLFge7b1D8PMmUsHDly/ nvBso3x7NK0K1zbnOlGRWQ5pjeVNLKd9FE8R2Vlp1FcUeqvGvvu56NvsmqppkM5eBxVh SmhSh35hiI3WbXt9/Xc1ReQ3k8wtlyKvQ+s75TugtG7kwBkASBafP6WxxWkORhxE9JNE +nyg== X-Received: by 10.129.76.205 with SMTP id z196mr489204ywa.56.1449537147963; Mon, 07 Dec 2015 17:12:27 -0800 (PST) Received: from ?IPv6:2602:30a:2c86:1740:3615:9eff:fe1f:8316? ([2602:30a:2c86:1740:3615:9eff:fe1f:8316]) by smtp.gmail.com with ESMTPSA id l23sm604524ywb.26.2015.12.07.17.12.26 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Dec 2015 17:12:27 -0800 (PST) Subject: Re: Migrating to FreeBSD from Debian Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: John Aten In-Reply-To: <86io4a6l2w.fsf@WorkBox.Home> Date: Mon, 7 Dec 2015 19:12:24 -0600 Cc: freebsd-questions@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <86io4a6l2w.fsf@WorkBox.Home> To: Brandon J. Wandersee X-Mailer: Apple Mail (2.1085) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 01:12:29 -0000 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?=