Skip to content

Instantly share code, notes, and snippets.

@Postrediori
Last active April 22, 2024 11:07
Show Gist options
  • Save Postrediori/12c81e2f55ce26a1764a2f87ba1f16ce to your computer and use it in GitHub Desktop.
Save Postrediori/12c81e2f55ce26a1764a2f87ba1f16ce to your computer and use it in GitHub Desktop.
Fedora Linux Tips&Tricks

Fedora HowTos

Set default grub boot entry in Fedora

The following instructions show howto setup default boot item in grub menu unser Fedora Linux. This may be handful in case of dual-boot setup when the default item must be set to another OS.

Method 1. Specifying boot item by name

This method commands should be launched again after installing new kernel during updates (as it re-launches grub2-mkconfig).

Check boot items in grub.cfg:

# awk -F\' '$1=="menuentry " {print $2}' /boot/grub2/grub.cfg

This may produce output like the following:

Windows Boot Manager (on /dev/sda2)
UEFI Firmware Settings

Set default item by its name:

grub2-set-default "Windows Boot Manager (on /dev/sda2)"

Method 2. SPecifying boot item number

This method will set N-th item in a boot list and i is assumed that item order does not change during updates. One won't need to re-run this method installing new kernel.

Open grub config file /etc/default/grub in any suitable text editor and adjust the parameter GRUB_DEFAULT to the value of new default boot item starting with 0.

# nano /etc/default/grub

GRUB_DEFAULT=4

Run grub mkconfig to apply new grub configuration:

# grub2-mkconfig -o /boot/grub2/grub.cfg

Fedora DNF Cheatsheet

List Files in a Package

dnf repoquery -l bsd-games

Alternativelly, use rpm command:

rpm -ql bsd-games

Find the package that owns the file

dnf repoquery -f /usr/bin/ls

Alternativelly, use rpm command:

rpm -qf /bin/ls

Find the package that owning a particular file

dnf provides '*filename'
yum whatprovides '*filename'

Find which group a package belongs to

dnf repoquery --groupmember [package name]

Disable and enable repositories

Check a list of all repositories (both on&off):

dnf repolist --all

Enable repository:

dnf config-manager --set-enabled <repo name>

Disable a repository:

dnf config-manager --set-disabled <repo name>

Check packages installed from a repository:

dnf repo-pkgs <repo name> list installed

List all available dnf groups

Run grouplist with hidden parameter:

dnf grouplist hidden

Complete list of installation groups:

Available Environment Groups:
   Fedora Custom Operating System
   Minimal Install
   Fedora Server Edition
   Fedora Cloud Server
   KDE Plasma Workspaces
   Xfce Desktop
   LXDE Desktop
   LXQt Desktop
   Cinnamon Desktop
   MATE Desktop
   Sugar Desktop Environment
   Deepin Desktop
   Development and Creative Workstation
   Web Server
   Infrastructure Server
   Basic Desktop
   i3 desktop
Installed Environment Groups:
   Fedora Workstation
Installed Groups:
   Anaconda tools
   base-x
   C Development Tools and Libraries
   Container Management
...
Available Groups:
   3D Printing
   Administration Tools
   Audio Production
...

Minimal Fedora Installation via Chroot

Touchpad right click working as left click

Check click-method option:

$ gsettings list-recursively org.gnome.desktop.peripherals.touchpad
...
org.gnome.desktop.peripherals.touchpad click-method 'fingers'
...

Change it to default:

gsettings set org.gnome.desktop.peripherals.touchpad click-method 'default'
$ gsettings list-recursively org.gnome.desktop.peripherals.touchpad
...
org.gnome.desktop.peripherals.touchpad click-method 'default'
...

Fix CJK fonts

Download CJK fonts from https://github.com/notofonts/noto-cjk/releases/ (Sand and Serif releases) and unpack files to ~/.local/share/fonts.

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