Skip to content

Commit

Permalink
install epel-release if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
samruddhikhandale committed Aug 8, 2023
1 parent c361e90 commit 4eaed70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common-utils/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "common-utils",
"version": "2.0.11",
"version": "2.0.12",
"name": "Common Utilities",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/common-utils",
"description": "Installs a set of common command line utilities, Oh My Zsh!, and sets up a non-root user.",
Expand Down
12 changes: 9 additions & 3 deletions src/common-utils/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ install_redhat_packages() {
man-db \
strace"

local install_cmd=dnf
if ! type dnf > /dev/null 2>&1; then
install_cmd=yum
fi

# rockylinux:9 installs 'curl-minimal' which clashes with 'curl'
# Install 'curl' for every OS except this rockylinux:9
if [[ "${ID}" = "rocky" ]] && [[ "${VERSION}" != *"9."* ]]; then
Expand All @@ -200,10 +205,11 @@ install_redhat_packages() {
package_list="${package_list} zsh"
fi

local install_cmd=dnf
if ! type dnf > /dev/null 2>&1; then
install_cmd=yum
# Install EPEL repository if needed (required to install 'jq' for CentOS)
if ! ${install_cmd} -q list jq >/dev/null 2>&1; then
${install_cmd} -y install epel-release
fi

${install_cmd} -y install ${package_list}

# Get to latest versions of all packages
Expand Down

0 comments on commit 4eaed70

Please sign in to comment.