On UNIX-like systems it is possible to make both per-user and system-wide installations of a package. If the user performing the installation is root
the packages will be installed in a system-wide directory that defaults to OCTAVE_HOME/share/octave/packages/. If the user is not root
the default installation directory is ~/octave/. Packages will be installed in a subdirectory of the installation directory that will be named after the package. It is possible to change the installation directory by using the pkg prefix
command
pkg prefix new_installation_directory
The current installation directory can be retrieved by typing
current_installation_directory = pkg ("prefix")
To function properly the package manager needs to keep some information about the installed packages. For per-user packages this information is by default stored in the file ~/.octave_packages and for system-wide installations it is stored in OCTAVE_HOME/share/octave/octave_packages. The path to the per-user file can be changed with the pkg local_list
command
pkg local_list /path/to/new_file
For system-wide installations this can be changed in the same way using the pkg global_list
command. If these commands are called without a new path, the current path will be returned.
© 1996–2018 John W. Eaton
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://octave.org/doc/interpreter/Administrating-Packages.html