forked from IBM/action-runner-image-pz
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure-dnf.sh
More file actions
executable file
·35 lines (28 loc) · 1.16 KB
/
Copy pathconfigure-dnf.sh
File metadata and controls
executable file
·35 lines (28 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash -e
################################################################################
## File: configure-dnf.sh
## Desc: Configure dnf/yum, install jq package, and improve package management behavior.
################################################################################
# Source the helpers for use with the script
# shellcheck disable=SC1091
source "$HELPER_SCRIPTS"/install.sh
# Enable retries for DNF (maximum retries set to 10)
# shellcheck disable=SC2129
echo "retries=10" >> /etc/dnf/dnf.conf
# Automatically assume 'yes' for prompts in DNF
echo "assumeyes=True" >> /etc/dnf/dnf.conf
# Configure DNF to always consider phased updates
echo "phased_updates=1" >> /etc/dnf/dnf.conf
# Fix potential bad proxy or HTTP headers settings
cat <<EOF >> /etc/dnf/dnf.conf
http_caching=none
EOF
# Remove unattended-upgrade equivalents if present (e.g., dnf-automatic)
dnf remove -y dnf-automatic
# Display DNF repository configurations
echo 'DNF/YUM repositories:'
dnf repolist
# Update repositories and install jq
install_dnfpkgs jq
# Optional: Configure parallel downloads to speed up package installation
echo "max_parallel_downloads=10" >> /etc/dnf/dnf.conf