fix: isolate google-chrome-stable package removal to prevent skipping other packages#42
Open
jim60105 wants to merge 1 commit intojlumbroso:mainfrom
Open
fix: isolate google-chrome-stable package removal to prevent skipping other packages#42jim60105 wants to merge 1 commit intojlumbroso:mainfrom
jim60105 wants to merge 1 commit intojlumbroso:mainfrom
Conversation
… other packages (#1) ## 問題描述 在 Ubuntu 24.04 LTS Arm 環境中,`google-chrome-stable` 套件不存在,這導致包含該套件的整個 `apt-get remove` 指令失敗,進而跳過其他套件的移除操作。 根據 issue jlumbroso#41 的錯誤日誌: ``` Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package google-chrome-stable Warning: The command [sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing] failed to complete successfully. Proceeding... ``` ## 解決方案 本 PR 將 `google-chrome-stable` 從多套件移除指令中分離出來,採用與 `google-cloud-sdk` 和 `google-cloud-cli` 相同的處理方式: ### 修改內容 1. **從多套件指令中移除 `google-chrome-stable`**: ```bash # 修改前 sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing # 修改後 sudo apt-get remove -y azure-cli firefox powershell mono-devel libgl1-mesa-dri --fix-missing ``` 2. **新增單獨的 `google-chrome-stable` 處理指令**: ```bash sudo apt-get remove -y google-chrome-stable --fix-missing || echo \"::debug::The command [sudo apt-get remove -y google-chrome-stable --fix-missing] failed to complete successfully. Proceeding...\" ``` ### 優勢 - ✅ 防止單一套件找不到時影響其他套件的移除 - ✅ 使用 `::debug::` 級別的錯誤處理,與其他 Google 套件保持一致 - ✅ 保持向後相容性 - ✅ 提高在不同 Ubuntu 版本和架構上的穩定性 ## 測試 修改後的程式碼在 YAML 語法上正確,邏輯與現有的 `google-cloud-sdk` 和 `google-cloud-cli` 處理方式保持一致。 ## 關聯 Issue Resolves jlumbroso#41 Signed-off-by: Jim Chen <Jim@ChenJ.im>
|
A different change that circumvents the problem is introduced in I have forked and incorporated many of the recommended fixes in various forks into a new repo: git@github.com:BRAINSia/free-disk-space.git |
Author
|
Hi @hjmjohnson, thanks for the fork you provided! Your version handles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Description
In Ubuntu 24.04 LTS Arm environments, the
google-chrome-stablepackage does not exist, which causes the entireapt-get removecommand containing this package to fail, thereby skipping the removal of other packages.As shown in the error log from issue #41:
Solution
This PR isolates
google-chrome-stablefrom the multi-package removal command, following the same approach used forgoogle-cloud-sdkandgoogle-cloud-cli.Changes Made
Remove
google-chrome-stablefrom the multi-package command:Add individual
google-chrome-stableremoval command:Benefits
::debug::level error handling, consistent with other Google packagesTesting
The modified code has correct YAML syntax and follows the same logic as existing
google-cloud-sdkandgoogle-cloud-clihandling.Related Issue
Resolves #41