Problem scenario
You want to use the same Bash script to install Apache Ant on CentOS/RedHat/Fedora, Debian/Ubuntu, or Linux SUSE. How do you install the latest version of Apache Ant on to any distribution of Linux?
Solution
Updated 4/8/21
With a “sudo bash” command, run a script with the following content (e.g., call the script below “installant.sh” and run “sudo bash installant.sh“):
#!/bin/bash
# Written by www.continualintegration.com
antversion=1.10.9 # Change this version as necessary
distro=$(cat /etc/*-release | grep NAME)
debflag=$(echo $distro | grep -i “ubuntu”)
if [ -z “$debflag” ]
then
…
Continue reading “How Do You Install the Latest Version of Apache Ant?”