The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Util::Medley::Linux::PkgMgmt::YUM - Class for interacting with YUM

VERSION

version 0.054

SYNOPSIS

  my $yum = Util::Medley::Yum->new;
  
  #
  # positional  
  #
  $aref = $yum->repoList([$enabled], [$disabled]);
                        
  #
  # named pair
  #
  $aref = $yum->repoList([enabled  => 0|1],
                         [disabled => 0|1]); 
  
  $aref = $yum->repoQuery ([all       => 0|1],
                           [installed => 0|1],
                           [repoId    => $repoId]);

DESCRIPTION

A simple wrapper library for YUM on Linux.

ATTRIBUTES

none

METHODS

repoList

Generates a list of configured YUM repositories.

Returns: ArrayRef[HashRef]

Example HashRef:

  {
    repoBaseurl   "http://centos3.zswap.net/7.8.2003/updates/x86_64/ (9 more)",
    repoExpire    "21,600 second(s) (last: Tue Oct 13 12:14:28 2020)",
    repoId        "updates/7/x86_64",
    repoMirrors   "http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=vag",
    repoName      "CentOS-7 - Updates",
    repoPkgs      "1,104",
    repoSize      "5.4 G",
    repoStatus    "enabled",
    repoUpdated   "Mon Sep 14 08:18:15 2020"
  }
usage:
 $aref = $yum->repoList([$enabled], [$disabled]);

 $aref = $yum->repoList([enabled => 1],
                        [disabled => 0]);
 
args:
enabled [Bool] (optional)

Flag indicating the returned list should include enabled repos.

Default: 1

disabled [Bool] (optional)

Flag indicating the returned list should include disabled repos.

Default: 0

repoQuery

Captures the output from the 'repoquery' command.

Returns: ArrayRef[Str]

usage:
  $aref = $yum->repoQuery ([all       => 0|1],
                           [installed => 0|1],
                           [repoId    => $repoId]);

 Positional params not supported for this method due to
 the volume of options.
  
args:
all [Bool] (optional)

Equivalent to the --all flag on the cli.

Default: 0

installed [Bool] (optional)

Equivalent to the --installed flag on the cli.

Default: 0

repoId [Str] (optional)

Equivalent to the --repoid option on the cli.

list

Captures the output from the 'yum list' command.

Returns: ArrayRef[Str] or ArrayRef[HashRef]

usage:
  $aref = $yum->list ([installed => 0|1],
                      [repoId    => $repoId]);

 Positional params not supported for this method due to
 the volume of options.
  
args:
installed [Bool] (optional)

List only installed packages.

Default: 0

repoId [Str] (optional)

Limit the listing to this repo. This leverages 'repository-packages' under the hood.

useSudo [Bool] (optional)

If a repoId is provided and your running under a user other than root, you must use sudo privileges in order to run "yum repo-pkgs". Must be due to some "feature" I am not privy to.

parseOutput [Bool] (optional)

Indicates the caller wants the output parsed and put into a hashref.