Let's use PackageManager to install the latest released version of the Digraphs package.
PackageInfo("digraphs")[1].Version;
"0.15.2"
LoadPackage("PackageManager");
true
InstallPackage("digraphs");
#I Getting PackageInfo URLs... #I Created directory /home/gap/.gap/ #I Created directory /home/gap/.gap/pkg/ #I Retrieving PackageInfo.g from https://gap-packages.github.io/Digraphs/PackageInfo.g ... #I PackageInfo.g validated successfully #I Downloading archive from URL https://github.com/gap-packages/Digraphs/releases/download/v0.15.4/digraphs-0.15.4.tar.gz ... #I Saved archive to /tmp/tmEju2st/digraphs-0.15.4.tar.gz #I Extracting to /home/gap/.gap/pkg/digraphs-0.15.4 ... #I Extracted successfully #I Running compilation script on /home/gap/.gap/pkg/digraphs-0.15.4 ... #I Compilation was successful #I Checking dependencies for Digraphs... #I io >=4.5.1: true #I orb >=4.8.2: true #I Running compilation script on /home/gap/.gap/pkg/digraphs-0.15.4 ... #I Compilation was successful
true
PackageInfo("digraphs")[1].Version;
"0.15.4"
LoadPackage("digraphs");
true
Digraph([[2], [3], [1]]);
<digraph with 3 vertices, 3 edges>
Next, let's remove that package (the second argument disables interactivity):
RemovePackage("digraphs", false);
#I Removed directory /home/gap/.gap/pkg/digraphs-0.15.4
true
We can install the latest development version of a package from Github:
LoadPackage("Memoisation");
#I memoisation package is not available. Check that the name is correct #I and it is present in one of the GAP root directories (see '??RootPaths')
fail
InstallPackage("https://github.com/gap-packages/Memoisation.git");
#I Cloning to /home/gap/.gap/pkg/Memoisation ... #I Package cloned successfully #I Checking dependencies for Memoisation... #I GAPDoc >= 1.6.1: true #I curlInterface >= 2.1: true #I io >= 4.0: true #I json >= 2.0: true #I crypting >= 0.8: true #I Running compilation script on /home/gap/.gap/pkg/Memoisation ... #I Compilation was successful
true
LoadPackage("Memoisation");
true
MemoisedFunction;
function( func, args... ) ... end
To keep our installed package up to date, we can use UpdatePackage
later:
UpdatePackage("Memoisation");
#I Pulling from git repository... #I git: Already up to date. #I Running compilation script on /home/gap/.gap/pkg/Memoisation ... #I Compilation was successful
true