GRASS logo

Note: A new GRASS GIS stable version has been released: GRASS GIS 7.4, available here.
Updated manual page: here


g.extension - Maintains GRASS Addons extensions in local GRASS installation.
Downloads, installs extensions from GRASS Addons SVN repository into local GRASS installation or removes installed extensions.


general, installation, extensions


g.extension --help
g.extension [-lcgasdift] extension=name operation=string [svnurl=url] [prefix=path] [proxy=proxy[,proxy,...]] [--help] [--verbose] [--quiet] [--ui]


List available extensions in the GRASS Addons SVN repository
List available extensions in the GRASS Addons SVN repository including module description
List available extensions in the GRASS Addons SVN repository (shell script style)
List locally installed extensions
Install system-wide (may need system administrator rights)
Download source code and exit
Do not install new extension, just compile it
Force removal when uninstalling extension (operation=remove)
Operate on toolboxes instead of single modules (experimental)
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


extension=name [required]
Name of extension to install or remove
Name of toolbox (set of extensions) when -t flag is given
operation=string [required]
Operation to be performed
Options: add, remove
Default: add
SVN Addons repository URL
Prefix where to install extension (ignored when flag -s is given)
Set the proxy with: "http=<value>,ftp=<value>"

Table of contents


g.extension downloads and installs, removes or updates extensions (addons) from the official GRASS GIS Addons repository or from user-specified source code repositories into the local GRASS GIS installation.

Two types of extensions are supported:

Managing installed extensions

Re-running g.extension on an installed GRASS GIS Addon extension re-installs the requested extension which may include updates.

To bulk-update all locally installed GRASS GIS extensions, g.extension.all module is available.

Where the extensions are installed

GRASS GIS extensions are installed by g.extension into a dedicated directory. The default is a directory for application data and settings inside the user's home directory. On GNU/Linux it is $HOME/.grass7/addons, on MS-Windows it is $APPDATA\GRASS7\addons. The name of the directory is stored in the GRASS_ADDON_BASE environmental variable.

The flag -s changes this install target directory to the GRASS GIS installation directory (determined by GISBASE environmental variable, e.g. /usr/) rather than the default directory defined as per GRASS_ADDON_BASE (see also documentation for variables). g.extension checks if the user has permission to write to GISBASE or GRASS_ADDON_BASE.

The place where the extensions are installed can be customized by the option prefix. Ensuring that these extensions will be accessible in GRASS GIS is in this case in the responsibility of the user.

Compilation and installation

On MS-Windows systems, where compilation tools are typically not readily locally installed, g.extension downloads a precompiled executable from the GRASS GIS project server. On all other operating systems where it is not difficult to install compilation tools, g.extension downloads the source code of the requested extension (addon) and compiles it locally. This applies for both C and Python modules as well as any other extensions. The reason is that more things such as manual page are compiled, not only the source code (which is really necessary to compile just in case of C).


Download and install of an extension

Download and install into current GRASS installation
This installs the extension from the official repository. For convenience, a shorter syntax can be used:

Download and install of an extension when behind a proxy

Example for an open http proxy:
# syntax: http://proxyurl:proxyport
g.extension proxy=""

Example for a proxy with proxy authentication:

# syntax: http://username:password@proxyurl:proxyport
g.extension proxy=""

Managing the extensions

List all available extensions in the official GRASS GIS Addons repository:
g.extension -l
List all locally installed extensions:
g.extension -a
Removal of a locally installed extension:
g.extension operation=remove


Since extensions have to be compiled on Unix based systems (Linux, Mac OSX etc.) unless a Python extension is installed, a full compiler environment must be present on the user's computer.

ERROR: Please install GRASS development package

While GRASS GIS is available on the user's computer, the respective development package is lacking. If GRASS was installed from a (Linux) repository, also the grass-dev* package (commonly named "grass-dev" or "grass-devel", sometimes along with the version number) must be installed.



GRASS GIS 7 Addons Manual pages
GRASS Addons wiki page.


Markus Neteler (original shell script)
Martin Landa, Czech Technical University in Prague, Czech Republic (Python rewrite)

Last changed: $Date: 2017-01-05 00:52:13 -0800 (Thu, 05 Jan 2017) $


Available at: g.extension source code (history)

Note: A new GRASS GIS stable version has been released: GRASS GIS 7.4, available here.
Updated manual page: here

Main index | General index | Topics index | Keywords index | Full index

© 2003-2018 GRASS Development Team, GRASS GIS 7.0.7svn Reference Manual