The command-line tool
ifconfig
(from the 'net-tools' family) has been officially deprecated for years in favour of the
ip
tool (from the 'iproute2' family). But in practice, since most Linux distros included 'ifconfig' alongside 'ip', so it was not really very deprecated in practice. However, two recently released versions of major distros -
openSUSE Leap 15
, and
Ubuntu 18.04 LTS
- do not include ifconfig as part of the base installation anymore.
"So, who should care about that?". Well, if you want to install AS NetWeaver Abap Developer Edition, you might have been following either the SAP official guides (for openSUSE); or, (maybe unlikely) the unofficial rambling guide by me (for Ubuntu):
https://blogs.sap.com/2016/11/03/linux-for-newbies-installing-opensuse-on-oracle-virtualbox/
https://blogs.sap.com/2018/04/05/installing-sap-netweaver-developer-edition-on-an-ubuntu-desktop-vm-...
Now currently (early June 2018 - if the SAP provided script changes to deal with the issue, this blog will become a bit obsolete), so anyway currently, if your VM is Leap 15 or Ubuntu 18.04, your SAP installation script, called
install.sh
... will likely fail and exit, providing the error message:
./install.sh: line 77: ifconfig: command not found
So let's see what that line 77 in install.sh is doing:
myip=`ifconfig | egrep "inet addr" | grep Bcast | awk '{ print $2 }' | awk -F ":" '{ print $2 }'`
What happens in this line, is that the bash script tries to execute the 'ifconfig' command, and then parses the output from 'ifconfig' to find the IPv4 address of the host machine on the network. But since your OS (Leap15 or Ubuntu18) doesn't have the 'ifconfig' tool installed, so obviously that is why we get the error message telling us that "ifconfig: command not found".
I suppose there are 3 workarounds for this issue... let's go through them shall we? Ye-ehss we shall
🙂
After that, I give an example script that should cover both pre-2018 as well as 2018-onwards distros (openSUSE and Ubuntu - obviously I have not tested all possible Linux distros, that would be a job for an army not a hobbyist). So, the workarounds...
Workaround 1 - run the install.sh script with the option '-s'
So, remember that we always have to execute this script as the root user. Either by elevating ourselves to root, or by sudoing. 'sudo' is generally better practice, but here we will assume you have elevated yourself to root, e.g. by
$ sudo -i
...and you have moved into the relevant directory where the install.sh script is located. Then you can run the script with the "-s" option:
# ./install.sh -s
The "-s" option skips checking the validity of the hostname, so it skips over line 77. So that is the simple workaround... but you know, with a programming background, with a pedantic mentality, you...ok... I... we?... yes, we... we don't like any workaround that says "avoid executing that block of code, because it crashes"... and if there is code that helps you by checking up on your chosen hostname (and as it happens, also on your hosts file config), so IMAO the more checks we pass rather than avoid, the better the chances for a successful installation... and so, we come to the second workaround, which at first might seem quite neat, until we find out it is not quite ideal...
Workaround 2 - install the 'ifconfig'-program... and change the install.sh script
So the error message is saying that ifconfig isn't found... And that is correct. So in openSUSE Leap 15, we first locate the package we need:
$ cnf ifconfig