Skip to content

Instantly share code, notes, and snippets.

@JayDoubleu
Forked from tpopela/install-dnf
Created November 19, 2021 14:33
Show Gist options
  • Save JayDoubleu/89c65f80f5af7299de8ab9e193a885b5 to your computer and use it in GitHub Desktop.
Save JayDoubleu/89c65f80f5af7299de8ab9e193a885b5 to your computer and use it in GitHub Desktop.
Simple script that unlocks the current OSTree deployment if needed and installs the dnf for debugging purposes
#!/bin/sh
# Run this script, then install the debuginfo packages with:
# sudo dnf debuginfo-install PACKAGE
if ! ostree admin status | grep Unlocked > /dev/null 2>&1; then
if ! sudo ostree admin unlock; then
echo "Can't open the current OSTree deployment!"
exit 1
fi
fi
microdnf_rpm_url="https://kojipkgs.fedoraproject.org//packages/microdnf/3.4.0/2.fc32/x86_64/microdnf-3.4.0-2.fc32.x86_64.rpm"
libpeas_rpm_url="https://kojipkgs.fedoraproject.org//packages/libpeas/1.26.0/1.fc32/x86_64/libpeas-1.26.0-1.fc32.x86_64.rpm"
if ! sudo rpm -i $microdnf_rpm_url $libpeas_rpm_url; then
echo "Can't install the microdnf!"
exit 1
fi
if ! sudo microdnf install dnf python3-dnf-plugins* gdb; then
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment