In CompUnit::Repository::Installation§

See primary documentation in context for method install

method install(Distribution $distributionBool :$force)

Copies modules into a special location so that they can be loaded afterwards.

:$force will allow installing over an existing distribution that has the same name, auth, api, and ver. Otherwise such a situation will result in Failure.

my $inst-repo = CompUnit::RepositoryRegistry.repository-for-name("site");
my $dist = Distribution::Path.new(...);
$inst-repo.install($dist);