Fedora has apt packaged, which causes this script to do the wrong thing if it is installed. Instead of checking for the package manager binary, use os-release(5) data to select the correct package manager to use.