- found_package=$(dpkg-query -W -f='${binary:Package}\n' ${package})
- if [[ $? -eq 0 ]]; then
- echo Found $found_package installed, uninstalling...
- dpkg --purge $found_package
- if [[ $? -ne 0 ]]; then
- echo "ERROR: unable to remove $found_package" >&2
- echo " please resolve it manually and try to launch the script again." >&2
- exit $EXIT_FAILURE
- fi
+ apt remove -y $package
+ if [[ $? -ne 0 ]]; then
+ echo ERROR: failed to uninstall existing user-mode driver. >&2
+ echo Please try again manually and run the script again. >&2
+ exit $EXIT_FAILURE