Skip to content

fix: isolate google-chrome-stable package removal to prevent skipping other packages#42

Open
jim60105 wants to merge 1 commit intojlumbroso:mainfrom
jim60105:main
Open

fix: isolate google-chrome-stable package removal to prevent skipping other packages#42
jim60105 wants to merge 1 commit intojlumbroso:mainfrom
jim60105:main

Conversation

@jim60105
Copy link

@jim60105 jim60105 commented Oct 8, 2025

Problem Description

In Ubuntu 24.04 LTS Arm environments, the google-chrome-stable package does not exist, which causes the entire apt-get remove command containing this package to fail, thereby skipping the removal of other packages.

As shown in the error log from issue #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...

Solution

This PR isolates google-chrome-stable from the multi-package removal command, following the same approach used for google-cloud-sdk and google-cloud-cli.

Changes Made

  1. Remove google-chrome-stable from the multi-package command:

    # Before
    sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing
    
    # After  
    sudo apt-get remove -y azure-cli firefox powershell mono-devel libgl1-mesa-dri --fix-missing
  2. Add individual google-chrome-stable removal command:

    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..."

Benefits

  • ✅ Prevents single package failures from affecting other package removals
  • ✅ Uses ::debug:: level error handling, consistent with other Google packages
  • ✅ Maintains backward compatibility
  • ✅ Improves stability across different Ubuntu versions and architectures

Testing

The modified code has correct YAML syntax and follows the same logic as existing google-cloud-sdk and google-cloud-cli handling.

Related Issue

Resolves #41

… 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>
@jim60105 jim60105 changed the title fix: isolate google-chrome-stable package removal to prevent skipping… fix: isolate google-chrome-stable package removal to prevent skipping other packages Oct 8, 2025
@hjmjohnson
Copy link

hjmjohnson commented Oct 12, 2025

@jim60105

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

uses: BRAINSia/free-disk-space@v2

@jim60105
Copy link
Author

Hi @hjmjohnson, thanks for the fork you provided!

Your version handles google-chrome-stable in a similar way, and I think it will fail with the same error.
The main problem is that the Arm image itself does not have google-chrome-stable package. See #41
https://github.com/BRAINSia/free-disk-space/blob/bf53006decae0ca603555a3943be99d58b4797bc/action.yml#L264-L273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Isolate google-chrome-stable uninstallation to prevent skipping other packages on Ubuntu 24.04 LTS Arm

3 participants