diff --git a/home/.chezmoiscripts/centos/run_onchange_before_05-upgrade.tmpl b/home/.chezmoiscripts/centos/run_onchange_before_05-upgrade.tmpl index d4e53e38..ffde9d48 100644 --- a/home/.chezmoiscripts/centos/run_onchange_before_05-upgrade.tmpl +++ b/home/.chezmoiscripts/centos/run_onchange_before_05-upgrade.tmpl @@ -5,7 +5,7 @@ ### Upgrade system logg info 'Upgrade system' -sudo dnf upgrade -y --refresh +sudo dnf upgrade --refresh ### Enable CRB logg info 'Ensure the CRB repository is activated' @@ -14,14 +14,12 @@ sudo dnf config-manager --set-enabled crb ### Add EPEL if ! dnf repolist | grep 'epel ' > /dev/null; then logg info 'Adding the EPEL repository' - . /etc/os-release sudo dnf install -y "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${VERSION}.noarch.rpm" fi ### Add EPEL Next if ! dnf repolist | grep 'epel-next' > /dev/null; then logg info 'Adding the EPEL Next repository' - . /etc/os-release sudo dnf install -y "https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-${VERSION}.noarch.rpm" else logg info 'EPEL Next repository already enabled (EPEL compatibility for CentOS)' diff --git a/home/.chezmoiscripts/fedora/run_onchange_before_5-upgrade.tmpl b/home/.chezmoiscripts/fedora/run_onchange_before_5-upgrade.tmpl new file mode 100644 index 00000000..0a8691a1 --- /dev/null +++ b/home/.chezmoiscripts/fedora/run_onchange_before_5-upgrade.tmpl @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +{{ includeTemplate "universal/logg-before" }} + +### Upgrade system +logg info 'Upgrade system' +sudo dnf upgrade --refresh + +# https://docs.fedoraproject.org/en-US/quick-docs/dnf-system-upgrade/ +# TODO - Optional: Look into using Fedora's upgrade system described in the link above +# sudo dnf install dnf-plugin-system-upgrade + +### Add RPM Fusion Free repository +if ! dnf repolist | grep 'rpmfusion-free' > /dev/null; then + logg info 'Adding RPM-Fusion Free repository for Fedora' + sudo dnf install -y "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" +fi + +### Add RPM Fusion Non-Free repository +if ! dnf repolist | grep 'rpmfusion-nonfree' > /dev/null; then + logg info 'Adding RPM-Fusion Non-Free repository for Fedora' + sudo dnf install -y "https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" +fi + +### Add Appstream data from the RPM Fusion repositories +if command -v gnome-shell > /dev/null; then + logg info 'Adding Appstream data from the RPM-Fusion repositories' + sudo dnf group update -y core +else + logg warn 'Skipping installation of Appstream data because GNOME is not installed' +fi