pkg
ARES System Manual: pkg Package Manager

pkg is a backend program that assists ax in managing installed software. Quite unlike the _xanadu-client package manager in Companion, pkg is designed to rely heavily on the input shell for sequencing commands.

IMPORTANT: Every AX package is a shell script with full execution privileges. Never install packages from servers or creators you don't recognize.


User Commands

pkg index: updates the index of package metadata

Control Commands

pkg local [<package>]: lists versions of installed packages
pkg clean: delete all .parc, .sparc, .pkg, and .spkg files from local memory
pkg open <archive>: opens a package archive (rezzes an object from the unit's inventory), retrieving it first from a server in the region if it is not found
pkg close|detach <archive>: closes a package archive (sends the rezzed object a command to self-destruct)
pkg extract <archive> <file>: copies <file> from <archive> to the local filesystem (ring 3) (instructs the rezzed object to send the file)
pkg inject <archive> <file>: copies <file> from the local filesystem (ring 3) to <archive> (archive must be rezzed; PARC version 2.0 and later only)
pkg erase <archive> <file>: removes <file> from <archive> (archive must be rezzed; PARC version 2.0 and later only)
pkg list <archive>: lists files in <archive> (archive must be rezzed; PARC version 2.0 and later only)
pkg sideload|attach <archive>: searches for a package archive that is already attached to your avatar (see Sideloading, below)


Managing Packages

Once a package is downloaded, you may run it with do <package>.pkg as with other shell scripts. Standard package scripts provide actions, which are read as command-line arguments:

- do <package>.pkg install: Installs the package from scratch.
- do <package>.pkg remove: Removes the package's files and deletes any associated settings.
- do <package>.pkg reinstall: Removes the package's files, then installs them again.
- do <package>.pkg update: Removes the package's files without removing settings. This is also known as 'prepping' or 'preparing' a package for installing an upgrade.
- do <package>.pkg cache: Downloads the package archive so that the installation may be completed later.
- do <package>.pkg uncache: Removes the package archive and the package.

During both remove and update, the package file and script are deleted. To upgrade a package to a new version, use update to remove the old version and then install to add the new version.

The settings... > software... > downloaded... menu can be used to the same effect.


Creating New Packages

The package sample.pkg is available from official NS servers. It provides instructions, as well as a template package archive (sample.ax.parc) and minimal example application, which can be used to create and package your own software.

The ARES SDK contains a number of header files which are required to create ARES programs. Visit http://develop.nanite-systems.com/ for information on ARES application development.

Make sure you fully understand the ARES software copyright license (see license) before distributing your work.


Sideloading

The pkg sideload command is equivalent to pkg open and only prepares the attached package for installation; to complete the installation process you will still need to type the relevant pkg extract commands (or have a script do it for you).

However, if the package archive's filename ends in .sparc, then it is (probably) a self-extracting package archive that will autonomously complete the installation process without guidance from ARES.

Sideloading SPARCs is the standard method of distribution for unbundled ARES software products, like Sexuality and Warrior.


Repacking

Most packages are created by using the typical SL tools to edit the contents of the PARC, but you can also use pkg's inject, erase, and list commands. This is convenient if you have many files in your package but only need to update a few.

However, be aware that there is no way to put a rezzed object back into the file system of your ARES installation. To repack, you must first sideload the package from your own inventory, NOT open it from ARES. Otherwise any changes will be lost!

Repacking is only possible with PARC 2.0 (compiled Nov 12 2023) and later. The original PARC 1.0 files (compiled Jun 23 2023) cannot be modified this way. SPARCs cannot be repacked.