  
  [1X1 [33X[0;0YPackageManager[133X[101X
  
  [33X[0;0Y[5XPackageManager[105X  allows you to install and remove [5XGAP[105X packages on your system
  quickly and easily with a single command. The main functionality is provided
  by the following commands:[133X
  
  [30X    [33X[0;6Y[2XInstallPackage[102X  ([14X1.3-1[114X)  to install a package by its name, or by a URL
        to an archive, Git repository or package info file.[133X
  
  [30X    [33X[0;6Y[2XRemovePackage[102X ([14X1.3-2[114X) to remove a package by its name.[133X
  
  [30X    [33X[0;6Y[2XInstallRequiredPackages[102X  ([14X1.3-4[114X)  to install all the packages that [5XGAP[105X
        needs in order to run.[133X
  
  [33X[0;0YCompiling   the   package,   building   the  documentation,  and  installing
  dependencies are all handled automatically.[133X
  
  [33X[0;0YThe behaviour of [5XPackageManager[105X can be customised in various ways by setting
  appropriate user preferences, as described in Section [14X1.5[114X. These can also be
  overridden  for  a  single  call by adding an optional argument [3Xprefs[103X to the
  appropriate  function  call,  as  described  in  the  documentation  for the
  [2XInstallPackage[102X ([14X1.3-1[114X) command.[133X
  
  [33X[0;0YBy   default,  packages  will  be  installed  in  the  [10Xpkg[110X  subdirectory  of
  [10XGAPInfo.UserGapRoot[110X. To learn more, see Section [14X1.4[114X.[133X
  
  
  [1X1.1 [33X[0;0YBasic usage[133X[101X
  
  [33X[0;0Y[5XPackageManager[105X is distributed with [5XGAP[105X, so it should already be available on
  your system. If it is not already loaded, you can call it with:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XLoadPackage("PackageManager");[127X[104X
  [4X[32X[104X
  
  [33X[0;0YTo  install  the  latest  deposited version of the [5XDigraphs[105X package, use the
  following:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XInstallPackage("digraphs");[127X[104X
  [4X[32X[104X
  
  [33X[0;0YTo uninstall it later, use the following:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRemovePackage("digraphs");[127X[104X
  [4X[32X[104X
  
  [33X[0;0Y[5XPackageManager[105X  also  supports  version control repositories. To install the
  latest    version    of    the    curlInterface    package    from    GitHub
  ([7Xhttps://github.com/gap-packages/curlInterface.git[107X), use the following:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XInstallPackage("https://github.com/gap-packages/curlInterface.git");[127X[104X
  [4X[32X[104X
  
  
  [1X1.2 [33X[0;0YChanges in version 2.0[133X[101X
  
  [33X[0;0YPackageManager 2.0 introduced a range of new features, including the ability
  to download the structured info for the whole package distribution, and plan
  dependency trees in advance before installation begins. It also introduced a
  range  of  user  preferences,  which  are described under the [2XInstallPackage[102X
  ([14X1.3-1[114X) command below.[133X
  
  [33X[0;0YThe  following patterns are now deprecated, and may stop working in a future
  release:[133X
  
  [30X    [33X[0;6Y[10XInstallPackage(name, "mybranch")[110X where the second argument is the name
        of  a  branch  to  check  out  from  a  Git  repo. Instead you can use
        [10XInstallPackage(name, rec(branch := "mybranch"))[110X to specify a branch.[133X
  
  [30X    [33X[0;6Y[10XInstallPackage(name,  false)[110X  where  the  second argument is a boolean
        that can be set to [10Xfalse[110X to disable interactivity. Instead you can use
        [10XInstallPackage(name,    rec(interactive    :=   false))[110X   to   disable
        interactivity  for  this  call,  or  set  the  behaviour globally with
        [10XSetUserPreference("PackageManager", "interactive", false)[110X.[133X
  
  [30X    [33X[0;6Y[10XInstallPackage(name  :  keepDirectory)[110X  where the [10XkeepDirectory[110X option
        would  prevent  directories  from being deleted if installation fails.
        This is now the default behaviour, so no option is needed.[133X
  
  
  [1X1.3 [33X[0;0YCommands[133X[101X
  
  [1X1.3-1 InstallPackage[101X
  
  [33X[1;0Y[29X[2XInstallPackage[102X( [3Xstring[103X[, [3Xprefs[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X[133X
  
  [33X[0;0YAttempts  to download and install a package. The argument [3Xstring[103X should be a
  string containing one of the following:[133X
  
  [30X    [33X[0;6Ythe name of a package;[133X
  
  [30X    [33X[0;6Ythe URL of a package archive, ending in [10X.tar.gz[110X or [10X.tar.bz2[110X;[133X
  
  [30X    [33X[0;6Ythe URL of a git repository, usually ending in [10X.git[110X;[133X
  
  [30X    [33X[0;6Ythe URL of a valid [10XPackageInfo.g[110X file.[133X
  
  [33X[0;0YThe package will then be downloaded and installed, along with any additional
  packages  that  are required in order for it to be loaded. Its documentation
  will   also  be  built  if  necessary.  If  the  installation  is  completed
  successfully,  or  if  this  package is already installed, [9Xtrue[109X is returned;
  otherwise, [9Xfalse[109X is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XInstallPackage("digraphs");[127X[104X
    [4X[28X#I  The following packages will be installed:[128X[104X
    [4X[28X#I    Digraphs        1.15.0[128X[104X
    [4X[28X#I    IO              4.11.0[128X[104X
    [4X[28X#I    orb             5.1.0[128X[104X
    [4X[28X#I    datastructures  0.4.3[128X[104X
    [4X[28XContinue? [Y/n] y[128X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThis  command's behaviour is affected by the user preferences that have been
  set for the PackageManager package. These can be updated using, for example,
  [10XSetUserPreference("PackageManager",  "compile", true);[110X but these can also be
  overridden  for  this  call  by using the optional second argument [3Xprefs[103X for
  this function, for example [10XInstallPackage(name, rec(compile := false));[110X[133X
  
  [33X[0;0YThe available preferences are as follows:[133X
  
  [30X    [33X[0;6Y[10Xdependencies[110X - whether to install the package's dependencies as well[133X
  
  [30X    [33X[0;6Y[10Xsuggested[110X   -  whether  to  include  suggested  as  well  as  required
        dependencies[133X
  
  [30X    [33X[0;6Y[10Xcompile[110X - whether to attempt to compile newly installed packages[133X
  
  [30X    [33X[0;6Y[10XcompileDeps[110X  - whether to attempt to compile the dependencies of newly
        installed packages[133X
  
  [30X    [33X[0;6Y[10Xupgrade[110X  - whether to upgrade already installed packages if an upgrade
        is available[133X
  
  [30X    [33X[0;6Y[10Xgit[110X  -  whether  to  attempt  to  pull  any checked out Git repos when
        upgrading[133X
  
  [30X    [33X[0;6Y[10Xproceed[110X  -  whether  to  proceed  with  the installation at all (after
        printing the installation plan)[133X
  
  [30X    [33X[0;6Y[10Xinteractive[110X  -  set this to [10Xfalse[110X to disable all interactive prompting
        (preferences set to "ask" are instead treated as [10Xtrue[110X)[133X
  
  [30X    [33X[0;6Y[10XdistroLocation[110X - the URL to download the [5XGAP[105X package distribution info
        from[133X
  
  [30X    [33X[0;6Y[10XdistroVersion[110X  -  the  version of the package distribution info to use
        (choose a version of [5XGAP[105X, or just "latest")[133X
  
  [30X    [33X[0;6Y[10Xversion[110X - the version of a particular package to attempt to install[133X
  
  [30X    [33X[0;6Y[10Xbranch[110X  -  the name of the branch to attempt to install when cloning a
        Git repository (or [10Xfail[110X for the default branch)[133X
  
  [33X[0;0YAll  boolean  preferences  above (those described as "whether to...") can be
  set  to [10Xtrue[110X, [10Xfalse[110X, or "ask" which will prompt the user interactively. This
  is the default setting for many of them.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XInstallPackage("digraphs", rec(interactive := false,[127X[104X
    [4X[25X>[125X [27X                                  suggested := true,[127X[104X
    [4X[25X>[125X [27X                                  compileDeps := false));[127X[104X
    [4X[28X#I  The following packages will be installed:[128X[104X
    [4X[28X#I    Digraphs        1.15.0[128X[104X
    [4X[28X#I    IO              4.11.0[128X[104X
    [4X[28X#I    orb             5.1.0[128X[104X
    [4X[28X#I    datastructures  0.4.3[128X[104X
    [4X[28X#I    GRAPE           4.9.3[128X[104X
    [4X[28X#I    AutoDoc         2026.09.09[128X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [33X[0;0YTo  see  more information about the install process while it is ongoing, see
  [2XInfoPackageManager[102X ([14X1.6-1[114X).[133X
  
  [33X[0;0YIf  the [10Xversion[110X preference is specified, then it is interpreted as described
  in  Section  [14X'Reference:  Version Numbers'[114X. In particular, the value will be
  treated as a minimum version number unless it starts with [10X=[110X.[133X
  
  [33X[0;0YIf  installation  fails,  then any new directories that were created will be
  preserved. To remove them, the [2XRemovePackage[102X ([14X1.3-2[114X) operation can be used.[133X
  
  [1X1.3-2 RemovePackage[101X
  
  [33X[1;0Y[29X[2XRemovePackage[102X( [3Xname[103X[, [3Xprefs[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X[133X
  
  [33X[0;0YAttempts  to  remove an installed package using its name. The first argument
  [3Xname[103X  should  be  a string specifying the name of a package installed in the
  user [5XGAP[105X root (see [14X'Reference: GAP Root Directories'[114X).[133X
  
  [33X[0;0YThis  command's behaviour is affected by the user preferences that have been
  set for the PackageManager package. These can be set globally, or overridden
  for  this  command using the optional [3Xprefs[103X argument, in the same way as for
  the [2XInstallPackage[102X ([14X1.3-1[114X) command.[133X
  
  [33X[0;0YReturns [9Xtrue[109X if the removal was successful, and [9Xfalse[109X otherwise.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRemovePackage("digraphs");[127X[104X
    [4X[28XDelete directory /home/mtorpey/.gap/pkg/digraphs-1.15.0/ ? [Y/n] y[128X[104X
    [4X[28X#I  Removed directory /home/mtorpey/.gap/pkg/digraphs-1.15.0/[128X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X1.3-3 CompilePackage[101X
  
  [33X[1;0Y[29X[2XCompilePackage[102X( [3Xname[103X[, [3Xprefs[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X[133X
  
  [33X[0;0YAttempts  to  compile  an  installed package. Takes one argument [3Xname[103X, which
  should  be  a  string specifying the name of a package installed in the user
  [5XGAP[105X  root  (for  example,  one  installed using [2XInstallPackage[102X ([14X1.3-1[114X)). See
  [14X'Reference: GAP Root Directories'[114X.[133X
  
  [33X[0;0YCompilation is done automatically when a package is installed or updated, so
  in  most  cases  this  command  is  not needed. However, it may sometimes be
  necessary  to  recompile  some  packages  if  you  update  or  move your [5XGAP[105X
  installation.[133X
  
  [33X[0;0YCompilation  is  done  using  the  [10Xetc/BuildPackages.sh[110X  script bundled with
  [5XPackageManager[105X. If the specified package does not have a compiled component,
  this function should have no effect.[133X
  
  [33X[0;0YThis  command's behaviour is affected by the user preferences that have been
  set for the PackageManager package. These can be set globally, or overridden
  for  this  command using the optional [3Xprefs[103X argument, in the same way as for
  the [2XInstallPackage[102X ([14X1.3-1[114X) command.[133X
  
  [33X[0;0YReturns  [9Xtrue[109X  if  compilation  was  successful  or  if  no  compilation was
  necessary. Returns [9Xfalse[109X otherwise.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XCompilePackage("digraphs");[127X[104X
    [4X[28X#I  Running compilation script on /home/mtorpey/.gap/pkg/datastructures-0.4.3/ ...[128X[104X
    [4X[28X#I  Running compilation script on /home/mtorpey/.gap/pkg/orb-5.1.0/ ...[128X[104X
    [4X[28X#I  Running compilation script on /home/mtorpey/.gap/pkg/io-4.11.0/ ...[128X[104X
    [4X[28X#I  Running compilation script on /home/mtorpey/.gap/pkg/digraphs-1.15.0/ ...[128X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XCompilePackage("digraphs", rec(compileDeps := false));[127X[104X
    [4X[28X#I  Running compilation script on /home/mtorpey/.gap/pkg/digraphs-1.15.0/ ...[128X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X1.3-4 InstallRequiredPackages[101X
  
  [33X[1;0Y[29X[2XInstallRequiredPackages[102X( [[3Xprefs[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X[133X
  
  [33X[0;0YAttempts  to  download  and  install  the  latest  versions  of all packages
  required  for  [5XGAP[105X  to  run.  Currently  these packages are [5XGAPDoc[105X, [5XPerfGrp[105X,
  [5XPrimGrp[105X,  [5XSmallGrp[105X, and [5XTransGrp[105X. Returns [9Xfalse[109X if something went wrong, and
  [9Xtrue[109X otherwise.[133X
  
  [33X[0;0YIf  these  required  packages  are not currently installed, [5XGAP[105X can still be
  loaded  with  the [10X--bare[110X option, which is sufficient to allow [5XPackageManager[105X
  to be loaded and this command to be run.[133X
  
  [33X[0;0YThis  command's behaviour is affected by the user preferences that have been
  set for the PackageManager package. These can be set globally, or overridden
  for  this  command using the optional [3Xprefs[103X argument, in the same way as for
  the [2XInstallPackage[102X ([14X1.3-1[114X) command.[133X
  
  [1X1.3-5 UpdateAllPackages[101X
  
  [33X[1;0Y[29X[2XUpdateAllPackages[102X( [[3Xprefs[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X[133X
  
  [33X[0;0YAttempts  to  upgrade all packages to their latest version. Returns [9Xfalse[109X if
  something went wrong, and [9Xtrue[109X otherwise.[133X
  
  [33X[0;0YOnly packages in the directory managed by [5XPackageManager[105X will be considered.
  See Section [14X1.4[114X for more details.[133X
  
  [33X[0;0YThis  command's behaviour is affected by the user preferences that have been
  set for the PackageManager package. These can be set globally, or overridden
  for  this  command using the optional [3Xprefs[103X argument, in the same way as for
  the [2XInstallPackage[102X ([14X1.3-1[114X) command.[133X
  
  [1X1.3-6 RefreshPackageMetadata[101X
  
  [33X[1;0Y[29X[2XRefreshPackageMetadata[102X( [[3Xprefs[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfalse[109X[133X
  
  [33X[0;0YAttempts  to  download  metadata  for  all  available  packages from the [5XGAP[105X
  package distribution.[133X
  
  [33X[0;0YCalling  this  function  is  not  usually  necessary,  since the metadata is
  downloaded  automatically  the  first time [2XInstallPackage[102X ([14X1.3-1[114X) is called,
  and  the  result  is  cached  for the rest of the [5XGAP[105X session. However, this
  command  can  be  called  to  force  the  download  and retrieve any updated
  information,  which  may  be  useful,  for example, if the [10XdistroLocation[110X or
  [10XdistroVersion[110X user preferences have been changed, or if new package versions
  may  have  been  added  to  the  distribution  online since this [5XGAP[105X session
  started.[133X
  
  [33X[0;0YReturns [9Xfalse[109X if something went wrong, and [9Xtrue[109X otherwise.[133X
  
  [33X[0;0YThis  command's behaviour is affected by the user preferences that have been
  set for the PackageManager package. These can be set globally, or overridden
  for  this  command using the optional [3Xprefs[103X argument, in the same way as for
  the [2XInstallPackage[102X ([14X1.3-1[114X) command.[133X
  
  
  [1X1.4 [33X[0;0YDirectories[133X[101X
  
  [33X[0;0YBy   default,  packages  will  be  installed  in  the  [10Xpkg[110X  subdirectory  of
  [10XGAPInfo.UserGapRoot[110X  (see [14X'Reference: GAP Root Directories'[114X). Note that this
  location  is  not  the  default  user  pkg location on MacOS, but it will be
  created  on  any  system if not already present. Note also that starting [5XGAP[105X
  with the [10X-r[110X flag will cause all packages in this directory to be ignored.[133X
  
  [33X[0;0YTo manage a different directory, the following functions are available.[133X
  
  [1X1.4-1 DirectoryPackageManager[101X
  
  [33X[1;0Y[29X[2XDirectoryPackageManager[102X(  ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Ya directory object[133X
  
  [33X[0;0YReturns  the  directory  that  is currently being used by [5XPackageManager[105X for
  installing  and  removing  packages.  This is the only directory in the file
  system  where [5XPackageManager[105X will add, delete or modify any files. It can be
  modified using [2XChangeDirectoryPackageManager[102X ([14X1.4-2[114X).[133X
  
  [1X1.4-2 ChangeDirectoryPackageManager[101X
  
  [33X[1;0Y[29X[2XChangeDirectoryPackageManager[102X( [3Xpath[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10Y[9Xtrue[109X or [9Xfail[109X[133X
  
  [33X[0;0YChanges  the  directory  used  by [5XPackageManager[105X for installing and removing
  packages. See [2XDirectoryPackageManager[102X ([14X1.4-1[114X).[133X
  
  [33X[0;0YThe  argument [3Xpath[103X should be a string that represents a path to a directory.
  It will be created if it does not exist.[133X
  
  [33X[0;0YReturns [9Xtrue[109X on success and [9Xfail[109X on failure.[133X
  
  
  [1X1.5 [33X[0;0YUser Preferences[133X[101X
  
  [33X[0;0Y[5XPackageManager[105X  exposes  several  user  preferences  which  can  be  set  to
  customise the behaviour of the package globally. For example, calling[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XSetUserPreference("PackageManager", "compile", false);[127X[104X
  [4X[32X[104X
  
  [33X[0;0Ywill  make  it  so  that  new  packages  are not compiled automatically when
  [10XInstallPackage[110X  is  called  for  the  rest of the session. You could instead
  specify this as a one-off by passing a record to the command, as follows:[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XInstallPackage("digraphs", rec(compile := false));[127X[104X
  [4X[32X[104X
  
  [33X[0;0YYou   can  make  these  preferences  persist  between  sessions  by  calling
  [2XWriteGapIniFile[102X  ([14XReference:  WriteGapIniFile[114X)  and updating the settings in
  the [10Xgap.ini[110X file that is produced.[133X
  
  [33X[0;0YA  full  list  of user preferences recognised by the package is described in
  the documentation for [2XInstallPackage[102X ([14X1.3-1[114X).[133X
  
  
  [1X1.6 [33X[0;0YInfo Warnings[133X[101X
  
  [1X1.6-1 InfoPackageManager[101X
  
  [33X[1;0Y[29X[2XInfoPackageManager[102X [32X info class[133X
  
  [33X[0;0YInfo  class for the [5XPackageManager[105X package. Set this to the following levels
  for different levels of information:[133X
  
  [30X    [33X[0;6Y0 - No messages[133X
  
  [30X    [33X[0;6Y1  -  Problems  only:  messages  describing  what  went wrong, with no
        messages if an operation is successful[133X
  
  [30X    [33X[0;6Y2   -  Directories  and  versions:  also  displays  information  about
        installation directories and package versions[133X
  
  [30X    [33X[0;6Y3 - Progress: also shows step-by-step progress of operations[133X
  
  [30X    [33X[0;6Y4  -  All: includes extra information such as whether curlInterface is
        being used, package info validation and compilation output[133X
  
  [33X[0;0YSet this using, for example [10XSetInfoLevel(InfoPackageManager, 1)[110X. The default
  value is 3.[133X
  
