tfischer4765 / mm-install

MIT License
1 stars 0 forks source link

Check exit code of apt-install before proceeding #5

Open chelming opened 1 month ago

chelming commented 1 month ago

https://github.com/tfischer4765/mm-install/blob/a04dc38827d58eb029f09b3b1d44d13f486773eb/mm-install.sh#L252

got a weird error while apt was running and it crashed early. lots of the subsequent steps were left half-complete as a result.

Err:33 http://deb.debian.org/debian bookworm/main arm64 libcups2 arm64 2.4.2-3+deb12u5
  404  Not Found [IP: 146.75.30.132 80]
  <snip>
Get:97 http://deb.debian.org/debian bookworm/main arm64 libegl1 arm64 1.6.0-1 [33.1 kB]
Fetched 74.4 MB in 10s (7,135 kB/s)
E: Failed to fetch http://deb.debian.org/debian/pool/main/c/cups/libcups2_2.4.2-3%2bdeb12u5_arm64.deb  404  Not Found [IP: 146.75.30.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Created symlink /etc/systemd/system/multi-user.target.wants/xserver.service → /usr/local/share/mm-support/xserver.service.
Xserver has been installed and configured to run at startup
tfischer4765 commented 1 week ago

This should in theory already be happening. Unfortunately apt seems to return inconsistent and pretty useless return codes.

Note to self: check if there is a better way to discern between complete success and partial success