Skip to content

Commit

Permalink
Fix quick-setup.sh for Fedora 41 / dnf5 (#2273)
Browse files Browse the repository at this point in the history
Co-authored-by: Esa Varemo <esa.varemo@knowit.fi>
  • Loading branch information
varesa and knowit-varesa authored Nov 3, 2024
1 parent d86e1cc commit fc171e1
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions utils/quick-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,28 @@ function add-ssh-socket-env-for-sudo {
}

function install-containerlab {
echo "${DISTRO_TYPE}"
# when this script is used to install just containerlab
# we need to run check_os to detect the distro
if [ -z "${DISTRO_TYPE}" ]; then
check_os
fi

if [ "${DISTRO_TYPE}" = "rhel" ]; then
sudo yum-config-manager -y --add-repo=https://netdevops.fury.site/yum/ && \
echo "gpgcheck=0" | sudo tee -a /etc/yum.repos.d/netdevops.fury.site_yum_.repo

sudo yum install -y containerlab

elif [ "${DISTRO_TYPE}" = "fedora" ]; then
sudo dnf config-manager -y --add-repo "https://netdevops.fury.site/yum/" && \
echo "gpgcheck=0" | sudo tee -a /etc/yum.repos.d/netdevops.fury.site_yum_.repo
# Fedora 41 onwards ships with dnf5 instead of dnf 4 (packaged just as 'dnf')
# and requires a slightly different syntax.
if rpm --quiet -q dnf; then
sudo dnf config-manager -y --add-repo "https://netdevops.fury.site/yum/" && \
echo "gpgcheck=0" | sudo tee -a /etc/yum.repos.d/netdevops.fury.site_yum_.repo
else # dnf5
sudo dnf config-manager addrepo --set=baseurl="https://netdevops.fury.site/yum/" && \
echo "gpgcheck=0" | sudo tee -a /etc/yum.repos.d/netdevops.fury.site_yum_.repo
fi

sudo dnf install -y containerlab

Expand Down Expand Up @@ -262,4 +274,4 @@ function all {
install-containerlab
}

"$@"
"$@"

0 comments on commit fc171e1

Please sign in to comment.