Skip to content

EndeavourOS on MacBook Air

MacBook Air

About six months ago, I inherited a 2015-2016 MacBook Air from someone who just upgraded to a 2023 MacBook Pro. The machine itself was in fine shape- with the only problem being a battery which refused to charge. I'm also not an Apple fanboy nor do I have any time to learn yet another tech stack. So, I put away the machine in storage.

EndeavourOS conversion

Around mid-February of 2024, I read a post on the Linuxmint portfolio of Reddit that the poster converted a MacBook Air to run Linux Mint. That was intriguing. If that could be done, then certainly a MacBook Air could run any flavour of Linux. I checked the chip on my MacBook- and it was a 64-bit Intel i5. So the possibilities intrigued me. Why not?

I burned the latest release of EndeavourOS onto a USB stick and booted the now revived MacBook from the stick. The install itself took an hour or less. The wifi immediately worked after the install. I was impressed. After the install, I ran the obligatory system upgrades and both EndeavourOS and the MacBook performed flawlessly. After using the machine for half a day, I found the entire OS on the 7 year old machine a remarkable delight to run.

MacBookOnEndeavourOS

But that does not mean the upgrade was free of problems. There were a few minor hurdles to overcome - documented below.

mkdocs

What did not run out of the box? mkdocs. I use mkdocs for generating this static site. Using yay, I installed mkdocs and then tried to install mkdocs-material 9.5.1-1. The install failed with an error:

ERROR: Could not resolve all dependencies.

Without mkdocs-material, the only available themes that came with mkdocs were mkdocs and readthedocs. These other themes pale compared to material. I rolled up my sleeves and got to work. It was either mkdocs with material or don't play at all.

I first downloaded the open source mkdcos-material theme from github:

git clone https://github.com/squidfunk/mkdocs-material.git

Then I ran pip to install mkdocs-material.

pip install mkdocs-material

But pip was missing on my system. Next I tried to install pip using any number of ways:

yay pip
yay -S python-pip

But these all ended up with 'wrong versions' error messages. Furthermore this also required installed a python-cryptograph and that also returned with a wrong version error.

A search on google to resolve version conflicts on EndeavourOS reveals that one has to update package mirror sites and then run a system update with yay with the following:

sudo reflector --protocol https --verbose --latest 15 --sort rate --save /etc/pacman.d/mirrorlist
yay -Syyu

After running these commands, I was finally able to install python-cryptograph with the following:

yay python-cryptograph

And with that, pip was setup. But that did not finish all my update travails.
Running pip returned an error:

error: externally-managed-environment

Lacking time to further research into python's virtual environments, I decided to get around the problem with a quick hack:

sudo mv EXTERNALLY-MANAGED EXTERNALLY-MANAGED.old

And with this, finally the pip install command worked:

pip3 install mkdocs-material

mkdocs finally came up and hosted my static site.

So far, even with a litany of setup problems on EndeavourOS, once you do some research and apply some elbow grease, the system works and works well.

A new battery

As I cited earlier, the 7 year old laptop's battery failed to properly charge and the only solution there was to install a new battery. Is that even doable on an Apple, a brand reputed to have closed-systems that's only repairable by its own Genius Bar? I had no idea, but took a look online and found that anyone can swap out the battery from a MacBook Air. A search on Amazon shows DIY battery upgrade kits for less than $30. And these come along with the proper screwdrivers for opening the back of these MacBooks. I was floored. This was too good to be true. I ordered one such kit and waited.

One week later, the new battery arrived along with the promised screwdrivers. Great, I got right to work. I popped open the back, took out the old battery, vacuumed clean the innards, then popped the new battery in. And with that 15 minute surgery, the laptop on reboot was able to charge. This was simply too easy.

cpupower

I had read online that Linux doesn't come with Apple's power saving software for its MacBooks. Intrigued, I decided to take a look. While that may or may not be true, I knew Linux has its own power saving utilities- because for high frequency trading, we always disable power saving utilities and keep cpu usage at maximum. The command cpupower does this trick:

sudo cpupower frequency-info
sudo cpupower -c all frequency-set 500 -g powersave
grep MHz /proc/cpuinfo

This lowered the cpu frequency which should presumeably extend a battery's charge for more hours. We shall see.