Skip to content

Commit

Permalink
7.0.0-beta1 - Virtualmin 7 repos; Rocky and Alma support
Browse files Browse the repository at this point in the history
  • Loading branch information
iliajie committed May 11, 2021
1 parent 2e9c0d0 commit 63a4a2d
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions virtualmin-install.sh
Expand Up @@ -18,14 +18,14 @@
# License and version
SERIAL=GPL
KEY=GPL
VER=6.2.4
vm_version=6
VER=7.0.0-beta1
vm_version=7

# Currently supported systems:
supported=" CentOS/RHEL Linux 7, and 8 on x86_64
Rocky Linux 8 on x86_64
Debian 9, and 10 on i386 and amd64
Ubuntu 16.04 LTS, 18.04 LTS, and 20.04 LTS on i386 and amd64"
supported=" CentOS/RHEL Linux 7 and 8 on x86_64
Rocky and Alma Linux 8 on x86_64
Ubuntu 20.04 LTS on i386 and amd64

This comment has been minimized.

Copy link
@marclaporte

marclaporte May 24, 2021

Contributor

18.04 is not here

Debian 10 on i386 and amd64"

log=/root/virtualmin-install.log
skipyesno=0
Expand Down Expand Up @@ -329,7 +329,7 @@ log_fatal() {
remove_virtualmin_release () {
# shellcheck disable=SC2154
case "$os_type" in
"fedora" | "centos" | "rhel" | "amazon" | "rocky" )
"fedora" | "centos" | "rhel" | "amazon" | "rocky" | "almalinux" )
run_ok "rpm -e virtualmin-release" "Removing virtualmin-release"
;;
"debian" | "ubuntu" )
Expand Down Expand Up @@ -608,15 +608,15 @@ install_virtualmin_release () {
# Grab virtualmin-release from the server
log_debug "Configuring package manager for ${os_real} ${os_version}..."
case "$os_type" in
rhel|centos|fedora|amazon|rocky)
rhel|centos|rocky|almalinux|fedora|amazon)
case "$os_type" in
rhel|centos)
if [ "$os_major_version" -lt 7 ]; then
printf "${RED}${os_type} ${os_version} is not supported by this installer.${NORMAL}\\n"
exit 1
fi
;;
rocky)
rocky|almalinux)
if [ "$os_major_version" -lt 8 ]; then
printf "${RED}${os_type} ${os_version} is not supported by this installer.${NORMAL}\\n"
exit 1
Expand All @@ -629,13 +629,13 @@ install_virtualmin_release () {
fi
;;
ubuntu)
if [ "$os_version" != "16.04" ] && [ "$os_version" != "18.04" ] && [ "$os_version" != "20.04" ]; then
if [ "$os_version" != "18.04" ] && [ "$os_version" != "20.04" ]; then

This comment has been minimized.

Copy link
@marclaporte

marclaporte May 24, 2021

Contributor

18.04 is here.

This comment has been minimized.

Copy link
@iliajie

iliajie May 24, 2021

Author Contributor

This is intentional. We don't recommend installing it but stubborn user could still do it for an OS that hasn't reached EOL.

printf "${RED}${os_type} ${os_version} is not supported by this installer.${NORMAL}\\n"
exit 1
fi
;;
debian)
if [ "$os_major_version" -lt 9 ]; then
if [ "$os_major_version" -lt 10 ]; then
printf "${RED}${os_type} ${os_version} is not supported by this installer.${NORMAL}\\n"
exit 1
fi
Expand Down Expand Up @@ -669,11 +669,7 @@ install_virtualmin_release () {
install_group="yum -y --quiet groupinstall --setopt=group_package_types=mandatory,default"
install_config_manager="yum-config-manager"
fi
if [ "${os_type}" = "rocky" ]; then
download "https://${LOGIN}software.virtualmin.com/vm/${vm_version}/${repopath}centos/${os_major_version}/${arch}/virtualmin-release-latest.noarch.rpm"
else
download "https://${LOGIN}software.virtualmin.com/vm/${vm_version}/${repopath}${os_type}/${os_major_version}/${arch}/virtualmin-release-latest.noarch.rpm"
fi
download "https://${LOGIN}software.virtualmin.com/vm/${vm_version}/${repopath}${os_type}/${os_major_version}/${arch}/virtualmin-release-latest.noarch.rpm"
run_ok "rpm -U --replacepkgs --quiet virtualmin-release-latest.noarch.rpm" "Installing virtualmin-release package"
# XXX This weirdly only seems necessary on CentOS 8, but harmless
# elsewhere.
Expand Down Expand Up @@ -825,7 +821,7 @@ install_with_yum () {
download "https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
run_ok "rpm -U --replacepkgs --quiet epel-release-latest-7.noarch.rpm" "Installing EPEL 7 release package"
# install extras from EPEL and SCL
elif [ "$os_type" = "centos" ] || [ "$os_type" = "rocky" ]; then
elif [ "$os_type" = "centos" ] || [ "$os_type" = "rocky" ] || [ "$os_type" = "almalinux" ]; then
install_epel_release
if [ "$os_major_version" -lt 8 ]; then
# No SCL on CentOS 8
Expand All @@ -834,17 +830,18 @@ install_with_yum () {
fi

# Important Perl packages are now hidden in PowerTools repo
if [ "$os_major_version" -eq 8 ] && [ "$os_type" = "centos" ] || [ "$os_type" = "rocky" ]; then
if [ "$os_major_version" -eq 8 ] && [ "$os_type" = "centos" ] || [ "$os_type" = "rocky" ] || [ "$os_type" = "almalinux" ]; then
# Detect PowerTools repo name
powertools="PowerTools"
centos_stream=$(dnf repolist all | grep "^powertools")
if [ ! -z "$centos_stream" ]; then
powertools=$(dnf repolist all | grep "^powertools")
if [ ! -z "$powertools" ]; then
powertools="powertools"
else
powertools="PowerTools"
fi
run_ok "$install_config_manager --set-enabled $powertools" "Enabling PowerTools package repository"
fi

# XXX This is so stupid. Why does yum insist on extra commands?
# XXX This is so stupid. Why does yum insists on extra commands?
if [ "$os_major_version" -eq 7 ]; then
run_ok "yum --quiet groups mark install $rhgroup" "Marking $rhgroup for install"
run_ok "yum --quiet groups mark install $vmgroup" "Marking $vmgroup for install"
Expand Down Expand Up @@ -892,8 +889,6 @@ install_scl_php () {
run_ok "$install scl-utils" "Installing scl-utils"
if [ "${os_type}" = "centos" ]; then
run_ok "$install centos-release-scl" "Install Software Collections release package"
elif [ "${os_type}" = "rocky" ]; then
run_ok "$install rocky-release-scl" "Install Software Collections release package"
elif [ "${os_type}" = "rhel" ]; then
run_ok "$install_config_manager --enable rhel-server-rhscl-${os_major_version}-rpms" "Enabling Server Software Collection"
fi
Expand Down Expand Up @@ -958,7 +953,7 @@ disable_selinux () {

# Changes that are specific to OS
case "$os_type" in
"fedora" | "centos" | "rhel" | "amazon" | "rocky" )
"fedora" | "centos" | "rhel" | "amazon" | "rocky" | "almalinux" )
disable_selinux
;;
esac
Expand Down

0 comments on commit 63a4a2d

Please sign in to comment.