I have written a simple script to carry out all my system updates and clean up on my Fedora 19 machine in one go:
import os os.system('clear') # clear the terminal screen os.system('yum -y update') # update the system without asking for confirmation os.system('package-cleanup --oldkernels') os.system('package-cleanup --problems') os.system('package-cleanup --dupes') os.system('yum clean all') exit()
The only issue is that in case there are old kernels to remove, the system will ask for user confirmation. How can I code this into the script, to automatically remove the old kernels without waiting for user confirmation?
Run package-cleanup with '-y' too.
package-cleanup -y --oldkernels