[英]Continue execution of a Python update script without waiting for user input
I have written a simple script to carry out all my system updates and clean up on my Fedora 19 machine in one go: 我编写了一个简单的脚本来执行所有系统更新并一次性在Fedora 19机器上进行清理:
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?
如何将其编码到脚本中,以自动删除旧内核,而无需等待用户确认?
也用'-y'运行package-cleanup。
package-cleanup -y --oldkernels
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.