Fedora

From Leo's Notes
Last edited on 30 December 2021, at 02:23.

Fedora is a Linux distribution supported by the Fedora Project which is sponsored primarily by Red Hat. Fedora provides the upstream source for Red Hat Enterprise Linux (EPEL) and CentOS.

Project website: https://getfedora.org/

Updating[edit | edit source]

Updating to a different release involves first updating the system, and then using the system-upgrade command. The Fedora documentation recommends not jumping multiple releases but rather upgrade to the next version sequentially (eg. 30 to 31 to 32, rather than 30 to 32) to avoid package dependency issues.

# yum -y update
# dnf system-upgrade download --refresh --releasever=30
# dnf system-upgrade reboot

See: https://fedoraproject.org/wiki/DNF_system_upgrade#How_do_I_use_it.3F

Automatic Updates[edit | edit source]

On Fedora 22 or later, use dnf-automatic. This is actually the same but newer mechanism as yum-cron used in CentOS 7 but uses Systemd timers rather than cron to initiate the update.

# dnf install dnf-automatic
## Edit /etc/dnf/automatic.conf so that apply_updates is set to 'yes'
# systemctl enable --now dnf-automatic-install.timer

To schedule automatic updates to happen only at a specific time or week day, edit the timer.

For example, the following timer only runs updates at the start of each week plus 1 hour and some random amount of time (between 0 and 5 minutes).

# cat /usr/lib/systemd/system/dnf-automatic-install.timer
[Unit]
Description=dnf-automatic-install timer
# See comment in dnf-makecache.service
ConditionPathExists=!/run/ostree-booted
Wants=network-online.target

[Timer]
OnCalendar=weekly
AccuracySec=1h
RandomizedDelaySec=5m

[Install]
WantedBy=multi-user.target

# systemctl list-timers --all | grep dnf-auto
Mon 2019-05-20 00:01:12 MDT  1 day 1h left Sat 2019-05-18 22:37:54 MDT  8min ago    dnf-automatic-install.timer  dnf-automatic-install.service

See Also: https://fedoraproject.org/wiki/AutoUpdates#How_are_automatic_updates_done.3F

Other Tasks[edit | edit source]

Disabling Nouveau Drivers[edit | edit source]

As mentioned at https://ask.fedoraproject.org/en/question/23982/how-to-disable-nouveau-in-fedora-18/, to disable the nouveau drivers (needed to install the nvidia drivers), you have to modify the initramfs image using dracut.

# dracut --force --omit-drivres nouveau /boot/initramfs-$(uname -r) $(uname -r)

I tried to do the usual modprobe.d to black list nouveau, but it didn't seem to work. I even added nomodeset on to the grub kernel cmdline but that also didn't seem to work...

Updating Grub2 Configuration[edit | edit source]

Grub configuration needs to be updated by running

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

The main grub configuration file is at /etc/default/grub. You must remake the configratuion for grub after you edit this file.

Installing Cuda 8.0 on Fedora 26[edit | edit source]

Cuda 8.0 seems to need GCC 5.3.1. The closest I can find is GCC 5.3.0 at https://ftp.gnu.org/gnu/gcc/gcc-5.3.0/.

You may need to apply this fix: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=ec1cc0263f156f70693a62cf17b254a0029f4852

Install any missing dependencies. These were missing on the existing Fedora 26 workstations in computer science:

libmpc-devel mpfr-devel

Compile on the system:

# ./configure --prefix=/usr/local/gcc-5.3.0 --disable-multilib
# make -j 8