1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Administrating Packages (GNU Octave (version 10.3.0))</title>
<meta name="description" content="Administrating Packages (GNU Octave (version 10.3.0))">
<meta name="keywords" content="Administrating Packages (GNU Octave (version 10.3.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Packages.html" rel="up" title="Packages">
<link href="Creating-Packages.html" rel="next" title="Creating Packages">
<link href="Using-Packages.html" rel="prev" title="Using Packages">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
div.example {margin-left: 3.2em}
span:hover a.copiable-link {visibility: visible}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<div class="section-level-extent" id="Administrating-Packages">
<div class="nav-panel">
<p>
Next: <a href="Creating-Packages.html" accesskey="n" rel="next">Creating Packages</a>, Previous: <a href="Using-Packages.html" accesskey="p" rel="prev">Using Packages</a>, Up: <a href="Packages.html" accesskey="u" rel="up">Packages</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h3 class="section" id="Administrating-Packages-1"><span>37.3 Administrating Packages<a class="copiable-link" href="#Administrating-Packages-1"> ¶</a></span></h3>
<p>It is possible to make both per-user (local) and system-wide (global)
installations of a package. If the user performing the installation is
<code class="code">root</code> (or Administrator with elevated privileges on Windows), the
packages by default install in a system-wide directory that defaults to
<samp class="file"><var class="var">OCTAVE_HOME</var>/share/octave/packages/</samp>. If the user is not
<code class="code">root</code> (or Octave is running without elevated privileges),
packages are installed locally. The default installation directory for
local packages is
<samp class="file"><var class="var">user_data_dir</var>/octave/<var class="var">OCTAVE_API_VERSION</var>/packages</samp>.
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 <code class="code">pkg prefix</code>
command:
</p>
<div class="example">
<pre class="example-preformatted">pkg prefix new_installation_directory
</pre></div>
<p>The current installation directory can be retrieved by typing
</p>
<div class="example">
<pre class="example-preformatted">current_installation_directory = pkg ("prefix")
</pre></div>
<p>The package manager stores some information about the installed
packages in configuration files. For per-user (local) packages, this
information is stored in the file
<samp class="file"><var class="var">user_config_dir</var>/octave/<var class="var">OCTAVE_API_VERSION</var>/octave_packages</samp>
by default. For system-wide (global) installations, it is stored in
<samp class="file"><var class="var">OCTAVE_HOME</var>/share/octave/octave_packages</samp>. The path to the
per-user file can be changed with the <code class="code">pkg local_list</code> command:
</p>
<div class="example">
<pre class="example-preformatted">pkg local_list /path/to/new_file
</pre></div>
<p>For system-wide installations, this can be changed in the same way
using the <code class="code">pkg global_list</code> command. If these commands are called
without a new path, the current path will be returned. To retain these
settings between sessions, they can be set in one of the startup files,
see <a class="ref" href="Startup-Files.html">Startup Files</a>.
</p>
</div>
</body>
</html>
|