Fedora
For more desktop-y stuff. See RHEL/CentOS page for server-y stuff.
Desktop
Switching desktop environment
GNOME is the default in Fedora. But you could also choose:
- XFCE
- LXQT
To list available desktop environments:
dnf group list -v --available | grep desktop
Then pick one to install:
sudo dnf install @xfce-desktop-environment
GNOME Desktop concepts
Here is a list of things in Fedora/GNOME which it took me a while to figure out the name of:
-
System Tray (GNOME desktop) - this was the area within (usually) the top edge of the screen, where some applications displayed an icon, such as Dropbox, SpiderOak Groups, etc. It has been removed, but you can get it back by installing an extension such as Topiconsfix.
-
Activities Search (GNOME desktop) - this is the search that gets initiated when you press the Super/Windows key and then start typing. It can search Documents, Files, Characters, etc. It can be configured from the GNOME control-center. See SearchProvider.
Switching desktop modes
Ensure Fedora starts up in graphical desktop mode:
sudo systemctl set-default graphical.target
Networking
Test open ports with bash:
cat < /dev/tcp/google.com/443
Networking with NetworkManager
Networking is provided by NetworkManager (nmcli
).
NetworkManager takes it upon itself to keep /etc/resolv.conf
updated.
To list all connections that NetworkManager knows about:
nmcli connection
Show the DNS settings for a connection (e.g. a Wifi network connection)
nmcli -f ipv6.dns,ipv4.dns connection show "Hyperoptic 1Gb Fibre 5Ghz"
# or
nmcli c s "Hyperoptic 1Gb Fibre 5Ghz" | grep dns
Modify the DNS settings for a connection - e.g. to set NextDNS:
nmcli con mod "Hyperoptic 1Gb Fibre 2.4Ghz" ipv6.dns xxxx:xxxx::xx:xxxx,xxxx:xxxx::xx:xxxx
nmcli con mod "Hyperoptic 1Gb Fibre 2.4Ghz" ipv6.ignore-auto-dns yes
nmcli con mod "Hyperoptic 1Gb Fibre 2.4Ghz" ipv4.dns 1.2.3.4,1.2.3.4
nmcli con mod "Hyperoptic 1Gb Fibre 2.4Ghz" ipv4.ignore-auto-dns yes
To force an update to /etc/resolv.conf
after updating settings on a connection:
sudo nmcli con up "Hyperoptic 1Gb Fibre 5Ghz"
VPN connections
To import a VPN connection from an .ovpn file:
nmcli connection import type openvpn file /path/to/your.ovpn
To make a connection from the command line:
nmcli connection up <connection_name>
To see the logs, in case something goes wrong when trying to connect:
journalctl -u NetworkManager.service
Then press G
to see the most recent log entries.
Bluetooth
Show all paired Bluetooth devices:
bluetoothctl paired-devices
Un-pair and re-pair (apparently this is supposed to work):
$ DEVICE_ID=11:22:33:44:55:66
$ bluetoothctl
[bluetoothctl] devices
[bluetoothctl] untrust 11:22:33:44:55:66
[bluetoothctl] remove 11:22:33:44:55:66
[bluetoothctl] scan on
[bluetoothctl] scan off
[bluetoothctl] connect 11:22:33:44:55:66
[bluetoothctl] pair 11:22:33:44:55:66
You can connect a device using its Address, e.g.:
$ echo -e "connect 11:22:33:44:55:66" | bluetoothctl
Agent registered
[bluetooth]# connect 11:22:33:44:55:66
Attempting to connect to 11:22:33:44:55:66
Check whether some headphones are detected as headphone or headset:
$ pactl list | grep head
Tools/apps
Fonts
Fonts can be installed in these locations:
$HOME/.local/share/fonts
$HOME/.fonts
/usr/share/fonts/
/usr/local/share/fonts
Search for fonts:
$ dnf search fonts
Manually install a font:
$ tar xvf the-font-archive.tgz
$ sudo mkdir -p /usr/share/fonts/the-font-name
$ sudo cp *.otf /usr/share/fonts/the-font-name
$ fc-cache -v
Reset the font cache:
$ fc-cache
Resizing images
In Software app, add the image resizer feature to the Nautilus file browser:
$ dnf install nautilus-image-converter
$ nautilus -q
Compressing images
Try Trimage. Installing Trimage on Fedora 29:
$ sudo dnf install jpegoptim pngcrush advancecomp
$ git clone https://github.com/Kilian/Trimage && cd Trimage
$ chmod u+x setup.py
$ ./setup.py build
$ sudo ./setup.py install
gnome-software
gnome-software
provides the GUI application Software for installing updates:
Problem: “Unable to download firmware updates from ‘fwupd’ … failed to download https://cdn.fwupd.org/downloads/firmware.xml.gz.asc: Cannot resolve hostname”
$ dnf update gnome-software
Maintenance
Disk housekeeping
For when your hard disk is embarrassingly too small.
Check free disk space
Use df
:
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/fedora-root 49G 46G 834M 99% /
# Yikes I have hardly any space left! Damn those Docker images
Check sizes of directories
See the total sizes of files in directories, starting at the root (/):
du -h -d 1 /
An alternative method to show the total sizes of directories, sorted by size ascending:
du --max-depth=1 . | sort -r -k1,1n
View disk usage interactively
Use the Disk Usage Analyzer GUI app for a visual analysis of disk space in use.
OR package ncdu
to view disk usage interactively, using an ncurses style app:
$ sudo dnf install ncdu
Delete Docker images and stuff
Delete Docker stuff to keep the fedora-root partition down to size.
Files in /var/cache/PackageKit
can reach double-digit GBs. These files are used by GNOME PackageKit (an alternative to dnf
?).
- Prune using
pkcon refresh force -c 2592000
(2592000 = 1 month in seconds) - You can remove cached packages by executing
dnf clean packages
- Find and remove old Docker images (
docker rmi ...
). Usedocker info | grep "Docker Root Dir"
to find the images location anddu
to check the size:
$ docker info | grep 'Root Dir'
Docker Root Dir: /var/lib/docker
$ sudo du -sh /var/lib/docker
11G /var/lib/docker
$ docker system prune
$ docker image prune -a
$ docker volume prune
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/fedora-root 49G 37G 11G 79% /
Prune Podman stuff
Podman puts a lot of files in $HOME/.local/share/containers
. You can delete it:
podman system prune
Reduce the system journal size
- Journals are kept in
/var/log/journal
- Edit
/etc/systemd/journald.conf
and setSystemMaxUse=1G
systemtl restart systemd-journald
Other things to try to reduce disk space
minishift delete
to delete the Minishift VM
Upgrading
To upgrade Fedora, follow the process described at:
https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/
Troubleshooting upgrades
Error when running sudo dnf system-upgrade download ...
:
Problem: package gstreamer1-plugins-bad-free-gtk-1.16.2-8.fc30.x86_64 requires gstreamer1-plugins-bad-free = 1.16.2-8.fc30, but none of the providers can be installed
- gstreamer1-plugins-bad-free-1.16.2-8.fc30.x86_64 does not belong to a distupgrade repository
- problem with installed package gstreamer1-plugins-bad-free-gtk-1.16.2-8.fc30.x86_64
(try to add '--skip-broken' to skip uninstallable packages)
- “If some of your packages have unsatisfied dependencies, the upgrade will refuse to continue until you run it again with an extra –allowerasing option. This often happens with packages installed from third-party repositories for which an updated repositories hasn’t been yet published.” (from the upgrade docs)
- Add
--allowerasing
to thesudo dnf system-upgrade download
command. This will show the packages that will be erased.
Error: Transaction test error:
file /usr/lib64/libldacBT_abr.so.2.0.2.3 from install of libldac-2.0.2.3-5.fc32.x86_64 conflicts with file from package ldacbt-2.0.2.3-7.fc30.x86_64
file /usr/lib64/libldacBT_enc.so.2.0.2.3 from install of libldac-2.0.2.3-5.fc32.x86_64 conflicts with file from package ldacbt-2.0.2.3-7.fc30.x86_64
- Check which package put the file there:
rpm -qf /usr/lib64/libldacBT_abr.so.2.0.2.3
=>ldacbt-2.0.2.3-7.fc30.x86_64
- Check which package requires
ldacbt
as a dependencydnf repoquery --installed --whatrequires ldacbt
- View info about the package:
dnf info ldacbt
- Finally, remove it:
dnf remove ldacbt
Troubleshooting
tracker-miner-fs seems to consume 100% CPU
- Seems to be a process which indexes files and puts the results in
~/.local/share/tracker
- Check overall status of the tracker using
tracker status
- See what each individual daemon is doing by using
tracker daemon
- If necessary, delete the files/folders which are causing the daemon to go out of control
Fedora no longer boots into a graphical desktop
systemctl set-default graphical.target
seems to have no effect.- See
systemctl list-units --type target
to see all “targets”, orsystemctl list-unit-files --type target
. - GDM appears to be dead -
systemctl status gdm
reports inactive
Why the hell is my default editor now nano? Why are Git commit prompts opening Nano instead of vi?
- Check your environment variables:
env | grep EDITOR
, you’ll see that this environment variable points to nano as your default editor. - To see how it was set, you can run
zsh -xl
which will list all of the commands that are run when you open a new shell. Within this output is a line somewhere that runs a script:/etc/profile.d/nano-default-editor.sh
- You can see what package installs this file:
dnf provides /etc/profile.d/nano-default-editor.sh
- it’s thenano-default-editor
package. - To find out when this package was installed:
dnf repoquery --installed --qf '%{installtime}' nano-default-editor
- Cross-referencing that with the output from
dnf history
shows that it was installed when I upgraded to Fedora 33. CONTROVERSIAL.
Some websites aren’t loading, and resolve to IP address 0.0.0.0
- Some websites/scripts don’t load in the browser.
- Trying to look up these domains, e.g.
nslookup pagead2.googlesyndication.com
, gives a result of 0.0.0.0 - Have a look at
/etc/resolv.conf
, to see which nameserver you’re using. When I looked, mine was showing 127.0.0.53 - 127.0.0.53 is (probably) the address of a caching DNS resolver. Probably resolved. Check its status with:
systemd-resolve --status
- There is a command
resolvectl flush-caches
, but this didn’t seem to do anything for me. Instead, you might clear the cache by just restarting resolved. - To reset the resolved DNS cache, just restart resolved:
sudo systemctl restart systemd-resolved
Some applications terminate without any warning (OOM / Out of Memory errors)
- The apps are perhaps being killed by
systemd-oomd
, a system service which kills processes before an out-of-memory error occurs in kernel space. - You can observe
systemd-oomd
’s recent killing sprees with:journalctl -u systemd-oomd -g Killed
, e.g.:
Feb 27 21:01:59 dougal systemd-oomd[1258]: Killed /user.slice/user-1000.slice/user@1000.service/app.slice/app-gnome-firefox-5692.scope/5692 due to memory pressure for /user.slice/user-1000.slice/user@1000.service being 60.82% > 50.00% for > 20s with reclaim activity
oomctl
lets you observe the current state ofsystemd-oomd
.systemctl mask systemd-oomd
will disable this service altogether.
Screen recordings and screen shares are too dark.
- Recording a video capture of your entire screen, or sharing a screen using the native GNOME screen sharing feature, results in a very dark video.
- I haven’t figured out how to fix this yet.
- But if you’re recording a screen capture, use
ffmpeg
to apply post-processing to the video to make it more legible. e.g.:ffplay -vf "curves=all='0/0 0.7/1 1/1'" video.mp4
- make things that were 70% bright -> 100% bright.ffplay -vf eq=gamma=1.8:saturation=1 video.mp4
- adjust gamma and saturation
- Then to render:
ffmpeg -i video.mp4 -vf "curves=all='0/0 0.7/1 1/1'" -c:a copy output.mp4
To solve this for good: I just switched to Xfce desktop environment. BIG SHRUG
Zoom screen sharing causes high CPU and system freeze
- System environment: Wayland / GNOME.
- When sharing the desktop during a Zoom call, the system freezes, or it’s fine during the sharing session, but it freezes once you stop sharing.
- I never found the root cause of this. Perhaps it was Wayland? Anyway, to anyone who’s reading this: to try to resolve this, and the other reason above, I switched my desktop environment to Xfce, and now the problem doesn’t seem to happen anymore. BIG SHRUG