Skip to content

fix(setup.sh): Add wget to core_packages, fix HWE package name, use shutdown -r +1 - #233

Merged
PDowney merged 3 commits into
masterfrom
copilot/fix-wget-and-ubuntu-version-issues
May 2, 2026
Merged

PDowney merged 3 commits into
masterfrom
copilot/fix-wget-and-ubuntu-version-issues

Conversation

Copilot AI commented May 2, 2026

Copy link
Copy Markdown
Contributor

Three bugs in setup.sh that cause installation failures or incorrect behavior on a fresh Ubuntu system.

Software Version Updates

Changed Versions

No version changes — these are correctness fixes to setup.sh.

Version Diff

- core_packages=(...  "unzip" "zip")
+ core_packages=(...  "unzip" "wget" "zip")

- apt install --install-recommends "linux-generic-hwe-${UBUNTU_VERSION}" -y
+ UBUNTU_VERSION_NO_DOT="${UBUNTU_VERSION//./}"
+ apt install --install-recommends "linux-generic-hwe-${UBUNTU_VERSION_NO_DOT}" -y

- echo "Server will restart in 10 seconds"
- shutdown -r now
+ echo "Server will restart in approximately 1 minute"
+ shutdown -r +1

Verification Checklist

  • wget is now installed before the required_commands validation runs
  • HWE package name is well-formed (linux-generic-hwe-2404, not linux-generic-hwe-24.04)
  • Restart uses shutdown -r +1 — broadcasts a system-wide warning, cancellable; message updated to reflect the ~70s actual delay

Notes

  • wget was already validated as required but never installed by the script — would fail on any minimal Ubuntu image that doesn't ship it.
  • linux-generic-hwe-24.04 is not a valid apt package name; the correct name uses the dotless form (e.g. linux-generic-hwe-2404).
  • shutdown -r now silently reboots with no broadcast; shutdown -r +1 gives all logged-in users a standard warning.
Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"The command 'wget' is listed as required but is not included in the core_packages array for installation. This will cause the validation check to fail if wget is not already installed on the system.","fixFiles":[{"filePath":"setup.sh","diff":"diff --git a/setup.sh b/setup.sh\n--- a/setup.sh\n+++ b/setup.sh\n@@ -57,7 +57,7 @@\n core_packages=(\n   \"apt\" \"bash\" \"boxes\" \"cron\" \"coreutils\" \"curl\" \"dos2unix\" \"git\" \"gzip\" \"nano\" \n   \"needrestart\" \"openssl\" \"pwgen\" \"sed\" \"software-properties-common\" \"tar\" \n-  \"tzdata\" \"unattended-upgrades\" \"unzip\" \"zip\"\n+  \"tzdata\" \"unattended-upgrades\" \"unzip\" \"wget\" \"zip\"\n )\n \n apt install -qy \"${core_packages[@]}\" || {\n"}]},{"message":"The variable UBUNTU_VERSION contains a dot (e.g., '24.04'), which will cause the package name to be malformed as 'linux-generic-hwe-24.04'. This package name is invalid. Use a version without the dot, such as a codename or integer representation.","fixFiles":[{"filePath":"setup.sh","diff":"diff --git a/setup.sh b/setup.sh\n--- a/setup.sh\n+++ b/setup.sh\n@@ -221,7 +221,8 @@\n run-parts /etc/update-motd.d/\n \n # HWE\n-apt install --install-recommends \"linux-generic-hwe-${UBUNTU_VERSION}\" -y\n+UBUNTU_VERSION_NO_DOT=\"${UBUNTU_VERSION//./}\"\n+apt install --install-recommends \"linux-generic-hwe-${UBUNTU_VERSION_NO_DOT}\" -y\n \n # Update & Upgrade\n apt update --allow-releaseinfo-change -y\n"}]},{"message":"Using 'shutdown -r now' may not give users enough time to save their work or prepare for the restart, despite the 10-second sleep. Consider using 'shutdown -r +1' to provide a proper system-wide warning that can be cancelled if needed.","fixFiles":[{"filePath":"setup.sh","diff":"diff --git a/setup.sh b/setup.sh\n--- a/setup.sh\n+++ b/setup.sh\n@@ -248,4 +248,4 @@\n echo \"Server will restart in 10 seconds\"\n sleep 10\n echo \"Restarting...\"\n-shutdown -r now\n+shutdown -r +1\n"}]}]

Copilot AI changed the title [WIP] Fix installation issues by adding wget and updating UBUNTU_VERSION fix(setup.sh): Add wget to core_packages, fix HWE package name, use shutdown -r +1 May 2, 2026
Copilot AI requested a review from PDowney May 2, 2026 06:19
Copilot finished work on behalf of PDowney May 2, 2026 06:19
@github-actions

github-actions Bot commented May 2, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@sonarqubecloud

sonarqubecloud Bot commented May 2, 2026

Copy link
Copy Markdown

@PDowney
PDowney marked this pull request as ready for review May 2, 2026 07:40
Copilot AI review requested due to automatic review settings May 2, 2026 07:40
@PDowney
PDowney merged commit 97bd929 into master May 2, 2026
11 checks passed
@github-actions
github-actions Bot deleted the copilot/fix-wget-and-ubuntu-version-issues branch May 2, 2026 07:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes several first-run reliability issues in setup.sh, the bootstrap script that prepares a fresh Ubuntu host to run EngineScript.

Changes:

  • Adds wget to core_packages so the required-command validation doesn’t fail on minimal images.
  • Adjusts the HWE kernel meta-package install command to use a dotless Ubuntu version string.
  • Changes the reboot behavior to shutdown -r +1 and updates the accompanying user-facing message.

Comment thread setup.sh
"apt" "bash" "boxes" "cron" "coreutils" "curl" "dos2unix" "git" "gzip" "nano"
"needrestart" "openssl" "pwgen" "sed" "software-properties-common" "tar"
"tzdata" "unattended-upgrades" "unzip" "zip"
"tzdata" "unattended-upgrades" "unzip" "wget" "zip"
Comment thread setup.sh
Comment on lines +224 to +225
UBUNTU_VERSION_NO_DOT="${UBUNTU_VERSION//./}"
apt install --install-recommends "linux-generic-hwe-${UBUNTU_VERSION_NO_DOT}" -y
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.

3 participants