Comenzi Linux Utile
Comenzi Linux Utile
sudo debsums -s
debsums | grep -v OK
Umount disk
Restart GUI
CTRL+ALT+ESC
sudo xkill
Linux version
inxi -S
a. Make sure that all applications that use apt (Update Manager, Software Manager, Synaptic
Package Manager, Software Sources etc.) are closed.
1
(You can launch a terminal window like this: *Click*)
c. Now copy/paste the following command into the terminal (this is one huge line, don't chop it
up!):
sudo apt-mark hold "grub-*" "grub2*" systemd "systemd-*" lightdm slick-greeter "linux-generic*"
"linux-headers-generic*" "linux-image-generic*" "linux-signed-generic*" "linux-signed-image-
generic*" linux-firmware intel-microcode amd64-microcode
Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even
asterisks will show when you type it, that's normal. In Mint this has changed: you do see asterisks.
Press Enter again.
d. You're done! If you wish to check which packages have been put on hold, you can use this
terminal command, for which no root permission (sudo) is required:
apt-mark showhold
Press Enter.
e. Below, in item 3.2, I'll describe how to undo it (whenever you wish to apply updates for the vital
system parts).
a. Launch Timeshift and create a one-time snapshot. That way, you can always reverse the system if
the unlocking has disruptive effects. When Timeshift is done, close it.
b. Make sure that all applications that use apt (Update Manager, Software Manager, Synaptic
Package Manager, Software Sources etc.) are closed.
d. Now copy/paste the following command into the terminal (this is one huge line, don't chop it
up!):
sudo apt-mark unhold "grub-*" "grub2*" systemd "systemd-*" lightdm slick-greeter "linux-
generic*" "linux-headers-generic*" "linux-image-generic*" "linux-signed-generic*" "linux-signed-
image-generic*" linux-firmware intel-microcode amd64-microcode
Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even
asterisks will show when you type it, that's normal. In Mint this has changed: you do see asterisks.
Press Enter again.
e. Now check whether the unlocking has succeeded; for that you can use this terminal command, for
which no root permission (sudo) is required:
2
apt-mark showhold
Press Enter.
If everything has been unlocked, this command should show no output. At least not for Grub,
systemd, LightDM or the Linux kernel.
or
sudo fstrim -v /
cat /proc/sys/vm/swappiness
xed admin:///etc/sysctl.conf
psd
3
Lots of RAM (at least 8 GB): put /tmp on tmpfs
9. Does your system have lots of RAM memory? If it has at least 8 GB, then you can probably
speed up your system a bit by placing /tmp on a tmpfs partition. Which means, translated into
ordinary language: you bring about that temporary files will not be placed on the hard disk
anymore, but on a virtual RAM disk instead.
In certain cases this will not only increase overall performance, but also reduce boot time.
b. Copy/paste this blue line into the terminal (it's one line!):
Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even
dots will show when you type it, that's normal. In Mint this has changed: you'll see asterisks when
you type. Press Enter again.
Press Enter.
e. After the reboot: check whether it works, with this terminal command:
By default, a tmpfs partition has its maximum size set to half your total RAM. The actual memory
consumption depends on how much you fill it up, as a tmpfs partition doesn't consume any memory
until it is actually needed.
Note: In general, do not apply this on systems with less RAM than 8 GB! Because then this tweak
might not make them faster, but (much) slower.
If you wish to set another maximum size for tmpfs than the default, you can do that by adding a size
option to /etc/systemd/system/tmp.mount. For example, if you wish to set the maximum size to 2
Gigabyte, copy/paste this line into the terminal:
4
Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even
dots will show when you type it, that's normal. In Mint this has changed: you'll see asterisks when
you type. Press Enter again.
After the reboot you can check whether the modification has succeeded, by executing this
command:
df -h /tmp
sudo rm -v /etc/systemd/system/tmp.mount
Press Enter. Type your password when prompted. In Ubuntu this remains entirely invisible, not even
dots will show when you type it, that's normal. In Mint this has changed: you'll see asterisks when
you type. Press Enter again.
Gaming on linux
Introduction
This guide is only for Arch and Ubuntu. Any derivatives like Manjaro, Mint, PopOS, etc should
also work.
If your Distro is not here, you run into any problems or have any more additions to this guide,
Leave a comment and I will add it. Any help is more than welcome :)
If you are not a Linux user, check out my other guide on How to choose the right Distro Install it
and then come back to optimize it for gaming :)
Enable Multilib
Multilib is required by Steam, So if you are running Steam you can skip this step, If you can not
find Steam in your repositories this is your issue.
Remove the # in front of all the multilib section lines, then save and exit with CTRL + X and run
sudo pacman -Syyuu
If you are running KDE be sure to install lib32-fontconfig with the following command
sudo pacman -S lib32-fontconfig
5
Add the architecture.
sudo dpkg --add-architecture i386
If you have a GTX9xx or newer you need driver version 430. If you have a GTX 8xx or lower you
need driver version 418 and if you have a GTX5xx or lower you need driver version 390. Pick the
right driver version. If you even have an older card, manually check which driver you need:
https://www.nvidia.com/Download/index.aspx?lang=en-us
If you have an AMD card you just need the newest version.
Nvidia
For the newest Nvidia you need these packages so install them.
sudo pacman -S nvidia nvidia-settings nvidia-utils lib32-nvidia-utils lib32-opencl-nvidia opencl-
nvidia libvdpau libxnvctrl vulkan-icd-loader lib32-vulkan-icd-loader
AMD
you need these packages so install them if you have a AMD GPU
sudo pacman -S mesa lib32-mesa mesa-vdpau lib32-mesa-vdpau lib32-vulkan-radeon vulkan-
radeon glu lib32-glu vulkan-icd-loader lib32-vulkan-icd-loader
Both
Now update and reboot
sudo pacman -Syu && sudo reboot
Nvidia
For Nvidia you need to add a repository
sudo add-apt-repository ppa:graphics-drivers/ppa && sudo apt-get upgrade
6
sudo apt install nvidia-graphics-drivers-430 nvidia-settings vulkan vulkan-utils
AMD
For AMD GPUs you also need to add a repository
sudo add-apt-repository ppa:oibaf/graphics-drivers && sudo apt-get update && sudo apt-get
upgrade
Both
Now reboot
sudo reboot
If you use Gnome or GDM you might need to disable Wayland, This is not always the case, But I
include it here just in case, If your System won't reboot you can try this
Remove the # in front of the #WaylandEnable=false line and it should force Xorg.
Linux kernel
Installing the newest kernel is generally the easiest kernel switch, There are other kernels available,
I will include them later.
This is the default in Arch, no need to do anything, the newest kernel will be present.
Now ukuu is installed, in this program you can select the newest stable kernel click install and when
you reboot the new kernel is used. Do not remove your old kernel. If anything goes wrong you can
select which kernel to boot in the grub screen at startup and remove the kernel that gives you
trouble.
Feral Gamemode
7
Gamemode[github.com] puts all your hardware in performance mode, it fixes some common
problems and it just sounds cool :P
Now that it is installed we need to enable the service with this command
To use it in Steam edit the launch option for the desired game to
gamemoderun %command%
If gamemoderun does not work for you try this as a launch command:
LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/libgamemodeauto.so.0 %command%
Nvidia Improvements
Nvidia users might want to enable all options listed here to improve performance in games
Force Full Composition Pipeline avoids screen tearing by letting the GPU do all the scaling.
8
Triple Buffer avoids stuttering gameplay It allows for a stream of data instead of chunks of data.
IndirectGLXProtocol forces the game to directly communicate with the Nvidia drivers.
Coolbits enables your card to be overclocked which gamemode will make use of.
Add in these lines under the "Device" section between the other options
Option "TripleBuffer" "on"
Option "Coolbits" "28"
Add in these lines under the "Screen" section between the other options.
Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On,
ForceFullCompositionPipeline=On}"
Option "AllowIndirectGLXProtocol" "off"
Try this one with risk, It will be sure to crash GNOME, I am not sure about other DEs
If you run into any problems, just hit CTRL ALT F3 to switch to a different tty login, run the
command to edit the file again and put a # in front of the options that are giving you trouble and
reboot
Alternatively you can just completely remove the file with the following command and reboot
sudo rm /etc/X11/xorg.conf.d/20-nvidia.conf
Add in these lines under the "Device" section between the other options
Option "TripleBuffer" "on"
Option "Coolbits" "28"
9
Add in these lines under the "Screen" section between the other options.
Option "metamodes" "nvidia-auto-select +0+0 {ForceCompositionPipeline=On,
ForceFullCompositionPipeline=On}"
Option "AllowIndirectGLXProtocol" "off"
Try this one with risk, It will be sure to crash GNOME, I am not sure about other DEs
If you run into any problems, just hit CTRL ALT F3 to switch to a different tty login, run the
command to edit the file again and put a # in front of the options that are giving you trouble, Most
likely the last one
Alternatively you can just completely remove the file with the following command
sudo rm /etc/X11/xorg.conf
Libstrangle
Libstrangle[gitlab.com] is a tool that helps you control framerates but also vsync settings. This is
especially handy for games that do not support these features, You would like to half your framerate
to make it run better save some power or just give your hardware a break.
If you run Arch it will be in the AUR, for other distros you have to run the following commands
Libstrangle can be used in multiple ways depending on what you want to achieve.
To use libstrangle you can simply type strangle and then the amount of frames you want to run.
There are some examples below, But the features you will probably use are Vsync which you use by
using the -v option, the rules for OpenGL and Vulkan are different, Here is what each number does
for the different apis.
You can also limit the game depending on the power state of your device, Set it to 60 while
charging and on 30 while discharging for example. You do this by adding a second number right
after a colon. in example, strangle 60:30. There are more features but they are not that commonly
used, you can check the gitlab link above or simply type strangle -h for more information.
strangle 30 supertuxkart
To Force enable vsync on 60 fps for an OpenGL Steam game set the launch option to
strangle -v 1 60 %command%
10
To set the framerate of a vulkan game on Steam to 120 fps but 60 on battery power with adaptive
vsync set this as your launch command
If you are on Arch you can find it in the AUR, If you are on Fedora you can find it in your repos.
To configure it with a GUI you can check out GOverlay below. For a manual configuration you can
edit
~/.config/MangoHud/MangoHud.conf
If you want exactly my configuration you can just copy this into it without the need for GOverlay.
background_alpha=0.3
font_size=20
background_color=020202
text_color=ffffff
position=top-right
no_display
toggle_hud=F11
cpu_stats
cpu_temp
cpu_color=007AFA
gpu_stats
gpu_temp
gpu_color=00BD00
ram
ram_color=B3000A
vram
vram_color=00801B
io_read
io_write
io_color=B84700
arch
engine_color=B200B0
frame_timing=1
frametime_color=00ff00
#output_file=/home/houtworm/mangohud_log_
#fps_limit 120
#media_player
11
#toggle_logging=F10
You can tweak all the little things you want here. You can also create different configurations per
game by adding a MangoHud.conf file to the game directory.
mangohud %command%
mangohud supertuxkart
Some games might need the 32 bit version, try this if the normal command fails.
mangohud.x86 %command%
VKBasalt
VKBasalt[github.com] is a post processing layer for Vulkan which enables you to enhance graphics
further. It only works with Vulkan, This includes all Proton games.
If you are on Arch, it will be in the AUR, Just look for Basalt using your package manager.
To configure it first you need to create a config file, Run the following command to copy the
example to a folder you can edit as the user.
mkdir ~/.config/vkBasalt && cp /usr/share/vkBasalt/vkBasalt.conf.example
~/.config/vkBasalt/vkBasalt.conf
You can tweak all the little things you want here. You can also create different configurations per
game by adding a vkBasalt.conf file to the game directory.
To use VKBasalt for any particular game enter this as a launch option.
ENABLE_VKBASALT=1 %command%
You can also start non Steam games this way by typing the following command
ENABLE_VKBASALT=1 supertuxkart
GOverlay
GOverlay[github.com] is a Graphical User Interface for managing MangoHud and VKBasalt
If you are on a Arch based distro you can find it in the AUR, just install it with your favorite
package manager. You can also find it in your repos if you are on Fedora.
12
First install Lazarus and git with your package manager, it should be in your repositories, and
maybe it is already installed. I will list the installation method for Debian based systems, change the
first command if you are on a different distro.
cd goverlay
lazbuild -B goverlay.lpi
mesa-demos and vulkan-tools are optional, You need them if you want to show the previews. You
can find them in your distros repository
Xbox One Controller
xpad works great, is the default on modern Linux distros and supports a wide range of controllers,
But if you are like me and you only Xbox One controllers then using xpadneo is much better.
For Bluetooth to work with xpad and the Xbox One controllers you need to disable ertm (This is not
needed for xpadneo)
Add the following line to the document and save and exit with CTRL + X.
xpadneo[atar-axis.github.io] supports Xbox One controllers wired and over bluetooth, It enables
Force Feedback even the vibration inside the triggers, It supports battery level indication, It also
fixes the mapping in many many games that where previously unplayable with a Xbox One
controller on Linux.
13
Now you should be able to reboot and it should be all good, Having the controllers vibrate for a
second when connected is a good indicator that it works.
Conclusion
Your Linux distribution should now be optimized for gaming, Have fun :)
If you have run into any problems, Have any suggestions or additions or you are missing your
favorite distro, Please let me know, and i will do my best make this guide complete.
14