Having recently started to work for Riks TV, I got a new laptop to install with my favourite Linux distribution: Debian. The laptop is a Lenovo ThinkPad P1 Gen2. It’s a very nice laptop, quite powerful and fast, with a large screen and way lighter than the Lenovos I have owned before through my previous employers (Opera Software and Telenor Digital).
That’s all great, but on the other hand my previous story with Lenovo laptops has never been problem-free, and I was sure this one was no exception. Alas, I was right. So I decided to write a few notes about the installation, for myself and for anyone who wants to install Debian on this laptop. These won’t be detailed, walk-through installation instructions, but more of a high-level checklists.
First things first, you need to download an installation image. In my experience, hardware in Lenovo laptops may be a bit problematic with Debian, so you will want to download the unofficial image which includes a handful of non-free firmware (see the yellow box in the page).
Second thing, connect to Internet using a wire. The WiFi card of the laptop is not recognised by the installation image, nor it is by the kernel 4.19 shipped with Debian 10. This is known, and that’s why you’ll have to upgrade to a kernel 5.x from Debian Backports once the initial installation is completed. You’ll have to upgrade the firmware packages, too, using those from backports.
Third thing, you’ll have to change some BIOS settings. This may not be strictly necessary, but it made the set-up considerably easier. The first setting you want to change is to disable SecureBoot: if you don’t, the system won’t be able to load unsigned modules, and that includes the Nvidia driver for the video card. There are ways around it, but I didn’t want to bother. The second thing is to disable Hybrid graphics. This means you will be using only the power-greedy Nvidia video card, while the Intel video card will be disabled. Sure, you can try to play with Bumblebee, Optimus and the like: I just didn’t want to.
With all this done, install the system. I chose to install over an encrypted LVM spanning the whole disk. Yeah, I didn’t give the poor pre-installed Windows a chance 😉 Once the system reboots, you’ll notice that the console font is terribly tiny. That can be fixed through
dpkg-reconfigure console-setup once the system is booted: just run the program until you find a font family and size that suit your eyes. Anyway, that won’t fix the font used by GRUB. We’ll get to that in a minute, there is more important stuff to do now.
Now, configure the system to use backports and, once you’re done, you’ll want to install from them: the kernel image and header files (linux-image-amd64, linux-headers-amd64), the Nvidia drivers (nvidia-driver), the firmware for the WiFi card (firmware-iwlwifi), and some other miscellaneous firmware files (firmware-linux-free, firmware-linux-nonfree). I do that through apt-get:
apt-get install -t buster-backports linux-image-amd64 linux-headers-amd64 nvidia-driver firmware-iwlwifi firmware-linux-free firmware-linux-nonfree
This will install a whole bunch of dependencies, and that’s OK. You will also want to get rid of the nouveau driver: it doesn’t support the video card and having it around may just mess up things:
apt-get remove xserver-xorg-video-nouveau
Before you reboot, ensure that you add a line in
/etc/modules to ensure that the WiFi card driver is loaded in the kernel at boot time:
With all this stuff done, you can reboot. If everything went well, you should now have a functioning Debian Linux 10 “Buster”, and you can proceed to configuring the WiFi. The Nvidia driver will also allow you to use external monitors (e.g., through the HDMI port).
To solve the problem with the tiny characters in GRUB, I have edited the file
/etc/default/grub and set
update-grub as root (e.g. via
The font is not preserved between the time that goes from GRUB launching the kernel and the kernel picking up your settings from console-setup. As far as I know, there is a way around it, too, that is: setting the font on the GRUB command line that launches the kernel. I decided not to bother, if you do bother you’ll have to do your own homework. Enjoy!