January 21, 2018

This post details my Debian Stretch setup on my Lenovo ThinkPad T470p.
I got this machine in early August 2017, so I now have almost 6 months worth of experience on
Debian and I thought it was a good time to 1- document the rationale behind my move from
MacOS to Debian 2- explain how I set my computer up and 3- how I rate my appreciation of
working on Debian. Any comments/questions about what follows? Please, feel free
to use the Disqus section at the end of the post.

Go Debian

From MacOS to Linux

I have been a MacOS user for a long time mainly because my father was himself
a MacOS user. I remember back to 2005 how weird it sounded to be a
Mac aficionado compared to how trendy it is nowadays. According to me, Apple
still makes good computers and the money spent on their products if generally worth the performance.
However, given the trend of making computers as thin as possible, a Mac user has less and less
control over his hardware
and given the costs associated with having a Mac (adapters, repair costs, etc.),
owning a Mac progressively became much less appealing to me. Even less so since
suspicions of planned obsolescence.
surfaced. Moreover, since I started doing more and more coding, I realized how rarely I was using Apple’s
softwares in favor of many freewares. The list of softwares I
used on my MacOS is actually very similar to the one I use on Debian and that
I present below. It therefore occured to me that I really had no valid reason
to keep using MacOS and I decided to go Linux. So far soooooo good 😄.

Why Debian?

The choice of Linux distribution is huge, as you can see on the dedicated
wikipedia page.
As I had only a little experience with Linux, mainly Ubuntu on university
computers and Raspbian on my Raspberry Pi,
I had no strong opinion or inclination to any particular distribution.
After spending some time reading comparisons of Linux distributions
I concluded that what matters the most was my motivation to learn more and
I decided to go Debian, a.k.a. the mother of many Linux distributions.

As explained in this post by J.A. Watson,
all new Debian packages, including new versions of existing packages, first
enter the Debian testing process through the unstable release.
After a couple of tests, a new package goes to the testing release where it stays for a longer period.
Depending on the kind of package, it may or may not spread to stable and old stable
releases (see https://wiki.debian.org/StableUpdates). In reality, the majority
of new package versions do not spread further and are instead accumulated as testing releases.

When developing the next stable Debian release, the latest version of packages are
frozen, softly at first and then permanently, meaning that new developments for
the next stable Debian release are gradually stopped. This frozen period is the
time to perform tests and address bugs, necessary developments in order to release
a stable version. Essentially, all this means is that package versions included
in a new stable Debian release are slightly outdated at the time of the stable
version release, which does not preclude packages from being further developed or
render new development inaccessible. One simply has to install the testing version
of Debian to access up-to-date packages.

Debian packages I said? Well they basically are softwares for Debian. Let’s say
that they are non-random sets of files that Debian can install using dpkg -i.
Many packages are available online and you can readily install them using a
single line of command to the package manager apt-get. If you are interested, I invite
you to have a look at the list of mirrors forming
the main Debian package repository available online. To illustrate this, in the
video below I navigate to a mirror and show where Pandoc is stored.

Two additional comments

There is an upcoming collaborative development server named Salsa
based on .

Installing Debian

About my hardware

Unfortunately, I do not have strong knowledge of hardware and the choice that
I made was based on discussions with other non-experts and research on the web
Several brands of computer have a high reputation and constantly make good computers.
One of them is Lenovo, which is supposed to have
a good Linux compatibility. I guess that was enough for me, so there my adventure
with a Lenovo computer began!

Once I chose which brand I would buy, I spent
some time thinking about my general expectations: a laptop, medium-sized
screen (13”-15”), a good i7 processor, no less than 8Go of RAM, and at least
500Go SSD storage for less than 3000$CAN, warranty included. I finally zeroed in on
a customized Lenovo ThinkPad T470p.
Below are a couple of details about my computer that I can display using the command
inxi. Note that inxi is one of the freeware I installed to retrieve
information about my hardware using command lines; if you are
interested in free command line tools that return information about your
hardware I recommend this post on binarytides.
The command inxi -SGCADP entered in my terminal returns the following:

Hello and good bye Windows 10

The factory settings of my new Lenovo ThinkPad T470p was running on Windows 10 and
I did not have the choice of the OS, sadly 😞. Well, I am no Windows
user and do not intend to become one, so I got rid of Windows ASAP (I obviously took
a selfie 😈) and installed Debian Stretch. Let me now
explain how!

1- Get a bootable USB stick

I decided to go with the stable release of Debian so, in August, 2017, that meant installing
Stretch (actually released on June 17th, 2017). To get the Debian installer, you should
simply know your architecture and visit the official website.
On a recent laptop using an intel processor, it must be amd64.
So, I downloaded the debian-installer for amd64 architecture. I was quite
familiar with installing Ubuntu or MacOS with USB stick
but I was unable to remember the command lines required, so I googled
something like “bootable USB stick Debian Stretch” and got an answer
similar to this conversation on stackexchange.
Keep in mind that I was on MacOS before!

2- A small modification in the BIOS

BIOS ([…] an acronym for Basic Input/Output System and also known as the System BIOS, ROM BIOS or PC BIOS) is non-volatile firmware used to perform hardware initialization during the booting process (power-on startup), and to provide runtime services for operating systems and programs. (https://en.wikipedia.org/wiki/BIOS)

Before you can install a new OS on your new computer, you may have to change some
settings in the BIOS. In my case, I certainly did! When booting a Lenovo ThinkPad,
the first image that pops up is the Lenovo logo and the following message:

To interrupt normal startup press Enter

So I pressed Enter and then F1 to access the BIOS. I opened the Security table and
disabled the Secure Boot option to be able to boot on the USB stick. As I needed
a non-free firmware to use the Wi-Fi I plugged my device on an Ethernet Cable
and seamlessly followed the different steps to successfully install Debian
Stretch. Unfortunately, I did not record everything I did, but it is essentially what is
described in The Debian Administrator’s Handbook.
I chose an installation that includes Gnome
and a collection of very useful freewares such as LibreOffice,
Inkscape and Octave.

where to find and add keyboard bindings (for instance to record the screencasts
below ctrl+alt+shift+R).

Gnome version

Your browser does not support the video tag.

Gnome-Tweak-Tool

Your browser does not support the video tag.

Keyboard bindings

Your browser does not support the video tag.

Using Debian

My list of softwares

I use a fair number of softwares and using a package manager is extremely useful
to install them properly (e.g. the package manager takes care of all dependencies)
and to keep track of what is installed. Once Debian was installed, I proceeded to
install my collection of softwares, which is recorded as a list in a bash script
and provided below as a gist.
To be able to fully reproduce this you need to change a few lines in the
sources list. I edited /etc/apt/sources.list
in the super user mode su with the text editor nano.
So:

The first line indicates that I subscribe to a non-free repository (I needed this
for the Wi-Fi). The six following lines indicate the official repository I
use and the rest of the changes are made so that I subscribe to other repositories
(R, Qgis and papirus icons). Note that if you are a Homebrew user,
having different repositories in your source list is like using different taps.
For further information about non-free softwares I installed, have a look at the official
website on unofficial repositories,
Skype and Dropbox.
Also, if you wonder what is the difference between deb and deb-src, go on
stackexchange.
Once you are aware of this, have a look at my gist below (as version 138 when
I first shared this post and version 146 after review).

For some of the softwares listed, I do not use sudo apt-get package and
I rather use the following strategy:

wget and save the .deb file in the temporary folder /tmp/

install them with dpkgsudo dpkg -i xxxx.deb

This allows me to retrieve a newer version of the software than the one available
for the stable release. I do so for Pandoc, Atom and Hugo.

A few details

For some of the above-mentioned packages, I added a relevant link in the
table below:

Also, for all the atom packages I install using the apm command, the
package documentation is online and the URL is formed as follows:
https://atom.io/packages/+pkgname. For instance, the URL for the
pigments package is https://atom.io/packages/pigments.

A last note to mention is that I greatly benefited from reading
this and
this to set Zotero up.

Issues

Did I face a couple of issues? Of course I did, but I have learned a lot through solving them.
Do I still encounter issues? Yes I do: (1) a couple of error messages on startup
and (2) an issue with the back light of my screen! BUT regarding (1), everything
works fine so I do not complain, especially since some of the message I get might be kernel
issues that may be solved when I use a more recent release, and regarding
(2), I found a work around 😸!

Various messages on startup

As you can see below I have a couple of error messages on log (command line
is sudo dmesg -l err):

Well from what I understood this is nothing too bad. For instance, kvm: disabled by bios
is more of a warning message than an error message. My Wi-fi works great despite
the firmware: failed to load iwlwifi-8265-26.ucode message. The ACIP errors
are triggered because of firmware errors.
Well so far everything works well and fixing such errors sounds far beyond my
expertise (for the moment 😄) and motivation level.

Back light

After the fresh install, I was able to change the brightness of my screen using
F5 and F6 but I am no longer able to do so. I guess at some point my
computer hibernated and this caused the issue. Many posts address this issue
and I have tried in vain to follow the procedures described to fix this
(note that it is likely that I misinterpreted the procedure). However, I took some
time to read thorough posts
and bug reports
reporting the same issue and I have learned a lot. That’s something I really
enjoy with Debian: it forces me to understand how things works, and even
if my problem is not solved and I can no longer use F5 and F6, I still found
a workaround. I have appended a bash alias in my .zprofile:

so now if mybl 500 (mine is between 0 and 1060, that I’ve leaned too!)
my backlight is changed accordingly! .zprofile I said? Well, let’s keep
this for another post!

Future

I am very satisfied with my actual setup. My guess is that I would have been happy
on many Linux distribution. I acknowledge that it requires some time to get used to
Linux and how it works. That being said, the time spent to make your laptop
working is really rewarding and I have already learned tons of tips. I am now
considering switching to Debian testing and reading The Debian Administrator’s Handbook
very carefully!