diff --git a/extras/shell-caller.sh b/extras/shell-caller.sh index f9cb5921..dbf8e932 100755 --- a/extras/shell-caller.sh +++ b/extras/shell-caller.sh @@ -158,7 +158,7 @@ case "$command_type" in elif [[ "$2" == "ssupdate" ]]; then /usr/bin/aptss "${@:2}" -y 2>&1 exit_code=$? - exit $? + exit $exit_code else # 非 remove/install 命令,拒绝执行 echo "拒绝执行 aptss 白名单外的指令" diff --git a/src/modules/updateCenter.ts b/src/modules/updateCenter.ts index 693011a5..75a0033a 100644 --- a/src/modules/updateCenter.ts +++ b/src/modules/updateCenter.ts @@ -139,6 +139,15 @@ export const createUpdateCenterStore = (): UpdateCenterStore => { isOpen.value = true; loading.value = true; try { + // 打开更新中心时先刷新软件源,避免使用旧的 apt 缓存导致扫不到更新 + try { + await window.ipcRenderer.invoke( + "update-center-run-system-update", + storeFilter, + ); + } catch (error) { + console.error("[UpdateCenter] open: system update failed", error); + } const nextSnapshot = await window.updateCenter.open(storeFilter); applySnapshot(nextSnapshot); } finally {