# New to FreeBSD. Looking for some clarifications



## revivaloflostart (Jul 29, 2018)

Just did a base install and am official part of the FreeBSD family! 
At the moment I haven't installed or setup anything yet, but I did spend some time reading a bit of the handbook to familiarize myself with some of the basics; however, there are still a few things I'm confused about - most of which have to do with software installation.

*1*. FreeBSD's Release, Stable, Current: 
I came from Archlinux previously, so everything was done in a rolling fashion (kernel, base, software). 
For FreeBSD, I understand that development changes are separated by Release, Stable and Current.
And with each Release, Stable, Current, there might be changes to the kernel, base, and new/updated version of third party software available through the Ports Collection.  

"*BUT*" does that mean new/updated third party software (ports collection) are only available when there's a new Release, new Stable, new Current? I'm sort of confused, because I'm completely foreign to ports, and from reading the handbook, there's mentions of:   
portsnap fetch update​portmaster -L​portmaster -a​
For updating ports collection, finding outdated third party software and upgrading them.

But if changes are only made when a new Release, Stable, Current is rolled out, then there wouldn't be a need for such commands. Which means changes to third party software are not strictly limited to the roll out of a new release. But in actuality, changes to third party software can happen at any time. (I could be running 11.2 Release, but there might be changes to third party software I'm running prior to the 11.3 Release).  

And this goes for other things as well, that while there's periodic roll out of new Release, Stable, Current, that does not mean that there's absolutely no changes in-between the releases. Things like freebsd-update is sometimes required when there's important security patches, etc.

Also, each flavor has its own ports collection right? But aside from looking in /usr/ports for the ports available to the flavor i'm running, is there somewhere online where I can see all the ports for Release, all the ports for Stable, Current? To see what's available for each flavor?  

*2*.
As for ports (I'm using this Desktop for home use), would you guys recommend:
portsnap or subversion?
portmaster or portupgrade or synth or poudriere?  

Lastly, while I don't usually have a specific need when it comes to software and probably should use pkg instead of ports to be honest, I nonetheless wanted to go with ports just to be safe (who knows, there might be a day when I want something with a different compile settings). So my question is, when I create and install from a port, I know there's a pop up window that will show up and present you with all the options for you tochoose the compile options you want - but does it present you with the "default" options first? (so if I don't check-mark any other boxes or making any changes, the port I will be building will be the exact same as if I was installing via pkg ?


----------



## SirDice (Jul 30, 2018)

1) the base OS and ports/packages are two separate "entities". All versions on all architectures use the exact same ports tree. Which means versions of third party applications (like Apache, MySQL, PHP, etc) are not bound to specific FreeBSD versions. On FreeBSD it's perfectly alright to have a FreeBSD 10.4 with PHP 7.1 and a FreeBSD 11.2 with PHP 5.6 for example.

2) I recommend using the packages.


----------



## DeadLoco (Jul 30, 2018)

1. Port tree updates should be performed on the regular basis because ports updates are irrelevant to the FreeBSD developement schedule. Say, new `someport-1.3` was released and port is updated accordingly. Or maintainer find out that `someport1.2_5` need a patch for better performance/security/stability and port is updated again. All that updates are continuously flow down in the port tree. You can see that changes if you run `portsnap fetch update` with an 24-hour interval. Command will list all the ports has been updated since the previous run. I have the cron job `portsnap cron update` that launched every day. And then some script with `portmaster -L` inside send me a mail with the list of my actual software that can be updated. And if changes are significant enough I'd `portmaster -ad`.

2.
`Portsnap` is bundled with the system so you need no additional software like `svnup`.
`Portmaster` has no dependencies and is VERY lightweight in comparison to alternatives. 
`Poudriere` is necessary when you want to build your own repository with packages that can exclude each other. For example `mysql80` can't be built by `portmaster` on the system having `mysql57` already installed. You have to deinstall conflicting ports first and then to install the desired port. For the personal desktop use that is not a problem and `portmaster` is the good choice but we need something more powerful for the mass production. Indeed `poudriere` used jails to build each port in the clean environment so it consumes an extra few GBs of disk for jails.
`Portupgrade` is quite the same as portmaster but have a `ruby` and `db5` as dependencies that is slightly overkill for that purpose IMHO.
`Synth` also used the jails for build like `poudriere` but this is relatively new tool and I have no pros and contras with it.


----------



## drhowarddrfine (Jul 30, 2018)

DeadLoco said:


> mysql57 already installed.


This would be news to me though I haven't installed a fresh copy in five years or more.


----------



## ShelLuser (Jul 30, 2018)

revivaloflostart said:


> Just did a base install and am official part of the FreeBSD family!


Welcome!



revivaloflostart said:


> "*BUT*" does that mean new/updated third party software (ports collection) are only available when there's a new Release, new Stable, new Current? I'm sort of confused, because I'm completely foreign to ports, and from reading the handbook, there's mentions of:


So first the releases...

FreeBSD basically knows 3 types of releases: RELEASE, STABLE and CURRENT. The first is officially supported and meant for production use. There are often more than one version but this is likely to change in the future. Right now the supported releases are 10.4 and 11.2. See also the supported releases page.

STABLE and CURRENT are developer snapshots. You can learn more of them from that same page I linked above. Basically CURRENT is 'bleeding edge' which means it's not even guaranteed that it will actually boot whereas STABLE is less unstable.

My personal suggestion: steer clear from either if you're still new. There's no added value, this isn't about "the latest and greatest", etc.



revivaloflostart said:


> Also, each flavor has its own ports collection right? But aside from looking in /usr/ports for the ports available to the flavor i'm running, is there somewhere online where I can see all the ports for Release, all the ports for Stable, Current? To see what's available for each flavor?


If you're merely using a desktop then I definitely agree with SirDice above: don't bother with ports at all. Just install binary packages using `pkg install <name>`, and look for stuff you might need using `pkg search <name>`.

And forget about STABLE and CURRENT as well, at least for now. These two only become interesting if you have more experience with FreeBSD and even then it remains to be seen. I only messed with CURRENT a few times to test a few things and explore some others. In general it was still somewhat of a waste of time   (for me that is, nothing negative about the awesome efforts that go into CURRENT of course).

But yeah, you can look online at the repository. FreshPorts is a nice place to look, but there's also the online SVN repository.



revivaloflostart said:


> *2*.
> As for ports (I'm using this Desktop for home use), would you guys recommend:
> portsnap or subversion?
> portmaster or portupgrade or synth or poudriere?


Definitely pkg to maintain your software, as mentioned above.

Building ports only becomes interesting if there are specific changes which you need, but all ports are build with very sane default settings and values.



drhowarddrfine said:


> This would be news to me though I haven't installed a fresh copy in five years or more.


It's a failsave mechanic which some ports apply: they refuse to build when it becomes obvious that another package which installs files into the same location(s) is present on the system. Seriously annoying in my opinion because I only expect those checks to be done during install time, therefor I often bypass them.


----------



## ralphbsz (Jul 31, 2018)

As SirDice and ShelLuser said: For a production machine, install the most recent RELEASE version, and then use `pkg` to manage additional software.

At regular intervals (perhaps once a week, or day or month), do "freebsd-update fetch" and "freebsd-update install".  Read the messages they print.  This will keep your base FreeBSD up-to-date.  Usually, no reboot is required.  If the kernel is changed, the messages will tell you what to do next.  For major version upgrades (like 10.x to 11.x), you'll probably have to reboot and run the command again.  All this can be easily automated, but I haven't bothered with that; I'd rather run the upgrade commands manually.

And run "pkg upgrade", also at regular intervals (I typically do it right after the FreeBSD update).  This will keep all the packages you installed up to date.  Again, read the messages as they fly by.  Again, this could also be automated, but I personally haven't felt like it.

If you do these things, your system will stay functioning and up to date for a long time, with minimal effort.


----------



## revivaloflostart (Aug 5, 2018)

Thanks to everyone for all the detailed guidance. I really appreciate it; it has helped me understand things a lot better.  
In regards to pkg or ports, I will probably still go with ports because I'm interested in installing SuperCollider with some added configuration options.  So for everything else when I don't have a specific configuration need, the initial pop up from ports installation, I can just leave the check-marks as they are and that should just be the same build as the default package right? (exact same as installing from pkg)

also, is it better to use portmaster to install ports or to do it manually with make install clean? or it doesn't make much of a difference at all? the handbook only used portmaster as a management utility for checking, but it seems portmaster is also capable of installing as well.


----------



## SirDice (Aug 6, 2018)

revivaloflostart said:


> I can just leave the check-marks as they are and that should just be the same build as the default package right?


Yes. If you can't remember if you changed the options or not you can always 'reset' them using `make rmconfig`.


----------



## fbsd1 (Aug 11, 2018)

The pkg command is the way to maintain ports on your host.


----------



## ShelLuser (Aug 11, 2018)

fbsd1 said:


> The pkg command is the way to maintain ports on your host.


No it's not. pkg manages packages, not ports. I know this might seem like nitpicking at first but details like these honestly matter. pkg does not install, manage, delete, etc. ports, only packages.

You maintain ports using either portsnap(8) or SVN.


----------



## ShelLuser (Aug 11, 2018)

revivaloflostart said:


> also, is it better to use portmaster to install ports or to do it manually with make install clean?


Portmaster can definitely make your life a whole lot easier, but if you simply use it with default options then there's not too much difference between using Portmaster or doing it manually.

For example: `# portmaster www/apache24` can be (roughly!) compared to these commands:

cd /usr/ports/www/apache24
make config-recursive
make install clean
See also ports(7) for more useful build targets.

The direct advantages of Portmaster though (in random order):

Will show you a nice overview of all package comments at the end, so you won't miss any (possibly) important information.
You can always use: `pkg -D <package name>` to review those later.
Obviously this will become even more handy if you also log Portmaster's output.

It keeps track of the build process and when a build fails you can refer to /tmp/portmasterfail.txt which will contain a list of ports which still need to be installed.
If you run the build manually you basically have to start from scratch, because the other alternative would be to install all dependencies one by one (assuming we're dealing with dependencies of course).

You can easily use Portmaster for your own scripts and automations if you'd like, sometimes that's easier than having to rely on make.
If you configure Portmaster (see /usr/local/etc/portmaster.rc.sample) then you can do some cool stuff automatically.
When I upgrade ports Portmaster will automatically create a backup copy of my current port in /usr/ports/packages/portmaster-backup, so if things start misbehaving after an upgrade I have everything I need to roll back the changes.
Portmaster can maintain distfiles for you (= the original source code which got downloaded), so if a package gets upgraded then Portmaster can clean up the old distfile (saves diskspace).

So there are definitely some advantages here. Just don't make the classic mistake which I've seen some make by assuming that Portmaster does stuff which you can't do with a vanilla setup. Because you can, it'll only be a little more complicated to perform manually.

Hope this can help.

(edit) PS: I think it's only fair to mention that I am a bit biased here because I've been using Portmaster ever since I started using FreeBSD and so far it has never failed me.


----------



## rigoletto@ (Aug 11, 2018)

ralphbsz said:


> At regular intervals (perhaps once a week, or day or month), do "freebsd-update fetch" and "freebsd-update install".



The freebsd-security-notifications mail list almost always notice when there is an update. 



revivaloflostart said:


> also, is it better to use portmaster to install ports or to do it manually with make install clean?



IMO, do a favor to yourself and use ports-mgmt/synth instead! SYNTH.

Cheers!


----------



## rigoletto@ (Aug 11, 2018)

Well, I would say equal, the best being what fits better to your user case.

General talking, ports-mgmt/synth is better when you need to build packages for just one machine or, if more than one, all of them use the same FreeBSD version and you don't need to set different port OPTIONS for them - _everything is basically the same_. It is very easy to setup ( just install, do some optional configuration tweaks, and start using it ).

ports-mgmt/poudriere use jails to build ports ( Synth does on chroot ). This is better when you need to build ports for different FreeBSD versions, and/or with different OPTIONS etc. using different jails. Poudriere is a lot of more flexible but it come with the price of being reasonably complicated to setup, the commands are often long to write, with several things to be specified etc. WIKI, TUTORIAL.

So, different tools for different uses.

If you are adventurous you still have Ravenports. 

Cheers!


----------

