I do understand the following script is installing the packages but what I don't understand is what packages:
for package in ${d[@]};
do
rpm -ivh --quiet ${!package} >/dev/null 2>&1
What is ${d[@]} ?
${d[@]} means all elements of array d.
It also means that whoever wrote that script didn't write it defensively, as they carelessly failed to double-quote it. The for loop should be written as:
for package in "${d[@]}";
so that each element of d is expanded as a separate word (i.e. argument to the for loop), no matter what it contains.
Without the double-quotes, the elements of d are subject to normal shell word-splitting and expansion (e.g. an element with a space in it will be treated as two arguments to the for loop, not one). See Why does my shell script choke on whitespace or other special characters? for more detailed explanations.
This might be OK in the context (i.e. if d contains only package names without spaces or other shell meta-characters) but is a bad habit for any shell programmer to indulge.
From man bash, under the section heading Arrays:
Any element of an array may be referenced using
${name[subscript]}. The braces are required to avoid conflicts with pathname expansion.If subscript is
@or*, the word expands to all members of name. These subscripts differ only when the word appears within double quotes.If the word is double-quoted,
${name[*]}expands to a single word with the value of each array member separated by the first character of the IFS special variable, and${name[@]}expands each element of name to a separate word. When there are no array members,${name[@]}expands to nothing.
(extra linefeeds to improve readability and some bolding for emphasis added by me)