Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Dec 2015 15:40:23 +0000
From:      Paul Stuffins <paul.stuffins@ravexdata.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Migrating to FreeBSD from Debian
Message-ID:  <5665A867.2090707@ravexdata.com>
In-Reply-To: <56659FC8.8020904@FreeBSD.org>
References:  <CAO-kBwffucnPVphm_ajbtAejjFiAv_Cp+v7jZ-xCTX7YTqk36w@mail.gmail.com> <86poyiuynx.fsf@gmail.com> <CAA2O=b_p-HPx+pPyFOgJMe02d5xrJe_aXJ8ZG9z+dHZCNwh91Q@mail.gmail.com> <56659FC8.8020904@FreeBSD.org>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 07/12/2015 15:03, Matthew Seaman wrote:
> On 2015/12/07 14:23, Anton Sayetsky wrote:
>> 2015-12-07 16:21 GMT+02:00 Malcolm Matalka <mmatalka@gmail.com>:
>>> Paul Stuffins <freebsd@ravexdata.com> writes:
>>>
>>>> Hi Everybody,
>>>>
>>>> Over the last couple of years I have tried many times to dump Debian and
>>>> move to FreeBSD, but every time I have succumbed to Debian's charms and not
>>>> stuck with FreeBSD.
>>>>
>>>> One of my main frustrations is upgrading installed ports, on Debian I just
>>>> need to run "sudo apt-get update && sudo apt-get upgrade", but I have never
>>>> been able to work out how to upgrade installed ports.
>>>>
>>>> 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?
>>> Use 'pkg' instead.  pkg update and pkg upgrade
>> pkg will update _packages_, not ports.
> ... and a package is what you get by compiling a port.  Yes, there is a
> difference, but the two things are often conflated and it isn't worth
> muddying the waters by insisting on exactingly precise terminology from
> people new to FreeBSD.  It is clear enough what they mean -- their aim
> is to get some software installed or upgraded.
>
> To the OP: try using pkg(8).  You can use the default FreeBSD
> repositories pretty simply -- the config comes pre-canned with the
> system.  All you need to do is bootstrap pkg(8), like so:
>
>     # pkg bootstrap
>
> (Yes, you're using a command called 'pkg' to install another command
> called 'pkg'.  Confusing, but if you read pkg(7) it explains the rationale.)
>
> Now you can use pkg(8) to install software:
>
>     # pkg install nginx
>
> which does what you expect -- downloads packages for nginx and
> everything nginx needs to be able to run and installs them.  Unlike
> Debian, FreeBSD doesn't provide a pre-canned configuration or
> automatically start up the nginx service: you're expected to write your
> own nginx.conf and to update /etc/rc.conf to make nginx automatically
> start on reboots.
>
> You can upgrade anything that's out of date by:
>
>     # pkg upgrade
>
> and you can remove a package you no-longer want by:
>
>     # pkg delete nginx
>
> followed by:
>
>     # pkg autoremove
>
> which will delete anything that was installed solely to allow nginx to
> work, and not also required by any other software you've installed since.
>
> There's a lot more to pkg(8) than that short introduction, but really
> the install, upgrade and delete actions are enough to get you going.
>
> The biggest gotcha you will find with pkg(8) is when you need some
> software compiled with something other than the default set of port
> options.  In which case, you'll probably want to start compiling that
> port yourself.  But that's a question for another day.
>
> 	Cheers,
>
> 	Matthew
>
>
Hi Matthew,

Thanks for the explanation, I will have a look at using pkg.

Thanks
Paul



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?5665A867.2090707>