Hello World ! reddit / freebsd ---------------------------------------------------------------------- sseryt · 2021-12-20 16:20 Been using Linux for 7-8 years now and heard about BSDs along the way, but was always too scared to leave my Linux comfort zone. Got my hands on an old Macbook Pro (13 inches, 2014) and decided the only proper OS to replace macOS was another BSD. Settled on FreeBSD because it seems like the easier of the bunch to use (I did install all three of the main BSDs before making my choice, though). It's pretty fun so far. Works fine so far, but the lack of Linux commands still confuses me more often than not (though I was kind of prepared for that, my company uses AIX servers so I already knew BSD commands could differ quite a bit from Linux). Merely read Part 1 of the handbook before I got too impatient and installed a basic system despite not having finished reading the handbook - now Hikari won't start, I guess I'm still in for some reading about how stuff works on this OS.Only issue is that the WiFi card is a Broadc\*m, specifically the BCM4360 (supported by no BSD to this day). But FreeBSD surprised me agreeably with USB tethering working perfectly well so Internet is not an issue (this model doesn't have Ethernet so I would've been in trouble otherwise). ​ Only one question comes to mind though: the handbook specifies pretty clearly not to mix up binary packages and ports, since ports tend to be more up to date so you could have version mismatches if mixing the two. I'm not bothered by compiling stuff - my main Linux distro is Gentoo so I spend a lot of time compiling stuff. But I tend to use Void Linux for devices with weak CPUs because I don't think compiling all of my stuff on a weak CPU is fun. The i5 of that Macbook is dual core (albeit hyper threaded) and fairly old now, so I went the binary packages way. Is there any argument in favor of going the port way I am missing ? I am well aware of the advantage of being able to control the compilation options (there's a reason I use Gentoo) but if it's the only benefit I don't think it outweighs the cons of compilation (yeah I know most packages compile quickly but stuff like Rust or Firefox are already quite long on my i5-10210U Gentoo laptop, I don't see myself putting up with compiling hem on a weaker machine) ---------------------------------------------------------------------- linuxforme · 2021-12-20 16:43 Ports are slightly more up to date than packages I believe which could be beneficial in some circumstances. Compilation options are also necessary in quite a few situations, so just for that it is worth it to use ports in my opinion. For example libre office uses QT by default, but you may want it to use gtk. I think the options are also important if you build your operating system with/without certain options. But aside from that, not really. ---------------------------------------------------------------------- reddit_original · 2021-12-20 17:57 Packages are pre-compiled ports with default configurations. There is no difference otherwise. You may not like the defaults and that would be a reason to use ports. A very, very few ports are never made into packages for reasons I don't recall. You probably don't use those anyway. It takes a while for ports to be available as a package. Sometimes immediately. Sometimes hours. Sometimes days or weeks. But most happen pretty quickly. When you get more experience, you will learn how to safely use ports and packages together. I don't advise doing that for everything but the few where it is needed. ---------------------------------------------------------------------- [deleted] · 2021-12-20 18:50 The handbook section detailing [ports vs packages](https://docs.freebsd.org/en/books/handbook/ports/#ports- overview) sums it up best. Essentially ports offers wider customization options than packages, which are conservative in features. My limited understanding of packages and ports is that there are times where ports has to be used, like for software that isn't officially supported, or the version hasn't been adapted yet by FreeBSD. Obviously caution should be taken with third-party software, as well as care to ensure the port's dependencies are not going to break already installed software. As far as ports on a low powered system, I believe Gentoo describes a chroot process in their manual to do compiling on a higher powered machine before installing on a lower spec'd machine. I understand the steps necessary to do so are close to how it can be done on FreeBSD too. I've done it in the past compiling software for a Raspberry Pi hosting a Debian system, though I relied heavily on a tutorial. Many of the SoC communities forums discuss the process, including for FreeBSD, which for some projects is the only way to put FreeBSD on their hardware. I'm sorry I can't be more specific, I haven't a lot of experience compiling yet. Good luck to you! ---------------------------------------------------------------------- msh_03 · 2021-12-20 20:27 Fwiw sometimes you do want to mix ports and binary packages. For example I might build the nvidia-driver port locally so it matches my custom kernel, lock it with pkg lock, and install everything else through pkg. that way I don’t have to build everything else and can update nvidia-driver when I need to. Especially on a laptop building from ports is not ideal, nobody should be forced to build chrome on a 2 core machine... that’s torture ---------------------------------------------------------------------- PreviousWay · 2021-12-20 20:38 tl;dr start with packages and stick to packages unless you really need to, but setup and use builders like Synth or Poudriere if you need to build yourself. That is a long discussion really, because going with packages is not just fine, but better to start off with in most cases, because in the long run there are better ways to build from ports than simply a '#make install clean' from the ports tree, (like Synth and Poudriere), if you do opt for building later. And it's kinda weird that the handbook nonchalantly goes for ports off the bat. I played around with FBSD a bit before (around version 7) and only got into it again a year ago (from os x and windows), so you have better experience with building for sure, but I can give you some info and caveats on the general picture. Packages - generally fine, quick to install/setup system, readily available. The only option you need to think about is whether to stick to quarterly builds (the default) or latest, which are built within the week from the current ports tree. The only issues I can think of right now, is when you really need specific build options and/or if you are annoyed by the fact that some packages pull in the kitchen sink.. But your system will be running fine. As you mentioned, and everyone will tell you, mixing packages and ports is not a good idea, (and is generally), but the worst part is that people starting out will most likely have their packages set to the default Quarterly, and if they just look into building something from ports, then will generally start by pulling/updating the ports tree, which will be versions ahead, if they haven't become aware of the difference. Also, the package manager might uninstall your built ports later on if you add packages that have those as dependencies (to install them from packages to match). You can lock packages but it becomes messy. Knowing that, you could setup your system to have them in sync and it won't be the end of the world if you build a few ports, avoiding building things like rust, just to add an option in a few ports. I mean, if you see no glaring issue after, your fine, otherwise go back to the drawing board. If you have to commit to ports, look into builders like Synth and Poudriere; which are better options then directly from ports tree. They use jails or chroots to build in a clean environment, but also create a repository with the packages. You then use the package manager (pkg) to install them. You'll have a working system in the meanwhile (while building ports) and you'll have a better backup of you builds. A good point to mention on BSD where it differs from linux you might be aware of, is that it is an OS, fully. When you install from install media, you have an OS, kernel, tools etc. Packages are an extra feature, installed by the package manager pkg. At any point '#pkg delete -a' will uninstall every package except itself and you have a clean slate, package-wise, but you still have your OS unphased. In linux package managers usually handle the kernel and base utils, grub and all. So it takes a lot more care or work to do the same. (I learned that the hard way during my brief venture ;- took care but ultimately forgot I had a different kernel than the one I excluded from delete. big oops). The point I'm making here, is firstly don't worry too much about reinstalling packages if you have to, but second, if you use the package builders and make your own repo, you won't have to rebuild everything from scratch like you would if you just used the ports tree. gl ---------------------------------------------------------------------- CoolHwhipMike · 2021-12-21 02:03 If you installed Release you will use the quarterly packages by default. You can set it to use the latest packages easily. This would probably help minimize differences between packages and ports if you needed or wanted to mix. You could also look into poudriere to have more control over ports that you want to compile. But realistically packages are faster and just fine for most use cases. ---------------------------------------------------------------------- tux2bsd · 2021-12-21 06:54 pkg of banana port of carrot pkg and port of banana probably will be a pain in the ass ---------------------------------------------------------------------- frenchiephish · 2021-12-21 08:59 Yep, adding to this, switching to latest from the default quarterly for packages will keep you almost entirely up to date with the ports tree these days. The official package repositories are built with poudriere and undergo incremental rebuilds regularly. The longest wait period I've seen for the port I maintain to be available as a package was 5 days and that coincided with a python version change (ie loads of packages being rebuilt). Quarterly is literally a snapshot once a quarter with occasional bug or security fixes merged into it. Packages can be up to 3 months out of date with the ports tree. The official 'latest' packages are about as fast as packages migrate from unstable to testing in the Debian world if you need a Linux yard- stick to compare. ---------------------------------------------------------------------- sseryt · 2021-12-21 11:06 Thank you for the detailed post. The last point is probably the one that's making the biggest impression on me. When I want to go back to a clean slate, I do a full reinstall, which is always a hassle. So it's nice to know that if I want to start from scratch on FreeBSD it's doable relatively easily ---------------------------------------------------------------------- sseryt · 2021-12-21 11:13 Yeah: [https://wiki.gentoo.org/wiki/Distcc](https://wiki.gentoo.org/wi ki/Distcc) I heard about it (though I did not test it), but I'm wondering if it would work for me. All of my other machines run Linux, and I don't see myself installing FreeBSD instead. Could Linux machines help a FreeBSD machine compile ? Though the only requirement I saw in the article was same GCC version across all machines, so it might work But they also describe some limitations, which affect packages like `rust`. Which is why I haven't used it yet (I have a Ryzen 7 5800X Gentoo desktop and a i5-10210U Gentoo laptop, so I'd start by using distcc to have the desktop help the laptop compiling, but if I start paying extra attentions to some packages, I'm not sure it's worth it. And then setting it up to hook a FreeBSD machine as target.... That would require quite a bit of effort I think. And as every self respecting programmer, I'm lazy. Too lazy for that :p) ---------------------------------------------------------------------- sseryt · 2021-12-21 11:17 Thanks everybody for the answers and the welcome, much appreciated. Think I'll stick with packages for now, because penguins and demons really are different beasts and I think I have enough on my plate learning this new OS (I keep trying to run some `lspci` or `lsblk` on the FreeBSD machine before realizing my mistake \^\^). The comments mention that it's easy to remove all packages on FreeBSD and that doing so doesn't actually nuke the system (since it's a full OS, not a collection of programs bundled together). I might do that once I get comfortable enough with this, I guess ​ Anyway, it's pretty fun using this so far ! Managed to get a desktop running, with firefox and some basic utilities. Combined with the Retina display, think this'll be a nice secondary laptop. See you around and have a good day ! ---------------------------------------------------------------------- PreviousWay · 2021-12-21 11:29 One other thing to mention, is if you have fbsd installed on zfs, you can use bectl to create boot environments, which is like having a clean slate for the OS too. If you went with ufs (considering the specs you mentioned) it is either also possible rn, or will be (I haven't checked). If you want to look into that. It's useful especially when you update the OS to a new future version, or build a custom kernel for the current one from source. If your system doesn't boot, you just roll back. ---------------------------------------------------------------------- CoolHwhipMike · 2021-12-21 14:03 Look at the man page for pkg. It's on the system already with detailed and helpful man pages for everything else too. If you're like me you won't be used to the documentation and will forget about them but they're great. ```pkg prime-list``` will list all user installed packages which are in /usr/local - totally separate from the OS. Someone also mentioned bectl. If on ZFS this is awesome for upgrades, updates, or just playing around. You can revert to a previous ZFS snapshot and the only thing that won't get sent back is your home directory. You can select which snapshot you boot into from the boot menu. There are also alot of GNU utilities available as packages. I know lsblk is there and I've used it but ZFS has better tools and geom, which is there by default, is pretty nice. The biggest thing against FreeBSD is support for brand new hardware but if you can get past that it's very nice to use. ---------------------------------------------------------------------- robsters · 2021-12-21 14:54 I use both Linux and BSD, I’ve been a FreeBSD admin for 25 years. Most of the commands you’re looking for in BSD that exist in Linux are probably a port you need to install. Kind of like the bind tools for. :) Google/Bing/Ecosia is your friend. ---------------------------------------------------------------------- linuxforme · 2021-12-21 20:01 Just thought I’d let you know that a lot of Linux utilities are available as a package or port, for example, lsblk. ---------------------------------------------------------------------- [deleted] · 2021-12-21 20:16 The easiest thing would be to set up a VM with a FreeBSD guest or a FreeBSD build environment within a container of your choice. One of the FreeBSD & NetBSD commiters has a blog discussing cross- compiling using the [bmake](http://www.crufty.net/helps/sjg/bmake.html) utility. It is not a complete how to but a good start discussing the topic. The Debian project has some packages that allow for FreeBSD development on a Linux machine, you can check out more about it [here](http://packages.debian.org/sid/main/freebsd-buildutils). On the page it describes the library dependencies necessary. Care would need to be taken to ensure the libraries contain the up to date versions compatible with current BSDs. I understand and respect not wanting to migrate entirely, or at least not yet. Managing several OSes is cumbersome. However, being able to mitigate risk over several different systems also means a user has options. With ZFS and NAS, I rarely keep files locally so really OS choice is second to desktop environment. Yet nearly a year after I first put FreeBSD on a machine, it is now my 1st choice. Ironically, had I not accidentally installed it over a Windows & Linux dual-boot, I would have finished my Gentoo desktop build. I'll get back to that later this winter, but it will be for a server now. ---------------------------------------------------------------------- grahamperrin · 2022-01-16 19:39 +1 to poudriere, poudriere-devel in particular. There's much documentation, but it's actually very simple to use.