I have a shell script that checks for an internet connection (by pinging google) and then calls
yum install packageA packageB --assumeyes
How can I confirm that the packages have been installed (or already installed)? Am I making another yum call and analyzing the output (I suppose it is very difficult if the system is in a different language)?
Based on this random message , it looks like yum is returning an error code to the shell. You can verify this by running the command and then immediately (like the following command):
echo $?
. 0, - . , , .:)
, , , , , , :
, PACKAGES , , :
PACKAGES
yum -y install $PACKAGES
-y
rpm --query --queryformat "" $PACKAGES
package <name> is not installed
, PACKAGES , yum , , yum URL-, Provides:.
yum
Provides:
Using ping google.com does not guarantee that the yum repository you are trying to connect is accessible
Command to check if a package is installed: -
yum list installed PACKAGE_NAME