re: Robust Shell Scripts VIEW POST

VIEW FULL DISCUSSION
 

Isn't "apt install --yes ruby" only supposed to run after the update? How can that line become concurrent ? 🤔

 

Exactly. The failure makes no sense but that's the failure in the cloud-init logs

pt[1451]: INFO startup-script: Building dependency tree...
pt[1451]: INFO startup-script: Reading state information...
pt[1451]: INFO startup-script: 2 packages can be upgraded. Run 'apt list --upgradable' to see them.
pt[1451]: INFO startup-script: + apt install --yes ruby
pt[1451]: INFO startup-script: WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
pt[1451]: INFO startup-script: E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavai
pt[1451]: INFO startup-script: E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another pro
pt[1451]: INFO startup-script: Return code 100.
pt[1451]: INFO Finished running startup scripts.
Started Google Compute Engine Startup Scripts.

I've mostly given up on trying to make sense of errors. If something is broken then I just brute force my way to a solution. In this case, additing the retry loop and forcing non-interactive mode for apt seemed to fix the random failures.

code of conduct - report abuse