Linux下用for循环卸载openoffice


当Linux下需要安装高版本openoffice或openoffice出问题的时候,就需要卸载openoffice,但是openoffice的包相当多,如果一个一个地卸载,那就不知道要何年何月才能卸载完,所以写了一个脚本来卸载openoffice,脚本很简单,实际上就是一个for循环,大家可以举一反三,用同样的方法卸载其它包。

shell> vi uninstallopenoffice.sh

for file in `rpm -qa|grep openoffice`

do

rpm -e --nodeps $file

done

shell> chmod +x uninstallopenoffice.sh

完成后运行uninstallopenoffice.sh就可以轻松地卸载掉openoffice了。

相关内容