Ask HN: What is the best Linux distro for a development laptop?
Recently I upgraded my 2yr old laptop (now it has 16GB RAM, 275GB SSD, baklit keyboard) and now consider which linux distro use as main OS.
What are your experience with various linux distros as main OS? Which one is the best? How looks like your dev environment?
For me are important these points :
- Ability to run virtualized systems (Windows, other linux distros)
- Good battery management
All necessary dev tasks and experiments will be performed in virtualized systems.
Thanks
328 comments
[ 0.17 ms ] story [ 300 ms ] threadArch however can be a pain if something does not work, if you want it easy just use a Ubuntu derivat (or Ubuntu if you like that fugly Desktop)
The only caveat is, use it if all hardware works right off the box (Eg: you don't need proprietary drivers for your display and suspend/resume works without twiddling etc...). If that's not the case, don't bother with fedora because you'll just end up fighting the hardware with every update.
fwiw, fedora has been my default OS for 10+ years now. My dev usually happens on the system (since I don't want to keep replicating my dev environment) and testing happens in containers and/or VMs. It's easier to spin up docker/lxc instances than VMs imho.
I've tried most(and then some) popular distros and the last 6 years I've settle on it.
It may be excellent as a distro, I really don't know. I am just thinking out loud here.
The next station in this Linux journey is to dual boot Mint and Arch. Mint for when I wanna get things done and Arch for learning and customising linux.
I'm by no means a seasoned Linux veteran though so just explaining that YMMV.
I have moved fully to having my panel on the left side which used to be one of the things that kept me off Unity though. Resisted for a long time, but it turns out that this is the correct placement, ah well.
They do have another version that is based on Debian directly, but I have never used it so can't say much about its upgrade paths.
I'm considering changing to Ubuntu :(
Arch gets my vote. :) Even though I run CentOS on servers and it requires a bit more mental shift when switching between than Fedora.
What's so special about the fedora Thinkpad combo?
I started with Ubuntu, which technically seems to do fine; however I always ended up wanting/needing to use some current version of some dev software (up to date compiler or a newer Qt Creator for cross compilation for example).
To get those newer versions, I found myself having to rely on PPAs providing them as well as the necessary libraries, which ended up destroying a dist upgrade half a year later. That happened to me at least 2 times.
After that, I tried Fedora and had various problems from the start (maybe that's not the case anymore). Then I ended up with Arch, and have never looked back.
So, if you want to use up to date software, I'd recommend you to strongly consider a rolling release distro. The occational fixing of a single package is worth it over the loss of multiple days/much hair reconstructing your old dev environment on the next distro version any day of the week.
You want your servers running old and verified software.
Of course, this is much a matter of taste, but "stable" environments can work to the detriment of a developer's productivity (especially since many developer tools improve quite fast these days). It might be a mistake to discard a tool/distro just because it didn't do what you expected for an unrelated use case.
Edit: Also note that "server" != "production code". I run a couple of servers (OpenVPN, Backups, mopidy) using Arch (on Raspberry Pis) at home, that doesn't mean I'd use it for a public facing web server.
One thing when using Arch, you won't get an out of the box experience and you will need to tweak almost every aspect of the system manually.
- Missing even a trivial step during installation (such as setting locale) can lead to quirky repercussions. The plus side is that getting your hands dirty during setup really familiarzes you with the system.
- Pacman (and Yaourt) is simply great and make updating, removing and filtering packages a breeze
- AUR (arch user repos) contain nearly every popular FOSS and non-FOSS software not provided officially. Installation and removal is painless with Yaourt. No more PPAs.
- Packages occasionally break. E.g. When libx265 is upgraded but VLC is not compiled against the latest version, resulting in the latter unable to play any media. These are usually fixed pretty quickly in the repos, or you can workaround with a bit of searching.
- Archwiki and the forums are some of the best resources to turn to when you eventually run into problems, and trust me you will
Now to me stability is everything. I have shit to do and don't have time to fuck around with the system every two days (that's why I was on 14.04 in late 2016). But a friend of mine convinced me to invest some time, install Manjaro and learn the slightly different ecosystem. And I can say, it's been worth it. Fantastically stable, things work, and in the 3 months of usage I have yet to find a bug.
PS Manjaro in my case has been installed not using GUI installer since I needed to go with a kind of complex LUKS/dm-crypt encrypting scenario and GUI doesn't support a complex configurations.
It worked flawlessly for me.
Now I wonder if I was lucky or you were unlucky.
Oh, and I live it: clean fresh KDE 5 built on a Ubuntu/debian base.
Can't remember installation settings but I know I have successfully used the Norwegian locale after installation.
I spent many years jumping around Debian and its derivatives but then I found Arch and it just felt right. I love the package manager and the fact I can control what I have installed. With a 9 cell Thinkpad battery and some cleaver settings I can last all day.
I have to admit that these days I tend to run from Antergos which is a great Arch derivative but that is mainly because of a lack of time and a need to get stuff done. Also from years of installing and running standard Arch I can tweak things very quickly from Pacman.
- Pacman is a great package manager (esp. when compared to e.g. ´yum´).
- The Arch User Repository (https://aur.archlinux.org/) has a large list of additional packages maintained by the community.
- The PKGBUILD format used by the AUR is easy to read and essentially just generates Pacman packages you can install alongside packages from the Arch repo.
- PKGBUILD also makes it really easy to create a package for some obscure software yourself (or e.g. a specific font), if necessary.
- There are tools that create PKGBUILD packages from language repos like gem, npm or pypi (via pip). Those are really useful since they prevent language based packages from clashing with pacman.
In addition, I really like that arch is built with choice in mind: There's no default "way to go" - you can e.g. choose from several desktop environments without having to install a specific one first, meaning you can configure your system from the ground up.
I think Slackware and Gentoo work similarly? (I've personally never tried them)
This allows for a great number of AUR packages (the ones ending with "-git", "-hg" or the like) that essentially download/compile a bleeding edge version from the according source versioning repo (e.g. on Github). If they're correctly set up, the system will recognize them as a replacement for another package, that might even be in the main system repos.
Gentoo is a whole other ballgame, and its packaging system is much closer to a modern-day BSD-style ports tree.
As for the starting environment, Slackware actually takes the opposite approach from Arch: the installer defaults to installing all package sets available, which in the case of the install DVD includes KDE, Xfce, a bunch of other window managers, and a whole lot more. You're of course free to deselect the package sets you don't want (or even individually deselect packages), but Slackware's approach is definitely to start the user off with a fully functional system rather than expect the user to set things up from the bottom up.
Gentoo's somewhere in between those two extremes, at least as far as I remember from last time I installed Gentoo.
´sudo pacman -Syy´ to update the package db
´sudo pacman -Suy´ to update all packages
´sudo pacman -S package´ to install/update a specific pakage
´sudo pacman -U package.pkg.tar.xz´ to install a package from a local file (useful if you're using makepkg)
Those are usually enough to maintain my system. I'll have to hit the wiki for the various query options though. But if the CLI side of pacman bothers you, I'd suggest defining aliases in your shell's RC. I track my dotfiles using git and share them on all my machines, and this method works quite well for me...
$ pacman -Qs package
And yeah, this is exactly how it works. Once you learn a bit about how pacman works, it all connects, same thing as vim.
Useful if you have to jump distro's when you surely have your commands aliased.
I would recommend having root FS on ZFS or other filesystem with snapshots. Take a snapshot before or after running a full system update with pacman.
Another aspect I dislike about Arch is that package binaries get removed very soon - it's not an option to not keep it constantly up to date.
That said, it's still my favorite distro.
From that perspective, what works in Arch's favor is that fixing it is usually more straightforward than other distros. I remember spending a saturday afternoon trying to uninstall the proprietary ATI graphics driver from an Ubuntu machine - only to find out (after much googling) that you need to set a very obscure, barely documented environment variable before the attempt.
With Arch, the benefit of installing it manually is that fixing the system works pretty much the same - you just skip a couple of steps (partitioning etc).
Also, I found the Arch and Gentoo Wikis to be very useful for those attempts, regardless of the distro I actually tried to repair.
On a related note: On Arch, I stopped breaking things through updates after I subscribed to their main news feed (https://www.archlinux.org/feeds/news/) - pretty much every breaking change is announced and explained properly there.
So this was an Arch-specific issue that could have been mitigated with ZFS snapshots. E.g. Gentoo does consistency checks of dynamic libs, and other systems don't allow you to make such upgrades.
I had something critical happen to me twice in one year and both times it would have been avoidable with an earlier snapshot of the rootfs. I will definitely do that next time I re-format a disk.
For battery life, I get Windows like battery life out of my laptops using powertop/tlp but mostly by swapping out the window manager for i3. I3 is very efficient. Not only to work with but also for the battery; it literally makes hours of difference on my Thinkpad X2x0 systems.
I read about Archlinux here a lot and I will try it some time in the future, but if you don't need the latest, cutting edge linux related software, you are fine with Ubuntu (which, compared to Debian, is already quite cutting edge). I say Linux related, because many tools web devs etc use have no apt-get package or have a package you don't want anyway. So that's not related to the OS installation then anyway.
The preposition of always up to date would be great if that wouldn't mean that your PC doesn't work properly most of the time due to some new bug or incompatibility.
We've run Arch on embedded PCs (arm) due to out of the box docker support, but after updating a year later we've literally were unable to deploy Docker containers. There was a bug in the kernel, and no amount of hacking, upgrading or downgrading made it work.
Luckily we had a sdcard snapshot a year old.
I suggest Ubuntu or Debian, they got good docs, good support and generally a positive community.
As far as windows managers go - pick what you like. Gnome looks slick, xbuntu is my go-to for Chromebooks and default isn't too bad.
A lot of devs in our company go for tiling desktop managers - i3, awm....
> The preposition of always up to date would be great if that wouldn't mean that your PC doesn't work properly most of the time due to some new bug or incompatibility.
I haven't found this to be the case at all, quite the opposite, I've run stable Arch systems for years, even done large upgrades like the switch to systemd without an issue.
You are talking about a non official Arch project (Arch Linux ARM) as it was an official derivative of Arch. It is not.
After just a few weeks, even using the same distro, everyone's installation is customized to its user like a glovesl. Some start with more more comfortable distros than others. Something like Ubuntu will give you a very stock, GUI heavy, "beginner/I don't want to think about my OS" operating system. From there, you get into Debian, a much more "pick and choose distro" than Ubuntu, but still with great support and stable packages. After that, maybe into Arch, a rolling release distro with grear, always-up-to-date, system with a very minimalist and well designed base install. After that, Gentoo, a hand crafted, labor intensive distro that will be completely bespoke to you.
Some never move on from Ubuntu, some never make it to Gentoo. AND THAT'S _OKAY_. It's about what YOU are comfortable with.
As you grow and become more familiar with the CLI and Linux, you'll want to take more control of what you install and I think you'll start to appreciate simplicity and purity over "initial ease of use". You might even consider trying out different window managers like KDE, i3 (my current love affair), or awesome wm. At that point in your Linux journey, you'll actually have some intuition about how a window manager is different from your distro and how most window managers are built on top of X server. You'll have your own hand rolled .Bashrc. You'll know what you _want_ from your OS.
Personally, that's where I am now. I've been running Arch for 2 years now and made the switch from GNOME to i3 about 6 months ago.
My advice is not to try the most highly recommended distro, or the most "barebones" but simply begin with so.thing very easy like Ubuntu. You might quickly hit some frustrations and identify things that you would like your distro of choice to better. At that point look elsewhere. Migrate and give that some time.
Don't just jump onto the "perfect developer's distro", ease into the easiest and most comforting distro for you "where you are now".
If you do actually need to develop for Linux, I would suggest something with a rolling release model, otherwise it won't be long before you'll need to start compiling things from source because you need a more recent version of <something> than your distro is packaging.
"Rolling release" means that there is no Arch Linux 1, 2, 3 and so on, as in Fedora's case. Arch periodically releases an install image, which you use to bootstrap your system, but the latest tested version of every package is what's available in the package repository, for everyone, and as soon as a newer version is packaged, you can install it. This seems to be the best way to guarantee that you get the latest packages and the most stable system that you can get with them (spoiler alert: it's not that stable, but not disastrously unstable, either; I've ran rolling release distros on my laptop for years).
Arch is an usual recommendation in this case. Red Hat Enterprise Beta, uh, I mean, Fedora, is also a good choice -- it's not a rolling release, but it regularly ships with very recent packages. It's also a testbed for new technologies, and does have the advantage that you get a fully setup (and generally mostly working) system from the beginning.
If you're a more experienced user, you might want to have a look at Gentoo and Void Linux.
It's a great distribution for developers, especially if you're developing Linux packages. It's very easy to create your own local overlay and test your package changes against a system, without needing your own custom repo or VM.
I'm glad you mentioned Void too. I'm currently using that on my router.
I like how Void is systemd free and Gentoo makes it optional.
If you try building a Linux From Scratch (LFS), think of Gentoo as LFS with package management.
Not having systemd isn't such a big deal to me, but it helps. I had to learn it at $work a while ago so it doesn't baffle me anymore. I get why it's so appreciated by DevOps and software outsourcing companies, but it doesn't do anything I need. I can live with it (and I have), but it helps if I don't need to.
Gentoo is great, but with Linux land being the way it is lately, I wouldn't recommend it to anyone who's not very familiar with it. Asking someone to get a working system with Grub 2, xdg-* and the like using nothing but the Gentoo handbook and the Gentoo forum is more or less the equivalent of sending someone to fight World War II with a fork.
The manual partitioning also was quite cumbersome for me, even though I've done a lot of fdisk fiddling when I was younger. The main issue for me was the lack of clear documentation regarding this phase [1]. However, I took it as a "forced learning" opportunity and spend a day fiddling with it until I got it working, from which point onward it really is a fast and lean system to work with, very BSD-ish in style, that doesn't get in your way. I love it. My only alternative nowadays would be Manjaro-OpenRC.
[1]: If I remember correctly, you can screw up the rest of the partition management step if you select the incorrect "label type" (gpt or dos), with no clear way to revert your selection.
The way I do it, lately, and for pretty much any Linux system I use, is to just use LVM for everything except the /boot partition which I leave unencrypted. I think you can have an encrypted /boot but with Grub 2 being the way it is, I don't want to bother with it, my threat model is pretty much thieves stealing my computer, I don't need much plausible deniability.
The only install-time inconvenience with this is that the manpages for LVM-family commands (lv, pv, vg*) are nothing short of terrible. They're pretty much the equivalent of the // add 1 to i comments next to i++.
You don't necessarily "screw up" if you pick the "wrong" label type. You can actually convert between the two (e.g. https://wiki.archlinux.org/index.php/Fdisk#Convert_between_M... ) . Also, I don't know if the functionality was eventually merged, but a while ago, you had to be careful to use the "correct" set of utils for the partition table type you used (e.g. fdisk for MBR, gdisk for GTP, cfdisk for MBR, cgdisk for GPT and so on)..
It depends on your requirements. If you constantly find yourself needing the latest and greatest upstream software releases, then yes, use a rolling release. But if not, rolling releases can make your life much more painful. If you're not paying attention when you update your system, then each update is a roll of the dice as to whether your software will still build or run afterwards, as any update could introduce incompatible changes to packages your software depends on.
A distribution with a release model (usually) tries to maintain API and ABI compatibility for the duration of a release, so you can update with more confidence that it you won't have to re-build or port your code as a result.
There's trade-offs between stability and shininess across the spectrum of distributions with rolling releases, with frequent releases, and with long release cycles. As long as you're aware of that, you can decide for yourself how frequently you want updates, and therefore the type of distribution you should run.
> Red Hat Enterprise Beta, uh, I mean, Fedora
I really wish people would stop making comments like this. I volunteer a significant amount of my free time and effort to improve Fedora, and I see a lot of others in the Fedora community doing the same. I can't speak for anyone else, but I'm doing it to make Fedora better, not to crowd-source Red Hat development for free. Fedora is a first-class distribution in its own right, with an open, inclusive, and independent community. Reducing it to a beta distribution for Red Hat glosses over that fact, which I find very unfortunate.
I didn't mean to imply that Fedora isn't a first-class distribution in its own right. In this post's context, I see why it would look that way, and I apologize for it. I don't mean to belittle the work you folks are doing, and I know that the Fedora project is more than just the distro, and that the distro itself is more than just Red Hat's testbed for new features.
I don't run Fedora on any of my home computers anymore. I ran it up to Core 3, I think, having ran Red Hat Linux before. But I've always "ran into" Fedora computers as part of my work and occasionally ran it on my company-issued laptop at $work. While Red Hat's presence can account for some of your stranger choices, it cannot be the only reason behind your success (and I honestly don't think it is).
The origin of my snarky comment is that to many of us outside the Fedora community, it often feels like a lot of things are finding their way into Fedora largely because they need more ample testing. The fact that they're so active and so pushy means that most of them are from Red Hat. I have very few fond memories about dealing with very early breakage from NetworkManager, PulseAudio, systemd and so on. All of them are now successful technologies, but they were not "ready" by any responsible use of the word when they were first included or enabled by default in Fedora. Wayland is, to some degree, an exception, but only because it has already seen wide enough deployment in the embedded/infotainment area that, for once, the desktop is not the earliest adopter.
This is one of the reasons why I recommended Fedora as a development distribution (my wording probably didn't really look like a recommendation, sorry!). At $work, I already work on Linux software; I don't want to deal with more Linux craziness at home, so I tend to stay way from bleeding edge stuff. But if you do need to keep in touch with what's happening in the Linux world, Fedora is the most stable way of doing it that's also reasonably low-maintenance (the second best option, IMHO, is Gentoo).
Staying up-to-date with all these changes is very important, IMHO. For better or for worse, very important pieces of a modern Linux system, like systemd and GTK, are making a lot of breaking changes in-between releases. Running a bleeding-edge system is about the only reasonable way of becoming "passively" acquainted with them, and is a great way of weeding out the subtle bugs that they introduce.
Part of why you see things working their way into the distribution quickly is because of the "first" foundation[1]. Fedora purposely does not wait for other distributions to do the hard work of integrating new technologies, which means they're often among the first to discover bugs in new technologies. That said, I think that these large integrations are getting smoother over time, as the community is putting a lot more effort into coordinating these large changes and instituting QA that has the teeth to block releases on bugs with flaky integration.
[1] https://fedoraproject.org/wiki/Foundations
Also, anyone commenting here about their personal favorite will most likely comment on why that distro is their favorite, which should at least be enough for OP to inform himself further.
I was really tired of not being able to find insightful content and discussions on so many other social networks and/or forums. Most of them are full of frivolousness, hatred, squable, swear, all that memes, gifs... etc. Then I came across HN, ~3 years ago. I am not a coder (trying to learn fundamentals on my own, though) and not so fluent in English either. Even though, it was (and is) like brilliant content filter - in terms of both news and comments. You cannot get a grip if you are not civil enough or if you are looking for some visual entertainments. You know, I guess it's all about text. You read. You get valuable information and knowledge from other readers'/writers' experiences. Text is not dead here on HN.
All in all, HN is like "The best content aggregator for humans, by humans".
This place does, however, have its limitations too. For reasons I cannot fathom, the community here absolutely _loves_ to nitpick. People will pick on the absolute nitty-gritty specifics of something some OP said and spend an inordinate amount of time splitting hairs.
Can anyone comment on the current situation? Can you set Arch to automatically update with security patches only? Or is it an "updates include patches plus new bugs too" type situation?
So yeah, you probably won't be using it for a web server or the like, but I wouldn't imply from that that Arch is to insecure to use as a dev machine.
As far as bugs go: There's a testing phase/repo for new packages, so it's not really likely that an upgrade will do much damage (and as I said, you can still downgrade if necessary).
If you fall off the update treadmill, you start running into problems, and they tend to be weird problems that are hard to reproduce because so few people are running the exact combination of package versions that you are. Usually a full update fixes things, but the longer you've missed updates for, the more likely something will get FUBAR during the update process.
Maybe a simpler way to look at it is that rolling release distros trade slow-moving versions with low quality variance for rapid updates with high variance. Any given snapshot of Arch package versions is going to have problems, but you also don't sit on that particular combination of package versions for long. As a user you just have to decide whether that tradeoff is worth it.
On the other hand, gentoo makes a great linux experience for those who would like to get more intimate knowledge of Linux internals, networking, etc. It's a great experience if you have time and will to get your hands dirty. The documentation is excellent IMHO and the community (forums) very helpful.
Very true; keep the time investment aspect in mind though. Gentoo is probably not what you want if things should just work out of the box right away with minimal tweaking and a minimal learning curve. Ubuntu (or perhaps Arch) is more friendly in that respect, and unless you have really outlandish hardware, it will have you sitting in a working desktop five minutes after you've plugged in a USB-drive with the installer.
They were all satisfactory.
- All modern distros can run virtualized systems. You just need to install your favorite virtualization software (VirtualBox, qemu, VMWare, etc.).
- No distros have good battery management, at least not really on par with Windows, and certainly not on par with macOS. This is just the unfortunate state of affairs with the Linux kernel. Some of it is due to lack of focus on improving that aspect, and much of it is due to the difficulty of programming power management modes for various bits of hardware (a decent amount of this stuff isn't well-documented, or documented at all, depending on manufacturer). Using "powertop" (on any distro) can help you figure out the things that are eating into your battery and can help you reduce usage. TLP, a set of tools for configuring your system better for longer battery life, can also help, and should be available on most if not all distros.
Personally I run Debian (stretch) as on my main dev laptop, and it's been working well for me for years (well, jessie before stretch existed). I used to run Gentoo years ago, but got tired of long compile times. The flexibility of compiling or not compiling certain features into software just turned out not to be all that useful for me.
Similarly, compiling flexibility didn't prove like important feature for myself also. It allows you to slim down package installations or compile them with different optimization flags, but in most cases you don't gain much by using them:
- smaller package installation (by turning off features not commonly used) in the time where disk is cheap and OS is not the biggest consumer of the disk space
- have marginally improved performance if you know when it's safe to crank up compiler flags (better leave this decision to package maintainers)
- have debugger symbols built in - if you happen to ever need to do this, doing it for the binary package is not that difficult; you shouldn't have source distro just for this use-case
Gentoo deffinitely excels in providing you with concrete reasons to deepen your Linux knowledge if you have it as a distro on your main machine, which can be both pro and con.
Most users will probably never need to do this, but I find it invaluable.
I maintain my own patches for dozens of packages in order to fix quirks/WONTFIX bugs, add features that upstream refuse to touch, remove intrusive/unwanted features that piss me off, etc, and being able to do this without also having to maintain my own deb/rpm/<some other package format> makes it much less painful.
It's also nice for applying emergency security fixes without waiting for your distro to pick them up.
http://linrunner.de/en/tlp/docs/tlp-faq.html#powertop
I've owned laptops in the past that actually get better battery life under linux than windows. My current laptop is a $189 Acer Cloudbook. It gets ~ 10hours with the backlight set low. I accidentally left it on overnight (backlight off, no web browser) and it was at 20% > 10 hours later. The only power tuning is "sudo powertop --auto-tune". I run evilwm (so, not some heavy desktop environment like unity).
(Web browsing is painfully slow without noscript; I use it for light C++ and VNC)
[1] https://folkswithhats.org/
So I vote for Arch.
If you're doing enterprise development, you might want to look towards RHEL, Fedora, or CentOS.
If you're doing all work in virtual environments, you might want to just install ESX, but 275GB isn't going to hold a lot of different environments.