From 4c65c8a964696f0016f0bb5fc7820a49c8157801 Mon Sep 17 00:00:00 2001 From: bryan Date: Thu, 24 Apr 2025 16:18:23 -0400 Subject: [PATCH] Run package update after adding jammy --- installJRMC | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/installJRMC b/installJRMC index cf419ab..2a2d5c2 100755 --- a/installJRMC +++ b/installJRMC @@ -669,10 +669,7 @@ install_mc_repo() { debug "repo_text: $repo_text" sudo tee "$repo_file" &>/dev/null <<< "$repo_text" - if ! "${PKG_UPDATE[@]}"; then - err "Package update failed!" - return 1 - fi + "${PKG_UPDATE[@]}" || { err "Package update failed!"; return 1; } if ! install_package \ --no-install-check \ @@ -1019,20 +1016,20 @@ install_mc_deb() { # On Ubuntu 24.04+, add jammy repos for libwebkit2gtk-4.0-37 if [[ "$ID" == "ubuntu" ]]; then - major_version="${VERSION_ID%%.*}" - minor_version="${VERSION_ID##*.}" + local major_version="${VERSION_ID%%.*}" + local minor_version="${VERSION_ID##*.}" if (( major_version > 24 || (major_version == 24 && minor_version >= 4) )); then - repo_file="/etc/apt/sources.list.d/jammy.sources" - read -r -d '' repo_text <<-EOF + local repo_file="/etc/apt/sources.list.d/jammy.sources" + echo "Creating repository file $repo_file for jammy" + sudo bash -c "cat <<-EOF > $repo_file Types: deb URIs: https://archive.ubuntu.com/ubuntu Suites: jammy Components: main Architectures: $MC_ARCH Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg - EOF - echo "Creating repository file at $repo_file for jammy" - sudo tee "$repo_file" >/dev/null <<< "$repo_text" + EOF" + "${PKG_UPDATE[@]}" || err "Package update failed!" fi fi