Skip to content

Fedora Tips#

Install Softwares And Tools#

Install NeoFetch#

  • Run the command below
1
sudo yum install neofetch

Install Htop#

  • Run the command below
1
sudo yum install htop

Install Chrome#

  • Go to Software application and install chrome from there. Installing by download RPM file may not be worked.

Install Flameshot#

1
sudo dnf install flameshot

Install Gnome Tweaks#

1
sudo dnf install gnome-tweaks 

Install Docker - Docker Compose#

  • Go to this page and following the instruction.

Install Hugo#

  • Run the command below to install Hugo
1
sudo dnf install hugo

Install ZSH#

  • Zsh (short for Z Shell) is a feature-rich and powerful shell program for Unix-like operating systems with lots of interactive features. It is an extended version of the Bourne Shell (sh), with a large number of new features, and support for plugins and themes. It is designed for interactive use and it is also a powerful scripting language.
1
sudo dnf install zsh
  • Check zsh installed version
1
zsh --version
  • Configure zsh
1
zsh
  • Then you will see the instruction for the first configuration.

    • Press 1 to go to the main menu and configure each setting individually.
    • Press 2 to populate the .zshrc configuration file with the default parameters, which you can later change manually in the .zshrc file.
    • Press 0 to create an empty .zshrc configuration file and configure everything from scratch.
    • Press q to exit the configuration and start it again the next time you enter Zsh.
  • Then let's set the zsh as default shell.

  • Firstly, let's check the default shell
1
echo $SHELL
  • If the default shell is /bin/bash then we can change it to zsh by running the command below.
1
chsh -s $(which zsh)
  • After that, let's reload the zsh by command.
1
source ~/.zshrc

Install Oh-My-Zsh in Fedora#

  • Install oh-my-zsh in fedora
1
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  • Config theme for oh-my-zsh.
1
gedit $HOME/.zshrc
  • If you check, robbyrussel is the default theme for ZSH.
.zshrc
1
2
3
4
5
6
7
...
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="robbyrussell"
...
  • Therefore, to replace or change your ZSH theme, get the name of the theme from $HOME/.oh-my-zsh/themes/ folder and substitute the robbyrussell with the new name of your preferred theme.

  • For example, to change the themes to fino-time theme, $HOME/.oh-my-zsh/themes/fino-time.zsh-theme

.zshrc
1
2
3
4
5
6
7
...
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
ZSH_THEME="fino-time"
...
  • Then save and run command below to reload.
1
source ~/.zshrc
  • Then we can see the result as below.

 #zoom

Install CUPS-PDF#

  • This software is designed to produce PDF files in a heterogeneous network by providing a PDF printer on the central fileserver.
  • Run commands below for installing cups-pdf.
1
sudo dnf update
1
sudo dnf upgrade
1
sudo dnf install cups-pdf
  • Then let's open file /etc/cups/cups-pdf.conf. Then change the path setting as below.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
...

###########################################################################
#                                     #
# Path Settings         #
#                                     #
###########################################################################

### Key: Out (config)
##  CUPS-PDF output directory 
##  special qualifiers: 
##     ${HOME} will be expanded to the user's home directory
##     ${USER} will be expanded to the user name
##  Add for Fedora (see ~/.config/user-dirs.dirs)
##     ${DESKTOP} will be expanded to the user's desktop directory
##  in case it is an NFS export make sure it is exported without
##  root_squash! 
### Default: /var/spool/cups-pdf/${USER}

Out ${HOME}

...

Install Virtual Box#

  • Run commands below to install Virtual Box on Fedora 39.
1
sudo wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -P /etc/yum.repos.d/
1
sudo dnf install VirtualBox-7.0

Install Croc#

1
sudo dnf install croc

Install Fzf#

  • fzf is a general-purpose command-line fuzzy finder.
1
2
git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
~/.fzf/install

Install Postman#

  • Clone this repository from github and put it in anywhere you like postman-rpm
  • Then run the script in that repository.
1
sh make-package.sh
  • Then an rpm package will appear by the end of the process.

  • Next install the rpm package with the command as below.

1
sudo rpm -i <postman-rpm-package-name>

Warp VPN#

  • Add cloudflare-warp.repo to /etc/yum.repos.d/
1
curl -fsSl https://pkg.cloudflareclient.com/cloudflare-warp-ascii.repo | sudo tee /etc/yum.repos.d/cloudflare-warp.repo
  • Update repo
1
sudo yum update
  • Install
1
sudo yum install cloudflare-warp
  • Then use the command below to register WARP client to server. You just need to do this step one time.
1
warp-cli registration new
  • Then use the command below to connect WARP VPN
1
warp-cli connect
  • Use the command below to disconnect WARP VPN
1
warp-cli disconnect

Install Pip#

  • By default, the PIP package is not installed on Fedora, so you will need to install it first. You can install it using the following command.
1
sudo dnf install python3-pip
  • Once the PIP package is installed, you can verify the PIP version with the following command.
1
pip3 --version
  • Update your PATH variable
  • Sometimes, even after installing Python and pip, the “pip command not found” error may persist due to issues with your system’s PATH variable. To fix this, you should add the pip binary directory to your PATH.
  • If you’re using the Bash shell, open the .bashrc file, while users of the Zsh shell should edit the .zshrc file.
1
export PATH="/usr/local/bin:/usr/bin:$PATH"

Fix Issue With Flathub#

  • When you install application with flatpak, you might get the error no remote refs found similar to flathub as below.
1
2
sudo flatpak install md.obsidian.Obsidian.flatpakref
error: No entry for app/md.obsidian.Obsidian/x86_64/stable in remote 'flathub' summary flatpak cache 
  • To fix this issue we just need to run the script below to add the the flathub repository.
1
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  • Then now, you run command for installing your appliction again, then you can see it is successful.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
sudo flatpak install md.obsidian.Obsidian.flatpakref
Required runtime for md.obsidian.Obsidian/x86_64/stable (runtime/org.freedesktop.Platform/x86_64/22.08) found in remote flathub
Do you want to install it? [Y/n]: Y

md.obsidian.Obsidian permissions:
    ipc                    network        pulseaudio       ssh-auth
    wayland                x11            dri              file access [1]
    dbus access [2]        tags [3]

    [1] /media, /mnt, /run/media, home,
        xdg-run/app/com.discordapp.Discord:create
    [2] org.freedesktop.portal.Fcitx
    [3] proprietary


        ID                                   Branch Op Remote  Download
 1. [] md.obsidian.Obsidian.Locale          stable i  flathub   6.3 kB / 3.3 MB
 2. [] org.freedesktop.Platform.GL.default  22.08  i  flathub 130.7 MB / 131.0 MB
 3. [] org.freedesktop.Platform.Locale      22.08  i  flathub  17.8 kB / 333.0 MB
 4. [] org.freedesktop.Platform.VAAPI.Intel 22.08  i  flathub  10.9 MB / 10.8 MB
 5. [] org.freedesktop.Platform.openh264    2.2.0  i  flathub   1.2 MB / 944.3 kB
 6. [] org.freedesktop.Platform             22.08  i  flathub 214.1 MB / 214.4 MB
 7. [] md.obsidian.Obsidian                 stable i  flathub 130.7 MB / 132.2 MB

Installation complete.

Disable Automatic Airplane Mode When Lib Is Open#

  • For laptop user, there could be a quite annoying issue that the Airplane Mode automatically turns on when lid is opened on HP laptop.

Create service to remap the scancode#

  • Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to create a service file and edit via Gedit text editor:
1
sudo gedit /etc/systemd/system/hp-keycodes.service
  • When file opens, paste below lines and save it.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[Unit]  
Description=HP setkeycodes fix

[Service]  
Type=oneshot  
Restart=no  
RemainAfterExit=no  
ExecStart=/usr/bin/setkeycodes e057 240 e058 240

[Install]  
WantedBy=rescue.target  
WantedBy=multi-user.target  
WantedBy=graphical.target

Enable the service#

1
2
sudo systemctl daemon-reload
sudo systemctl enable hp-keycodes.service

Undo the changes#

1
2
sudo systemctl disable hp-keycodes.service
sudo rm /etc/systemd/system/hp-keycodes.service

Disable Swap Memrory#

  • On fedora, if you use the command below for disable swap memory.
1
sudo swapoff -a
  • Then it will not successful. The swap memory will be enable automatically again after.
  • So, to disable swap memory permanently you should use the command below and reboot your computer.
1
sudo dnf remove zram-generator-defaults
  • This command will remove the package which generates its configuration for using swap memory.
  • After execute the command above, you should see the successful result as below.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Dependencies resolved.
================================================================================
 Package                     Arch       Version             Repository     Size
================================================================================
Removing:
 zram-generator-defaults     noarch     1.1.2-2.fc37        @anaconda     320  
Removing unused dependencies:
 zram-generator              x86_64     1.1.2-2.fc37        @anaconda     952 k

Transaction Summary
================================================================================
Remove  2 Packages

Freed space: 953 k
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Erasing          : zram-generator-defaults-1.1.2-2.fc37.noarch            1/2 
  Erasing          : zram-generator-1.1.2-2.fc37.x86_64                     2/2 
  Running scriptlet: zram-generator-1.1.2-2.fc37.x86_64                     2/2 
  Verifying        : zram-generator-1.1.2-2.fc37.x86_64                     1/2 
  Verifying        : zram-generator-defaults-1.1.2-2.fc37.noarch            2/2 

Removed:
  zram-generator-1.1.2-2.fc37.x86_64                                            
  zram-generator-defaults-1.1.2-2.fc37.noarch                                   

Complete!

Remote Desktop Sharing#

Enable Remote Desktop Sharing#

  • Go to the setting -> sharing -> turn on enable sharing button as in the image below.

 #zoom

  • Then click on Remote Desktop. Inside the Remote Desktop, enable Remote Desktop and Remote Control as in the image below.

 #zoom

  • Check the username and password which we will use to login when connect to this Linux machine from another computer.

Connect To Remote Desktop By Linux Machine#

  • Go to Software application and install the Remmina application.

 #zoom

  • Then open the Remmina application, choose type RDP and put the IP address of the remote desktop in your LAN network as in the image below and press enter.

 #zoom

  • Then you will need to input the username and password that we configured in the Remote Desktop Linux machine.

 #zoom

  • Finally, you can access your remote desktop as in the image below.

 #zoom

Fix Error Can Not Start Virtual Machine On Virtual Box#

  • If you see the error as below.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
Kernel driver not installed (rc=-1908)  

The VirtualBox Linux kernel driver is either not loaded or not set up correctly. Please try setting it up again by executing  

'/sbin/vboxconfig'  

as root.  

If your system has EFI Secure Boot enabled you may also need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.  

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.
  • Then run commands below for fixing on Fedora 39, virtual box 7.0.14.
1
sudo dnf install kernel-devel kernel-headers dkms qt5-qtx11extras  elfutils-libelf-devel zlib-devel
1
2
wget https://www.virtualbox.org/download/oracle_vbox.asc && \
sudo rpm --import oracle_vbox.asc
1
sudo /sbin/vboxconfig

Fix Error Can not Open Terminal In Virtual Box#

  • If you can not open the Terminal of Ubuntu in Virtual Box. You can do some steps below.
  • Firstly go to Setting --> Region & Language
  • Next go to section My Account
    • change Language to `English (United States).
    • change Formats to United States.
  • Next go to section Login Screen
    • change Language to `English (United States).
    • change Formats to United States.
  • Finally Reboot the Ubuntu Virtual Machine.

Fix Can Not Copy & Paste From Parent Machine To Virtual Machine#

  • In Ubuntu Virtual Box choose Devices then choose Insert Guest Additions CD Image...
  • Then open injected Image Disk and run commands below.
1
su root
1
sudo usermod -a -G sudo vboxuser
1
su vboxuser
  • Then run command below to install tools.
1
sudo ./VBoxLinuxAdditions.run
  • Finally reboot the Ubuntu virtual machine then you can copy & paste between parent and Ubuntu virtual machine.

Add Fedora Device Into Tailscale#

1
curl -fsSL https://tailscale.com/install.sh | sh

Fix Nvidia Driver On Fedora 40#

  • Check installed packages for nvidia driver.
1
dnf list installed \*nvidia\*
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
Installed Packages
akmod-nvidia.x86_64                      3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
kmod-nvidia-6.9.8-200.fc40.x86_64.x86_64 3:555.58.02-1.fc40 @@commandline       
nvidia-gpu-firmware.noarch               20240709-1.fc40    @updates            
nvidia-modprobe.x86_64                   3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
nvidia-persistenced.x86_64               3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
nvidia-settings.x86_64                   3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia.x86_64               3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda.x86_64          3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-cuda-libs.x86_64     3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-kmodsrc.x86_64       3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-libs.x86_64          3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
xorg-x11-drv-nvidia-power.x86_64         3:555.58.02-1.fc40 @rpmfusion-nonfree-nvidia-driver
  • Remove installed nvidia packages.
1
sudo dnf remove \*nvidia\* --exclude nvidia-gpu-firmware
  • Reinstall the lastest nvidia packages.
1
sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda
  • Checks the akmod packages and try all.
1
sudo akmods --force
  • Reboot and access to BIOS system.
  • Important: Now let's turn-off the Secure Boot in BIOS.
  • Then reboot and in the login screen choose login with Gnome on XOrg.
  • Finally we can see the

 #zoom

Fix Can't Control GPU Fan In Nvidia Settings#

  • Create a configuration file name Xwrapper.config with the path /etc/X11/Xwrapper.config as below.
1
sudo gedit /etc/X11/Xwrapper.config
  • Then let's add 2 lines below into that file.
Xwrapper.config
1
2
allowed_users=anybody
needs_root_rights=yes
  • Then save and reboot the system.
  • Then we can control the GPU Fan Setting as in the image below.

 #zoom

Make Second Hard Disk As Fedora Installer#

  • This session will be useful if you using Windows and you want to install the Fedora but you don't have the USB stick and you only have 2 Disks: one disk is used for Windows and the other Disk is free. If you have the USB stick then just go with it as documented in the fedora documentation
  • Firstly on the Windows machine you should create a WSL2 machine. You can follow steps in WSL2 or the Microsoft Documentation.
  • Then for the Free Disk that don't have the installed Windows. Let's open the Disk Management of Windows and delete the volume of that Disk.

 #zoom

  • Now, let's mount the hard disk into the WSL2 machine.

  • Let's open the Windows Power Shell with the Administration and use the command below to list all the available disks with the DeviceID

1
 GET-CimInstance -query "SELECT * from Win32_DiskDrive"
  • Then you can see the results as below.
1
2
3
4
5
6
7
8
PS C:\Users\Duc> GET-CimInstance -query "SELECT * from Win32_DiskDrive"

DeviceID           Caption              Partitions Size          Model
--------           -------              ---------- ----          -----
\\.\PHYSICALDRIVE0 WDC WD40EFPX-68C6CN0 0          4000784417280 WDC WD40EFPX-68C6CN0
\\.\PHYSICALDRIVE3 KINGSTON SNV2S500G   1          500105249280  KINGSTON SNV2S500G
\\.\PHYSICALDRIVE1 WDC WD40EFPX-68C6CN0 0          4000784417280 WDC WD40EFPX-68C6CN0
\\.\PHYSICALDRIVE2 KINGSTON SNV2S500G   3          500105249280  KINGSTON SNV2S500G
  • Now, you can detect disk that you want to mount and use the command below with the DeviceID.
1
wsl --mount \\.\PHYSICALDRIVE2
  • Then let's run the command below to identify the desk that you want to format as FAT32.
1
lsblk -f
  • This command lists all block devices and their current filesystem information. Locate the partition you intend to format (e.g., /dev/sdb1).

  • Then run the command below to format the disk to FAT32

1
sudo mkfs.vfat /dev/sdb1
  • Now, in the WSL2 machine let's download the Fedora Distro that you want. For example we will download the Fedora Silverblue 42 ISO file by using the command below.
1
wget https://download.fedoraproject.org/pub/fedora/linux/releases/42/Silverblue/x86_64/iso/Fedora-Silverblue-ostree-x86_64-42-1.1.iso
  • Then run the command below to create the Fedora boot disk.
1
dd if=/path/to/Fedora-Live-Security-x86_64-21.iso of=/dev/sdb1
  • For example.
1
dd if=Fedora-Silverblue-ostree-x86_64-42-1.1.iso of=/dev/sdb1
  • After all, let's reboot and in the boot option, let's choose the disk that you install Fedora installation and now you can do the Fedora installation and you can install on the disk that you installed Windows.

Fix Issue Flameshot Not Show Icon In Gnome#

Use Podman Of Host Machine From ToolBox In Fedora Silverblue#

  • If you are using the Fedora Silverblue then you can see that, by default the Podman is installed in the host machine and if you are using toolbox which is actually a podman container and there is no podman installation there. So to use the installed Podman in the host machine from the toolbox then you use the command below.
1
flatpak-spawn --host <command>
  • For example
1
flatpak-spawn --host podman ps
  • Then you can see the result.
1
2
CONTAINER ID  IMAGE                                         COMMAND               CREATED     STATUS       PORTS       NAMES
2c372dd86f0f  registry.fedoraproject.org/fedora-toolbox:42  toolbox --log-lev...  7 days ago  Up 13 hours              fedora-toolbox-42
  • Now, let's create alias for the command above then you don't have to type a long command every time you want to use podman from the host machine.
  • Let's open the ~/.zshrc and add the command below to the end of that file.
1
2
alias podman="flatpak-spawn --host podman"
alias podman-compose="flatpak-spawn --host podman-compose"
  • Then reload the ~/.zshrc by using the command source ~/.zshrc.