[WIP] Fix issues in linux-dist-upgrade.sh script#28
Merged
wickedyoda merged 1 commit intomainfrom Nov 21, 2025
Merged
Conversation
Copilot stopped work on behalf of
wickedyoda due to an error
November 21, 2025 20:26
wickedyoda
approved these changes
Nov 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.
Original prompt
Problem: The newly added file updates_scripts/linux-dist-upgrade.sh in PR #27 contains diff artifacts and broken commands which prevent the repository from merging and the script from running. Specifically:
apt autopurgewhich is not a valid apt subcommand and will fail at runtime.Goal: Create a pull request that replaces the broken updates_scripts/linux-dist-upgrade.sh with a cleaned, tested script that removes diff artifacts, fixes the invalid autopurge call, and improves safety and robustness. The PR should include a clear commit message explaining the fixes.
Required changes (apply to updates_scripts/linux-dist-upgrade.sh):
set -euo pipefailand defensive variable defaults.apt autopurge -ywithapt-get -y --purge autoremove(orapt autoremove --purge -y) and avoid calling both autoremove and autopurge redundantly.New file content (exact replacement):
#!/bin/bash
set -euo pipefail
echo "=== Universal Dist-Upgrade Script ==="
Backup sources before doing anything
BACKUP_DATE=$(date +%F-%H%M)
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup."$BACKUP_DATE" 2>/dev/null || true
sudo mkdir -p /etc/apt/sources.list.d 2>/dev/null || true
sudo cp -r /etc/apt/sources.list.d /etc/apt/sources.list.d.backup."$BACKUP_DATE" 2>/dev/null || true
Detect OS + Version by sourcing /etc/os-release for robustness
if [ -f /etc/os-release ]; then
. /etc/os-release
else
echo "/etc/os-release not found; cannot detect OS."
exit 1
fi
ID=${ID:-}
VERSION_CODENAME=${VERSION_CODENAME:-}
UBUNTU_CODENAME=${UBUNTU_CODENAME:-$VERSION_CODENAME}
PRETTY=${PRETTY_NAME:-$NAME}
echo "Detected OS: $ID"
echo "Detected Version: $VERSION_CODENAME"
echo "Pretty Name: $PRETTY"
echo ""
###############################################################################
Debian Upgrade Path
###############################################################################
if [ "$ID" = "debian" ]; then
echo "=== Debian detected ==="
EOF
fi
###############################################################################
Ubuntu Upgrade Path
###############################################################################
if [ "$ID" = "ubuntu" ]; then
echo "=== Ubuntu detected ==="
EOF
fi
###############################################################################
Kali Linux Upgrade Path
###############################################################################
if [ "$ID" = "kali" ]; then
echo "=== Kali Rolling detected ==="
echo "Switching to latest Rolling repositories"
EOF
fi
#############################...
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.