jlumbroso / free-disk-space

:octocat:⚙️🗑️ A GitHub Action to free disk space on an Ubuntu runner.
MIT License
385 stars 72 forks source link

从9/14开始报错 Starting from 9/14, reporting errors #13

Closed allok1985 closed 1 year ago

allok1985 commented 1 year ago

Run jlumbroso/free-disk-space@main with: tool-cache: true android: true dotnet: true haskell: true large-packages: true swap-storage: true docker-images: true env: REPO_URL: https://github.com/coolsnowwolf/lede REPO_BRANCH: master FEEDS_CONF: feeds.conf.default CONFIG_FILE: x64.config DIY_P1_SH: diy-part1.sh DIY_P2_SH: diy-part2.sh RELEASE_TAG: X64 UPLOAD_BIN_DIR: true UPLOAD_FIRMWARE: true UPLOAD_COWTRANSFER: false UPLOAD_WETRANSFER: false UPLOAD_RELEASE: true TZ: Asia/Shanghai Run # ======

======

MACROS

======

macro to print a line of equals

(silly but works)

printSeparationLine() { str=${1:=} num=${2:-80} counter=1 output="" while [ $counter -le $num ] do output="${output}${str}" counter=$((counter+1)) done echo "${output}" }

macro to compute available space

REF: https://unix.stackexchange.com/a/42049/60849

REF: https://stackoverflow.com/a/450821/4087[3](https://github.com/allok1985/Actions-OpenWrt/actions/runs/6188669104/job/16815252959#step:2:3)[4](https://github.com/allok1985/Actions-OpenWrt/actions/runs/6188669104/job/16815252959#step:2:4)

getAvailableSpace() { echo $(df -a $1 | awk 'NR > 1 {avail+=$4} END {print avail}'); }

Package 'dotnet-sdk-7.0-source-built-artifacts' is not installed, so not removed Package 'dotnet-templates-6.0' is not installed, so not removed Package 'dotnet-templates-7.0' is not installed, so not removed Package 'dotnet-apphost-pack-3.1' is not installed, so not removed Package 'dotnet-runtime-3.1' is not installed, so not removed Package 'dotnet-sdk-3.1' is not installed, so not removed Package 'dotnet-hostfxr-3.1' is not installed, so not removed Package 'dotnet-runtime-deps-3.1' is not installed, so not removed The following additional packages will be installed: aspnetcore-targeting-pack-6.0 aspnetcore-targeting-pack-7.0 The following packages will be REMOVED: aspnetcore-runtime-6.0 aspnetcore-runtime-7.0 dotnet-apphost-pack-6.0 dotnet-apphost-pack-7.0 dotnet-host dotnet-hostfxr-6.0 dotnet-hostfxr-7.0 dotnet-runtime-6.0 dotnet-runtime-7.0 dotnet-runtime-deps-6.0 dotnet-runtime-deps-7.0 dotnet-sdk-6.0 dotnet-sdk-7.0 dotnet-targeting-pack-6.0 dotnet-targeting-pack-7.0 The following packages will be upgraded: aspnetcore-targeting-pack-6.0 aspnetcore-targeting-pack-7.0 2 upgraded, 0 newly installed, 15 to remove and 16 not upgraded. Need to get 3045 kB of archives. After this operation, 1029 MB disk space will be freed. Get:1 file:/etc/apt/apt-mirrors.txt Mirrorlist [142 B] Ign:2 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 aspnetcore-targeting-pack-6.0 amd64 6.0.121-0ubuntu1~22.04.1 Ign:3 http://azure.archive.ubuntu.com/ubuntu jammy-updates/universe amd64 aspnetcore-targeting-pack-7.0 amd64 7.0.110-0ubuntu1~22.04.1 Ign:2 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 aspnetcore-targeting-pack-6.0 amd64 6.0.121-0ubuntu1~22.04.1 Ign:3 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 aspnetcore-targeting-pack-7.0 amd64 7.0.110-0ubuntu1~22.04.1 Ign:2 http://security.ubuntu.com/ubuntu jammy-updates/universe amd64 aspnetcore-targeting-pack-6.0 amd64 6.0.121-0ubuntu1~22.04.1 Err:2 mirror+file:/etc/apt/apt-mirrors.txt jammy-updates/universe amd64 aspnetcore-targeting-pack-6.0 amd64 6.0.121-0ubuntu1~22.04.1 404 Not Found [IP: 52.252.75.106 80] Ign:3 http://security.ubuntu.com/ubuntu jammy-updates/universe amd64 aspnetcore-targeting-pack-7.0 amd64 7.0.110-0ubuntu1~22.04.1 Err:3 mirror+file:/etc/apt/apt-mirrors.txt jammy-updates/universe amd64 aspnetcore-targeting-pack-7.0 amd64 7.0.110-0ubuntu1~22.04.1 404 Not Found [IP: 52.252.75.106 80] E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/universe/d/dotnet6/aspnetcore-targeting-pack-6.0_6.0.121-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 52.252.75.106 80] E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/universe/d/dotnet7/aspnetcore-targeting-pack-7.0_7.0.110-0ubuntu1%7e22.04.1_amd64.deb 404 Not Found [IP: 52.252.75.106 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? Error: Process completed with exit code 100.

ywt114 commented 1 year ago

The problem arises from rm rf/usr/share/dotnet. The solution is to first run apt-get update to update the software package list, and then run apt-get remove - y '^ dotnet -. ' to solve the execution error issue. I have tested and just submitted the pull requests, but I don't know if they will be killed. You can also fork the project and modify it yourself in the action.yml file by adding a sudo apt-get update before line 174, And there is a duplication between sudo rm - rf/usr/share/dotnet and sudo apt-get remove - y '^ dotnet -. '. Change to sudo rm - rf/usr/share/dotnet | | true and sudo apt get remove - y '^ dotnet -. *' | | true

mskyttner commented 1 year ago

+1

jlumbroso commented 1 year ago

@allok1985 @ywt114 @mskyttner Do you still have these issue with v1.3.0? If so, please reopen this ticket.

mskyttner commented 1 year ago

Thanks, I like this gha! When I tried switching from kfir4444/free-disk-space@main I noted that I got this warning from my GHA, not sure if it affects my final image push (looking into that now):

E: Unable to locate package google-cloud-sdk
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...
jlumbroso commented 1 year ago

@mskyttner Thank you so much for the feedback. I can confirm:

Thanks so much for following up and letting me know how the recent changes affected you! 👌🏻