how to install Linux Mint on Lenovo Legion 5 to have proper hardware drivers and screen brightness control
timeStamp: 12 March 2022
** updated for Linux Mint 20.3 Cinnamon**
** updated for power consumption issue fix **
Linux Mint is forked from Debian and similar to Ubuntu so this may work for Ubuntu OS as well.
I did try to install Ubuntu 21.xx OS and it created a custom NVIDIA driver that didnt quite work properly so be warned.
I hope this will help someone else that might be going down this same path.
It took me a while to figure it out so hopefully I can same you some time.
Laptop: Lenovo Legion 5 15 Gaming Laptop, 15.6" FHD (1920 x 1080) Display, AMD Ryzen 7 5800H Processor, 16GB DDR4 RAM, 512GB NVMe SSD, NVIDIA GeForce RTX 3050Ti
Amazon link: https://amzn.to/3s9NQcC
Linux Mint OS: https://linuxmint.com/
these are the steps I took to get Linux Mint 20.3 Cinnamon on a Lenovo Legion 5 gaming laptop
F12
- this will let you choose boot device[NOTE: hybrid graphics started working in Mint 20.3. For older versions, see older commits for discrete graphics only setup]
1: select hybrid graphics [NOTE: you can select Discrete Graphics if you want]
F2
on keyboardExit
and save settings2: install latest linux kernel (kernel: 5.13.0-21-generic)
sudo mintupdate
➡ Mint Update Manager GUIreboot
3: install latest nvidia graphics drivers (510.47.03)
using "driver manager" gui update graphics drivers to latest nvidia driver version
sudo mintdrivers
➡ Mint Driver Update GUIreboot
NVIDIA On-Demand
icon in lower right applet panelNVIDIA Settings
PRIME Profiles
NVIDIA On-Demand
Quit
reboot
4: update all packages to latest versions
Update Manager
in App Menusudo apt update && sudo apt full-upgrade -y
sudo apt autoremove && sudo apt autoclean
** update for Mint 20.3 Cinnamon, script updated to fix device name convention bug **
NOTE: brightness keys still not working so use this repository to control brightness in software
TLDR cli magic (copy and paste into your cmd line):
wget https://github.com/wottreng/Linux-Mint-on-Lenovo-Legion-5/archive/refs/heads/main.zip && unzip main.zip && cd Linux-Mint-on-Lenovo-Legion-5-main && chmod 777 setupBrightnessControlKeys.sh && ./setupBrightnessControlKeys.sh
git setup:
1: download this repository ➡ cli cmd:
git clone https://github.com/wottreng/Linux-Mint-on-Lenovo-Legion-5.git
2: change directory ➡ cli cmd:
cd Linux-Mint-on-Lenovo-Legion-5/
3: make setupBrightnessControlKeys.sh excutable ➡ cli cmd:
chmod 777 setupBrightnessControlKeys.sh
4: run setup script ➡ cli cmd:
./setupBrightnessControlKeys.sh
5: test your brightness keys, they should work properly now! If not see trouble shooting below
[-- NOTES -- ]
setupBrightnessControlKeys.sh
for comments on how this works and how to remove key bindings if neededbrightnessControl.py -h
for help output and supported argumentsKeyboard
in App Menu ➡ Shortcuts
➡ Custom Shortcuts
brightnessControl.py -v
to see what device names its finding and you may need to set default in your key bindings like so: brightnessControl.py -d DEVICE-NAME -c 5
⚠ NOTE: wifi driver is now included in Mint 20.3. If you still need drivers then look at older commits for manual install process ⚠
batterySaverMode.py
puts laptop into battery saver mode when plugged inTLDR cli magic (copy and paste into your cmd line):
wget https://github.com/wottreng/Linux-Mint-on-Lenovo-Legion-5/archive/refs/heads/main.zip && unzip main.zip && cd Linux-Mint-on-Lenovo-Legion-5-main && chmod 777 batterySaverMode.py && sudo mv ./batterySaverMode.py /bin/
1: make it excutable ➡ cli cmd:
chmod 777 ./batterySaverMode.py
2: add script to $PATH (ie. your /bin
folder) ➡ /bin/batterySaverMode.py
sudo mv ./batterySaverMode.py /bin/batterySaverMode.py
3: call it from a command line ➡ cli cmd:
batterySaverMode.py
(credit goes to O491dogan)
Higher than normal power consumption has been reported after proper drivers and updates.
The issue seems to be the dGPU not being turned off when not in use.
powertop
sudo apt install powertop
sudo powertop --auto-tune
sudo powertop
with power cable unplugged
nvidia-settings
then select PRIME Profiles, then select NVIDIA On-Demandcat /sys/bus/pci/devices/0000:01:00.0/power/control
auto
for dGPU on-demandon
your dGPU is always onNOTES:
more info, see discussion
F2
: open BIOS during bootCtrl + Alt + F1
or Ctrl + Alt + F2
: change to basic command line interfaceCtrl + Alt + F7
: change back to GUI 'desktop' interfaceShift
during boot to open up grub for advanced options like recovery modeCTRL + ALT + T