DEV Community

loading...
Cover image for Switching to Ubuntu from Mac

Switching to Ubuntu from Mac

lithqube profile image Cristhian Ferrufino Updated on ・4 min read

As frontends, It’s time for us to move on into something better… bye-bye, macOS!

Why on earth would you do this?

Well, let’s start with I used to have a MacBook Pro (15-inch, 2017) at work, not the greatest piece of hardware ever produced by Apple, but at some point, I was “ok” for me to work with it only when I purchase a Magic Keyboard and Mouse.

Then during the lock-down period here in Berlin, meanwhile I was on “Home Office”. During zoom meeting all of a sudden, my webcam turn off and a burned pixel line appeared on the display, dividing it into two parts; which of course was really annoying to look. A couple of hours later on that day, the screen just stopped to work and only had a black screen.

And just like that, I was another victim of the “Flexgate”, but with a micro-crack alongside on the display (which I found out some days later, during a careful inspection at an “Apple Autorisierter Händler” here in Berlin) took all hope of getting this mac repair free of charge. Instead, I got an estimation of the repair cost of more than 1.500€.

Long story short, I got a brand new Dell XPS13 i7–10510u with Ubuntu 18.04. So at first, this reminds me of my good old days at the university, when we used to use Fedora; not completely unfamiliar with a Linux distribution but still. Some research was needed.

As a result of all that, I gather around some info which I’ve tried to summarize it, into these 3 simple steps:

Step 1 —Get down to the basics

"Upgrade to Ubuntu 20.04 LTS", then after that.

Open your command line, if you want to improve your command line skills I can recommend you this article “15 Essential Linux Command Line Tips and Tricks

sudo apt update && sudo apt upgrade

For the ones that are not familiar. Snap as is defined on their documentation is a software deployment and package management system. The canonical way for Mac’s app store.

Besides all the controversy that Snap is generating, I still believe is a great way to manage packages, especially for its self-contained structure, which gives a convenient way to install and manage complex packages dependencies.

Here is how we can install it:

sudo apt install snap

From my short experience on the subject I can suggest installing the following:

sudo apt install curl build-essential git postgresql postgresql-contrib

Step 2 — Here comes NVM

The tricky and funny part related with Snap is something I found while using it at work with my current projects when you install node with Snap, it generates found out that by using it on a container I will generate some problems related with

npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2494/bin/node itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with
Enter fullscreen mode Exit fullscreen mode

I found that the best solution to have a stable node installation is to first use NVM

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

After installation, just close the terminal and open a new one and try to verify again the installation.

To install node you can check on NVM:

nvm list-remote

and install the version of your choice, on my case the current version (14.5.0)

nvm install v14.5.0

Step 3 — Just snap of a finger

After you install all your favourite global dependencies, We can go back to be friends with Snap and proceed by installing your most beloved apps.

On my case:

sudo snap install gitkraken go multipass kotlin postman vscode intellij-idea-ultimate --classic

also to be considered some personal favorites:

sudo snap install altair termius-app beekeeper-studio nordpass gifex standard-notes vlc

Conclusion

That’s it! some weeks of full immersion in the Ubuntu world.

I believe there’s no going back for me, especially because I got this feeling of full control of my Developer Environment; not that I didn’t have it with macOS, but lately especially after I upgraded to Mojave, I was having many issues with my configurations on Proxy, filesystem and so on... But enough of my shenanigans.

Hope you like my first ever article here; soon more to come! please if you have any suggestions, critics or questions just leave your comments below. I’m pretty sure this content can be useful for many; so your feedback will be much appreciated.

:)

Happy Coding!

Discussion (6)

pic
Editor guide
Collapse
stereoplegic profile image
Mike Bybee • Edited

I use a combination of the officially recommended NodeSource deb repo for my primary Node.js (love or hate snaps, debs will always be faster, and that's critical with Node), with NVM installed via Homebrew for Linux (formerly known as Linuxbrew, I do this because it's easier to update all Brew packages at once instead of worrying about just updating NVM) so I can use different versions if a specific version is required (with automatic switching if a given project has a .nvmrc file). I do this so that my main Node is always up to date (latest LTS, via sudo apt update && sudo apt [dist-/full-]upgrade), without having to worry about running nvm to do so or reinstalling globally installed modules (I don't have many, but still). I point NVM to the NodeSource version of node with nvm use system.

Yarn is installed via its deb repo as well.

Even though I hate manually installing debs, I do that with both GitKraken and Mailspring because the snap versions are so much slower.

Collapse
lithqube profile image
Cristhian Ferrufino Author

Good point, thanks for sharing

Collapse
longhnguye profile image
longhnguye

can u explain for me why many web dev always advise use linux/unix, not windows?

Collapse
lithqube profile image
Cristhian Ferrufino Author

On my case, we release .deb packages as well as docker images to production; so the closer We're to our pipeline environment the better, it has some great advantages on debugging and testing different behaviours of the pipeline locally. We have some developers using windows but mostly to support IE11. I guess in any company these factors also push the adoption of one or another OS

Collapse
fhek789 profile image
Felipe Kinoshita

I suggest you install the latest Ubuntu 20.04 LTS, some nice improves were done by canonical!

Collapse
lithqube profile image
Cristhian Ferrufino Author

good point, thanks Felipe to mention it. Just update the article :)