增加dpkg 安装软件包
This commit is contained in:
parent
ed23d20c1b
commit
603253f1f0
|
@ -192,8 +192,15 @@ class UpdateManager():
|
|||
#进行删除的操作
|
||||
def start_purge_pkgs(self,pkgs_list):
|
||||
try:
|
||||
purge_backend = get_backend(self, InstallBackend.ACTION_REMOVE_PACKAGES)
|
||||
purge_backend.start(partial_upgrade_list = pkgs_list)
|
||||
# 是否有破损的包
|
||||
deb_cache = Cache()
|
||||
broken_count = deb_cache._depcache.broken_count
|
||||
if broken_count > 0:
|
||||
pkg_list_str = " ".join(pkgs_list)
|
||||
return os.spawnlp(os.P_WAIT, "dpkg", "dpkg", "-r", pkg_list_str)
|
||||
else:
|
||||
purge_backend = get_backend(self, InstallBackend.ACTION_REMOVE_PACKAGES)
|
||||
purge_backend.start(partial_upgrade_list = pkgs_list)
|
||||
except Exception as e:
|
||||
logging.error(e)
|
||||
|
||||
|
|
Loading…
Reference in New Issue