문제

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top