12.2 SAGE package management commands

Module: sage.misc.package

SAGE package management commands

A SAGE package has the extension .spkg. It is a tarball that is (usually) bzip2 compressed that contains arbitrary data and an spkg-install file. An SAGE package typically has the following components:

Use the install_package command to install a new package, and use optional_packages to list all optional packages available on the central SAGE server. The upgrade command upgrades all standard packages - there is no auto-upgrade command for optional packages.

All package management can also be done via the SAGE command line.

Module-level Functions

experimental_packages( )

Return two lists. The first contains the installed and the second contains the not-installed experimental packages that are available from the SAGE repository. You must have an internet connection.

Output:

- installed experimental packages (as a list)
- NOT installed experimental packages (as a list)

Use install_package(package_name) to install or re-install a given package.

RELATED COMMANDS: install_package - list of all experimental packages upgrade - upgrade to latest version of core packages (experimental packages are not automatically upgraded).

install_package( [package=None], [force=False])

Install a package or return a list of all packages that have been installed into this SAGE install.

You must have an internet connection. Also, you will have to restart SAGE for the changes to take affect.

Input:

package
- optional; if specified, install the given package. If not, list all installed packages.

IMPLEMENTATION: calls 'sage -f'.

RELATED COMMANDS: optional_packages - list of all optional packages upgrade - upgrade to latest version of core packages (optional packages are not automatically upgraded).

is_package_installed( package)

Return true if a package starting with the given string is installed.

sage: is_package_installed('sage') 
True

optional_packages( )

Return two lists. The first contains the installed and the second contains the not-installed optional packages that are available from the SAGE repository. You must have an internet connection.

Output:

- installed optional packages (as a list)
- NOT installed optional packages (as a list)

Use install_package(package_name) to install or re-install a given package.

RELATED COMMANDS: install_package - list of all optional packages upgrade - upgrade to latest version of core packages (optional packages are not automatically upgraded).

package_mesg( package_name)

standard_packages( )

Return two lists. The first contains the installed and the second contains the not-installed standard packages that are available from the SAGE repository. You must have an internet connection.

Output:

- installed standard packages (as a list)
- NOT installed standard packages (as a list)

Use install_package(package_name) to install or re-install a given package.

RELATED COMMANDS: install_package - list of all standard packages upgrade - upgrade to latest version of core packages (standard packages are not automatically upgraded).

upgrade( )

Download and build the latest version of SAGE.

You must have an internet connection. Also, you will have to restart SAGE for the changes to take affect.

This upgrades to the latest version of core packages (optional packages are not automatically upgraded).

This will not work on systems that don't have a C compiler.

RELATED COMMANDS: install_package - list of all optional packages optional_packages - list of all optional packages

See About this document... for information on suggesting changes.