diff --git a/ubuntu-kernel-cleanup.py b/ubuntu-kernel-cleanup.py index 1613e2dbc5347ae722bfae106c9e29d8ee2300f1..dec4e84b50931938bd6e07c356ec783bb85bed23 100755 --- a/ubuntu-kernel-cleanup.py +++ b/ubuntu-kernel-cleanup.py @@ -88,6 +88,11 @@ def get_version(full_pkg_name): if __name__ == '__main__': + if os.geteuid() != 0: + print("You need to have root privileges to run this script") + print("Please try again, this time using 'sudo'. Exiting.") + os.sys.exit() + CFG_ONE = os.path.join( os.path.expanduser('~'), ".ubuntu-kernel-cleanup.ini") CFG_TWO = '/etc/ubuntu-kernel-cleanup.ini'