Skip to content

Instantly share code, notes, and snippets.

@deild
Last active May 10, 2023 00:28
Show Gist options
  • Select an option

  • Save deild/02a5b7f6ee21ebac73f640fa70e399dd to your computer and use it in GitHub Desktop.

Select an option

Save deild/02a5b7f6ee21ebac73f640fa70e399dd to your computer and use it in GitHub Desktop.
Fedora on a LENOVO ThinkPad P14s with AMD processor

Fedora on a LENOVO ThinkPad P14s Gen 1 (MT_20Y1)

These are my installation-tricks and notes for running Linux on a Thinkpad P14s Gen1 with AMD Ryzen 7 4750U.

Specs

OS: Fedora release 35 (Thirty Four) x86_64

Model: 20Y1CTO1WW ThinkPad P14s Gen 1

CPU: AMD Ryzen 7 PRO 4750U with Radeon Graphics (16) @ 1.700GHz

GPU: AMD ATI 07:00.0 Renoir

Memory: 8GiB Samsung + 32GiB Kingston (SODIMM DDR4 3200 MHz)

NVMe: Sabrent Rocket Q 1TB

Ethernet: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller

Wifi: Wi-Fi 6 AX200

Notes

UEFI settings

For Linux suspend to work, set the following in UEFI:

Config -> Energy-Optimization -> select Linux instead of Windows 10

Installation

Fedora Workstation 34 up to 35

I used the automatic partitioning of the GUI-fedora-Installer with Btrfs. Everything else was also set to default.

Post Install

See Scripts postinstall for Fedora Workstation

DNF flags

I add some flags to the dnf conf file to speed it up:

echo 'fastestmirror=1' | sudo tee -a /etc/dnf/dnf.conf
echo 'max_parallel_downloads=10' | sudo tee -a /etc/dnf/dnf.conf
echo 'deltarpm=true' | sudo tee -a /etc/dnf/dnf.conf
cat /etc/dnf/dnf.conf

Set hostname

By default my machine is called localhost; hence, I rename it for better accessability on the network:

hostnamectl set-hostname fedora

Check locales

Let’s check if the locales and timezone is correctly set:

localectl status
#   System Locale: LANG=fr_FR.UTF-8
#       VC Keymap: fr-oss
#      X11 Layout: fr
#     X11 Variant: oss

timedatectl
#               Local time: sam. 2021-10-23 08:48:12 CEST
#           Universal time: sam. 2021-10-23 06:48:12 UTC
#                 RTC time: sam. 2021-10-23 06:48:12
#                Time zone: Europe/Paris (CEST, +0200)
#System clock synchronized: yes
#              NTP service: active
#          RTC in local TZ: no

Looks good, if not see the help file on the two commands or change locales and timezone in Gnome-Settings.

Automatic install of security updates

Equivalent of sudo apt install unattended-upgrades on Fedora:

sudo dnf install dnf-automatic

Fonts

Install FiraCode Nerd Font or FiraMono Nerd Font from https://www.nerdfonts.com/

Installing Ruby and Rails with rbenv

The first step is to install dependencies for Ruby.

sudo dnf install git-core zlib zlib-devel gcc-c++ patch readline readline-devel libyaml-devel libffi-devel openssl-devel make bzip2 autoconf automake libtool bison curl sqlite-devel

Install rbenv

cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
exec $SHELL

Install Ruby

rbenv install 3.0.2
rbenv global 3.0.2
ruby -v

Use this command if you do not want rubygems to install the documentation for each package locally.

echo "gem: --no-ri --no-rdoc" > ~/.gemrc

Install bundler

gem install bundler

Whenever you install a new version of Ruby or a gem, you should run the rehash sub-command. This will make rails executables known to rbenv, which will allow us to run those executables:

rbenv rehash

Installing Rails

gem install rails -v 6.1.4
rbenv rehash
rails -v

Github authentication

See https://docs.github.com/en/get-started/quickstart/set-up-git#next-steps-authenticating-with-github-from-git

Optimisation

Disable bluetooth autostart in /etc/bluetooth/main.conf. Set AutoEnable to false.

Boot

Disable NetworkManager-wait-online.service

sudo systemctl stop NetworkManager-wait-online.service
sudo systemctl disable NetworkManager-wait-online.service

Disable systemd-udev-settle.service

sudo systemctl stop systemd-udev-settle.service
sudo systemctl disable systemd-udev-settle.service

TLP

See https://austingwalters.com/increasing-battery-life-on-an-arch-linux-laptop-thinkpad-t14s/

Teams

You have to edit the file ~/.config/autostart/teams.desktop and change the line X-GNOME-Autostart-enabled=true from true to false

[Desktop Entry]
Version=1.0
Type=Application
Encoding=UTF-8
Name=Microsoft Teams - Preview
Exec=/usr/bin/teams %U
Icon=teams
Terminal=false
StartupNotify=false
Categories=Network;Application;
MimeType=x-scheme-handler/msteams;
X-GNOME-Autostart-enabled=false
X-KDE-Protocols=teams

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment