Skip to content

Instantly share code, notes, and snippets.

@dhilst
Last active January 9, 2019 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhilst/019b73a46e975239083d3acd71361ac9 to your computer and use it in GitHub Desktop.
Save dhilst/019b73a46e975239083d3acd71361ac9 to your computer and use it in GitHub Desktop.
Fedora Update
#!/bin/bash
# Update Fedora
is_number() { perl -se 'exit($n !~ /^\d+(\.\d+)?$/)' -- -n="$1"; }
current_version=$(curl -s https://sjc.edge.kernel.org/fedora-buffet/fedora/linux/releases/ | perl -lane 'print $1 if /href="(\d+)\/"/' | sort -rn | head -1)
is_number $current_version || { echo 'Cant get Fedora version'; exit 1; }
dnf install dnf-plugin-system-upgrade -y && dnf upgrade --refresh -y && dnf system-upgrade download --refresh --releasever=$current_version -y && dnf system-upgrade reboot -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment