code: def get_rpm_version(package_name):
      
      version_result = subprocess.run(["rpm", "-q", package_name],
                                      stdout=subprocess.PIPE,
                                      stderr=subprocess.PIPE)
      if version_result.returncode == 0:
          return version_result.stdout.decode().rstrip()
      else:
          return None
docs: Get a version of the package with 'rpm -q' command.