Ask HN: How did you transition from Mac to Linux?

76 points by brentjanderson ↗ HN
I have been a devoted Mac user for years, however apart from needing a Mac to build and release iOS apps, I am increasingly looking for great laptop hardware with great support for Linux, and recommendations on how to jump from the Mac to Linux (preferably Ubuntu). What pitfalls did you face? What apps and support did you miss?

148 comments

[ 5.2 ms ] story [ 237 ms ] thread
Starting off with Ubuntu is a good idea. That's the friendliest distro of linux yet it still provides a fair amount of extensibility so you can start playing around with the really cool things linux offers. There wasn't anything I found myself missing. I suppose the keyboard layout is a little different but that's about it? Again though, the beauty of linux is that you can change just about anything for your preferences. I guess the recommendation is simply to just switch and just start and be patient! Good luck!
I'm curious about experiences here since I had been a Linux user before being a Mac user. Also interested specifically in anyone running Linux on a Macbook. I love Apple hardware, not sure I could go back to PC style laptops for Linux.
Because of the inadequacies and failure rate of the new "butterfly" MBP keyboard, a great option for you would be to install on a 2015 or earlier model.
This is very true - luckily I am currently on pre-butterfly, so this laptop might be a perfect testbed.
If you need a Linux laptop, I think it's wise to look at the appropriate ThinkPad models first. Of course, if you can get away with desktop-only or workstation your options are a lot more interesting.
In my experience Dell laptops also provide a great Linux experience.
Seconding this. For the price you can have a desktop at work and at home. The hardware will work flawlessly, and with much better performance as well.

Ask yourself whether working from the coffee shop or couch is really critical or even beneficial to your productivity and mental health.

My biggest realization with workstations is that they are more of a location than they are a computer formfactor. Habituating yourself to work in the work... place liberates you to not work everywhere else.

Back in the day, portable computers were luxuries for the important people in a business. Now I see the true luxury is NOT having a portable.

EDIT: Seconding both the Thinkpad recommendation as well as the suggestion to reconsider a workstation.

My only advice would be to use a desktop (tower) PC and not a laptop. Much easier to get everything working well, and no power management headaches etc.
This is what I did, used a desktop with Linux as a remote server of sorts (while also having a monitor attached). As I got more comfortable with Linux, my usage of my MBP dropped
This is good advice, you can use a terminal, forward x sessions, or use something like x2go for a full gui experience.
Really stinks when you're remote with limited connectivity though. If you're plugged in all day then it would work, yeah
X2go works well over slow lines. I used to run it on a 1mb connection.
A Project Sputnik laptop from Dell with Ubuntu pre-loaded is a safe bet. I'd personally opt for an XPS 13" Developer Edition, even if I were going to load another distro like Arch Linux. Project Sputnik's objective is to ensure Linux compatibility, which involves picking components that are compatible out of the box, and submitting upstream patches for those that aren't.

It does help that it's also the laptop that Linus is using: https://www.cio.com/article/3119876/linux/linus-torvalds-pic...

Have a Dell XPS 13 (2018) edition, NixOS w/ minimal gnome install works like a charm!

NixOS config: https://gist.github.com/Ortuna/b6e95d6baefd2a1683ddd848f485b...

Same laptop here. I've noticed the laptop drains battery when its suspended which is pretty annoying because I sometimes go a couple of days without using it. Have you run into that? I haven't had any luck getting suspend to disk to work.
It does drain, maybe 2%/hr but I thought that was normal? That's what I expect to get on a Mac. I did have to `echo XHC > /proc/acpi/wakeup` because I would shut the lid, but something on the USB bus kept turning it back on.
Install VirtualBox or similar and setup Ubuntu in a VM. Try running that full screen for a while as an easy low-risk way to start kicking the tires.
This or dual boot.

On my work computer I still have Windows which I didn’t boot into for more than a year. It was my safenet during my windows -> linux switch for full time. If stuck with task - 5 minutes and I am back to Windows. Don’t recall actually using that capability, especially after I set up free testing Windows VM on Linux.

I transitioned from OS X by installing Debian on a Macbook (dual boot with OS X). If I remember correctly, I never booted into OS X again, and eventually switched to Thinkpads, Dell XPS etc. I am a Backend Engineer so I have the luxury of not being dependent on proprietary developer ecosystems like iOS etc.

Good luck!

VirtualBox performance on OS X is awful enough and it lights your battery on fire to the point that it'd give most people second thoughts about switching.
Is there a more performant alternative to it?
Sure. VMWare Fusion, Parallels, xhyve.
I've never used macOS, but transitioning to Linux would probably pose some similar questions no matter from what OS you are coming from.

So some common tips that you might find useful:

Laptops commonly come with SSDs or even NVMes today. If you have enough RAM, you can avoid enabling swap during installation, that will provide you more useful space on your expensive drive.

Enable periodic fstrim on your drive, to make sure your deleted blocks are reused.

If you are using Samsung NVMe, you might want to use bigger partition offset than just common megabyte alignment. I was recently researching this, and found out, that it can make some performance difference if you use 3 MiB offset instead of 1 MiB. It's a bit of a difficult topic, because Samsung staunchly refuse to answer questions about their NVMe erase block size. In general it's recommended to have partitions aligned to that size for best performance. You can run various testing tools like fio before setting up the system to find the optimal layout.

Prefer AMD for your GPU (Vega is the best today), it will save you a lot pain (i.e. avoid Nvidia and especially Optimus).

Also, as others said in this thread, consider if you need a laptop at all. Desktop would be cheaper for better performance hardware.

Wrt swap: you can generally just use a swapfile. It doesn't even have to be very large. Making it a file makes it easier to manage than a partition. No, I don't know why the Debian and Ubuntu installers insist on making a partition for swap still.
Yeah, swap file would work, except on BTRFS.
Can you not wake from hibernate if your swap file is on an encrypted volume? Just a guess.
Ubuntu switched to swap files (not partitions) last year.
Good default choice, Debian is still using swap partition in the installer.
>Prefer AMD for your GPU (Vega is the best today), it will save you a lot pain (i.e. avoid Nvidia and especially Optimus).

This meme should die already. Nvidia has supported Linux better than any other vendor for 10+ years, and still does. For quite a long time, it was the only way to play 3D stuff.

Nvidia's support always had integration problems, because they never upstreamed their driver. And Optiums (used on laptops) is an especially bad case. On desktop their diver kind of works, but has a ton of quirks because of bad integration (especially with Wayland).

Today you'll be better off with AMD GPU no matter on laptop or desktop. AMD did a good job with upstream kernel integration (amdgpu) and developing Mesa for Vulkan and OpenGL (radv / radeonsi). I myself was Nvidia user for a long time and switched to AMD around a year and a half ago, when Mesa finally caught up features wise, so I know this first hand. Nvidia is clearly a worse choice today.

I recently switched by buying a Pixelbook and installing the new full Linux support (dev channel) vcalled Crostini. Love it! Apple's direction and quality don't match with my needs anymore.
I use both Mac(Work) and Thinkpads(Personal) laptops. Thinkpads (T470 and T470p are what i use) are really good wrt linux driver support. I personally use Fedora + Sway as my daily driver. It has excellent driver support(didn't get the nvidia ones though). These laptops have about 32G of ram. Plenty to run kvm vm's for all sorts of dev stuff.

Thinkpads specially the T series comes with TLP [1] support. So, the battery life is very good. Apart from that, the keyboard is pretty comfortable, display resolutions are Full HD+. I cannot recommend it enough.

[1] https://linrunner.de/en/tlp/docs/tlp-linux-advanced-power-ma...

I would be also interested. One particular productivity tool I use all the time is Alfred, especially it's clipboard history feature. Do you have any recommendations?
I made the switch after my Macbook Pro was stolen and I needed something quickly to get back to work. The transition from osx to ubuntu was pretty easy after changing my shortcuts to mimic the ones I was used to in osx. I've been using linux daily on my work machine for 7 months now, and i'm actually a little obsessed with it. I transitioned from Ubuntu to Arch and am using KDE as my desktop environment. Everything can be customized and it's great, I don't think i'll be returning to osx ever again.

I do miss the integration with my iphone though. I used the messages and notes app a lot in osx, so it's kinda annoying to not have that anymore.

Also, i'm using a Thinkpad. Would recommend.

*EDIT I now pretty much use the trackpoint 100% of the time, and don't miss the trackpad gestures at all.

Its a shame you dont have an Android, as KDE-Connect does pretty much what you are missing in terms of phone integration...
Not sure if I want to switch to Android.
kdeconnect integrates with android spectacularly. I'm on OpenSUSE, but my coworker uses it on Slackware.
Is it possible to use Android while protecting any semblance of your personal data?
Yeah, Android is as secure as you make it.
KDEConnect runs nicely on my Ubuntu Budgie install as well
Once you use the same applications, it's going to be much easier. So if you're not in rush, consider setting up trial Firefox/Chromium, Pidgin/anything, Thunderbird etc on your Mac and then copy the profiles. A lot depends on the programs you use, unless you're one of the guys that do everything in the browser - then it won't be a lot of difference.
I stopped using Mac about 5 years ago cold-turkey. I have been working with Linux for years so it was nothing really new to me, but using it as my "main desktop" had some initial issues. I just basically made a list of everything I missed on Mac and found a way to accomplish it on Linux. I was able to achieve my entire wish lish and even simplified a bit. I don't need finder since I prefer to naviagate via the Terminal for example. That doesn't work for everyone, but if they spend time looking, there will be FOSS waiting to help you out.
In 2013 I went from a Sony VAIO with Ubuntu and lot of swearing over drivers and external monitors, to the bliss of a retina MBP.

It took me exactly 20 full minutes to make its acquaintance and start working again.

That is my transition story.

[EDIT for context: I started using Linux in 1998 with Debian and no out-of-the-box support for my Intel740, so I know a thing or two about Linux and drivers]

Is there still no support for installing Linux via Boot Camp? If not, why would Apple not support this? They get their pound of flesh when they sell the hardware... is that not enough?
No support? Like, it does not work, or Apple just doesn't provide a guide for it?

Last time I check ubuntu works fine from bootcamp. (But last time I checked was 2011 or something)

Users who found that Linux did everything they want might buy something else next time. That's not to say Apple are making some evil decision to prevent this, but it's not likely to be high priority for them.
The only thing I miss about my Mac is the hardware. To be more specific: I miss the trackpad. I just picked up a 2018 ThinkPad Carbon X1 (6th Generation) and the machine runs Linux very well. The battery life is around eight or nine hours, the HDR screen is very good, etc. But nothing can come close to the Mac trackpad!

I'm running Arch Linux, for what it's worth. My use of several Macs over the last few years was basically confined to a web browser, Mail.app, and Terminal, where I installed a handful of GNU userland tools from Homebrew and essentially used it as if it was a Linux machine. I never bought into the Apple ecosystem with Photos, iCloud, messaging, etc. My pictures and music are organized in directories and I use open-source applications like darktable and GIMP (pictures) and cantata and mpd (music) so I didn't have any lock-in there.

Caveat: I'm on the systems / devops side, not dev.

I made this exact same switch a few months ago! RMBP 15 to Thinkpad X1 Carbon + Arch Linux.

I've loved it but I do miss the trackpad (although I've adjusted my workflow to use physical buttons now + thinkpad's trackpad). I also miss the larger screen (15" was really nice).

Whenever I go back to my RMBP 15 for moving files over, I've noticed the display is still nicer for text. Even with installing some calibrated color profiles, I haven't been able to match the same perfection the RMBP 15 had. Is this something you ran into at all / how did you tweak?

Did you apply the "non-official" patch for the deep-sleep? How well does it work? I'm actually waiting on Lenovo to release an official patch for it before buying this machine.
My biggest issue is that X doesn't support per-display DPI. My laptop screen is 4k, but my external monitors are 1920x1200. This works great in macOS, but in linux I either have to have big UI components on the externals, or tiny UI components on the built-in display. Some DEs have UI scaling, but it looks terrible.
I run dual-boot macOS and Ubuntu on a ThinkPad.

Ubuntu worked out-of-the-box, and macOS works well after a few tweaks. I also have a third partition to share files between the two halves. Clover bootloader has a friendly way to select which system to use on boot.

I'd like to use Linux full time, but the software I need isn't there.

I have an Aero 15x and Arch runs on it flawlessly. Everything works.
(comment deleted)
I am in the process of transitioning now from OSX to Ubuntu Budgie on a laptop and here are my takeaways so far:

- Cloud reliance has been key. GSuite and Dropbox have kept me from having to install much on the Budgie system.

- Budget a half day on StackOverflow, etc. for problems you may have getting Dropbox, Bluetooth and some other items working seamlessly with accessories... although some of this is unique to Budgie.

- Don't expect much interoperability with iOS products.

- Key apps I use are available natively, eg. Slack and Atom.

I'm still going back and forth some and find the desktop/UI customization available in Budgie has increased my productivity and decreased strain.

I'm missing hazel, bitbar and geektool applications quite a bit and haven't found a suitable replacement that is as supported and easy to configure as those apps. I can replicate most of the functionality with Python, conky, etc... but I haven't the time to do so.

I regularly switch between macOS and Linus on a Macbook, and the biggest things that are missing in terms of apps are:

- Alfred and all its integrations

- Dash for progamming documentation. Yes, I know Zeal etc. exist, but none of them come even close in terms of usability

- Karabiner-Elements for keyboard remapping. Might be less of problem on non-apple hardware where the modifier keys have a saner layout.

"How"?

Getting geeked up over a switch is probably overdoing it. I mean...you just do it. Install Fedora on it--I mean, you could install Ubuntu, but the movement seems to be away from Ubuntu and for good reasons, in production I wouldn't run something that wasn't CentOS, and Fedora is close enough while removing a lot of the pain points of dealing with Debian derivatives--and start working. It'll suck at first, it'll suck less over time, you'll get there. You'll learn to RTFM if you haven't learned it already, and you'll get there.

As a developer, using either is basically substitutable. I still use a Mac laptop because Linux laptop support varies between okay and awful (and System76 et al make computers that feel like junk, though Dell's support is worth calling out as a positive--my next machine is probably an Alienware 15, largely because of the keyboard and the GPU) but when not on the road I use the Mac mostly for Keynote and Photoshop, not writing code.

Every Unix development tool I use (i.e., I still have Windows partitions around for good reasons), from VS Code on down the line, works on both Linux and OS X without trouble. There's really not much "switching" to be done. If you use novelty stuff like Espresso or whatever it might be a trickier situation, but I feel like most developers aren't in that boat.

Consider Dropbox or similar for syncing dotfiles, though. Sharing those across will reduce your frustration a decent bit. Just make sure to have separate files for Mac and Linux-specific stuff, where applicable, and source them appropriately.

CentOS and RedHat use an essentially ancient kernal, with backported fixes. I roll with OpenSUSE on my laptop, tumbleweed will give you the rolling release with cutting edge packages, or Leap will give you an excellent experience with longer support. In my experience, OpenSUSE also has the best hardware support of any Linux distro.
They totally do use old kernels, but in practice I have not run into issues (and almost all my consulting clients were in on CentOS before I started working with them, so the die was mostly cast).

I liked OpenSUSE when I used it. Fedora's the path of least resistance for me. I kinda feel like "Not Ubuntu" is a bigger thing, in 2018, than whether you're in on Fedora or OpenSUSE or Arch or whatever; the tide seems to have turned against it as a server operating system in my neck of the woods and I tend to think you should try to stick at least reasonably close to what you're deploying on.

True, when I hear Ubuntu I'm more likely to double check you really know what your doing.
Not just fixes, but also features. They do this in order to maintain ABI compatibility. Besides, parent was talking about Fedora, which has recent kernels.

The newer kernel features aren't typically as important as stability for production workloads.

I've tried, but here are the issues I've run into. I'm not a Linux hater, but these are simple things there doesn't seem to be a fix for. This is on a new Dell XPS laptop.

- Headphones constantly crackle when they're plugged in. I've tried updating audio drivers, enabling/disabling various things, editing config files, etc. nothing fixes it. I've gotten used to listening to music with a crackle superimposed on top.

- Screen randomly flickers

- The trackpad interface is nothing short of _atrocious_. If you move around it too much it "locks up" the cursor and you can't move anymore, you have to click it several times while dragging until it starts working again. If you brush it with a single atom of your finger as you're typing, the cursor will move around wildly, often selecting most of the text you've typed and overwriting it with your next character. I've also tried updating/changing/etc libinput and it doesn't do anything.

- In an attempt to fix the above issues, I tried to update to Ubuntu 18.04 (it was on the latest 16.04). `do-release-upgrade` wouldn't recognize there was a new version available (this was a few days ago). I did `do-release-upgrade -d` without realizing it was a dev version, then after a few minutes of reading I realized it was, so I cancelled it, and rebooted my computer. Now, it just boots to a cursor on a black screen and it never changes. At this point I just decided to start using my Macbook again until I get un-frustrated enough to figure out what to do with the Dell.

See if it boots with a Ubuntu live USB. If it does you can install over the old version.
My personal pet peeve is the confusing paste buffer(s). On macs it is always ⌘+C and ⌘+V. On linux it may be CTRL+INS and Shift+INS, CTRL+C and CTRL+V, mouse-select and middle-button click and so on.
Are there different paste buffers depending on how it's activated?
Mouse-select and middle-click might be a different buffer, but other than that it's Ctrl+X/C/V.

Only on terminal it's with SHIFT to avoid conflict the Ctrl+C that ends a command.

This is actually an X11 thing - it predates Linux. Instead of "the clipboard" X has multiple clipboard-like things. In X terminology they are called "selections". There's an arbitrary number of them, but there are only two selections that are used by most apps: the "primary" selection and the "clipboard" selection.

In most apps, the primary selection is populated merely by selecting something, while the clipboard selection is populated by some sort of explicit user action, like ctrl-C or a context menu.

The clipboard selection is pasted with some other explicit action. Usually it's analogous to the way you copy to it, like ctrl-V, or a context menu.

The primary selection is usually "pasted" with middle mouse button. Sometimes there's also a keyboard shortcut, and if there is it's often a modified form of the clipboard-selection's paste shortcut.

Most people get confused by the fact that there is more than one "clipboardy thing". They copy to one, and then paste from the other and winner why their copy didn't work.

The fact that there isn't a consistent action to get to each doesn't help. It is consistent if you stick to apps from the same "family" (eg: Gnome/gtk+ or KDE), except terminals never use ctrl key shortcuts. (Because control characters already mean something in terminals.)

The elementary Terminal allows Ctrl+V to paste and I find it very convenient.
Interesting. I kind of paused when I wrote "never" because it's of course possible for a terminal to bind control-keys to arbitrary actions, but every terminal I've ever used on *nix (including Mac and Linux) just passes control-keys through by default. It's possible that some of them allow such bindings as an option, but I've never checked because I need to be able to send literal control-C and control-V to applications I run in the terminal. (Control-C is of course "break", and control-V is used in vim a lot.)

This is one of the cases where I think the Mac approach happens to work out better than Linux (or Windows): by using ⌘ instead of control as the default shortcut modifier, there's no ambiguity about whether I'm talking to my terminal (copy, paste, spawn new window, etc.) or trying to send a control character. I don't know why the Linux community defacto-standardized on control keys rather than Super (or even Alt), given the high proportion of Linux users who are also terminal users.

> Most people get confused by the fact that there is more than one "clipboardy thing". They copy to one, and then paste from the other and wine when the operation fail.

Let's not blame the (l)users. For example, by merely selecting the text you want to replace you may override the paste buffer content - this is a blatant POLA[1] violation.

[1] https://en.wikipedia.org/wiki/Principle_of_least_astonishmen...

> Let's not blame the (l)users.

I don't think stating that "people get confused" is placing blame on one party or the other. That they get confused is a fact. I said nothing about whose fault that is.

> For example, by merely selecting the text you want to replace you may override the paste buffer content

It's a trade-off. Having the mere act of selecting text copy it to the primary selection is extremely convenient. There isn't any way to have that convenience without the downside that overwriting it is also easy. If you want to copy something and not have further selections overwrite it, you use the clipboard. This is like the trade-off of having a confirmation dialog or not.

I wouldn't say "this is a blatant POLA violation". What surprises one person might seem obvious to another. There is only one intuitive user interface, everything else is learned.

The confusion starts with the fact that people typically aren't told that the primary selection and the clipboard are two separate things (and by using the term "paste buffer" to ambiguously refer to one of them you're perpetuating this). Much of this misconception comes from the fact that more popular systems (Windows and Mac) only have the one clipboard, and people assume that whatever they learned first is universally true.

Not knowing about the primary selection actually isn't a problem on its own, though. After all, if one only knows about the clipboard operations, but doesn't ever trigger pasting from the primary selection, then the fact that the primary selection even exists would be invisible to them. The clipboard selection on X works pretty much the same as the clipboard on other systems.

The real problems start when people who believe there is only one "paste buffer" are then told, or discover, that they can "paste" using operations that actually paste from the primary selection rather than the clipboard. The worst part is that this doesn't fail outright, but instead seems to work, but inconsistently. Now they're confused, because there is no way to reconcile this behavior with their mental model that "this is another way to paste from the one and only clipboard".

> In an attempt to fix the above issues, I tried to update to Ubuntu 18.04

Upgrade are offered from LTS to LTS only once the x.x.1 has been released.

For the record, 18.04 isn't a dev version now, but 16.04 won't offer the update until 18.04.1 is released in a couple of months. That's a chance for early bugs to be ironed out before lots of LTS users upgrade.
My greatest praise for Linux is that it's nearly impossible to completely brick the install - it's almost universally possible to recover it, no matter how broken it seems. You can potentially live-boot your XPS from a USB stick, chroot into your existing install and let the upgrade run to completion (Google around for some guides). 18.04 is a very slick OS - I'm running it at work on my company Precision laptop and it's fantastic. The '-d' flag is required until the 18.04.1 release, which is when the new LTS is considered stable enough for existing LTS users to upgrade.
This sounds very useful! I googled but didn't find much - perhaps I did not use the right terms. Can you please post some links that point me in the right direction?
Here:

https://help.ubuntu.com/community/LiveCdRecovery#Update_Fail...

Rather than Ctrl+Alt+F1 (which switches to a TTY), you can open a Terminal instead and run 'sudo -i' to get a root shell.

Replace 'sda1' with your root disk (you may have LVM enabled, and definitely if you have full disk encryption). If you don't have disk encryption, run 'pvscan' and see if it reports anything.

To get the update to finish, you can run 'dpkg --configure --all'.

Your headphone crackle and screen flicker issues both sound like hardware problems. I've never experienced anything like that on any Linux machine I've ever used. I did have an old HP laptop (running Windows) where the screen hinge had damaged the video cable, and I'd get flicker unless it was opened just right.
> Headphones constantly crackle when they're plugged in. I've tried updating audio drivers, enabling/disabling various things, editing config files, etc. nothing fixes it. I've gotten used to listening to music with a crackle superimposed on top.

I thought Dell’s XPS series was supposed to have first class support on Linux? Did you try to contact Dell? I never had problem with sound on Linux even with some very cheap hardware.

Anyway, if you’re willing to do some tinkering yourself it might be as simple as adjusting some deep alsa settings.

E.g. this guy makes it look easy[1] :)

> I've also tried updating/changing/etc libinput and it doesn't do anything.

Does it use “precision” drivers on Windows? Sometimes trackpads implement their own gesture recognition and all kinds of other weird things. Check what you get with `xinput list` and try disabling anything that is not a pointer device.

> (it was on the latest 16.04)

Was it a new Dell? If you have new hardware and old kernel then forgot all of the above as that is obviously not a great combination. You absolutely need the latest kernel for the latest hardware.

> I did `do-release-upgrade -d` without realizing it was a dev version, then after a few minutes of reading I realized it was, so I cancelled it, and rebooted my computer.

Yeah sorry, Ubuntu doesn’t offer safe upgrades. I suggest if you don’t have much Linux experience (and even if you do) OpenSuse Leap/Tumbleweed which has full snapshot & rollback support[1], and since recently fully transactional upgrades as well.

[1] https://www.youtube.com/watch?v=a1YkPtfC4LI

[2] https://www.youtube.com/watch?v=GJgWvTLo07k