/usr/share/doc/octave/octave.html/Installing-and-Removing-Packages.html is in octave-doc 4.2.2-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Installing and Removing Packages (GNU Octave)</title>
<meta name="description" content="Installing and Removing Packages (GNU Octave)">
<meta name="keywords" content="Installing and Removing Packages (GNU Octave)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Packages.html#Packages" rel="up" title="Packages">
<link href="Using-Packages.html#Using-Packages" rel="next" title="Using Packages">
<link href="Packages.html#Packages" rel="prev" title="Packages">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<a name="Installing-and-Removing-Packages"></a>
<div class="header">
<p>
Next: <a href="Using-Packages.html#Using-Packages" accesskey="n" rel="next">Using Packages</a>, Up: <a href="Packages.html#Packages" 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#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Installing-and-Removing-Packages-1"></a>
<h3 class="section">37.1 Installing and Removing Packages</h3>
<p>Assuming a package is available in the file <samp>image-1.0.0.tar.gz</samp>
it can be installed from the Octave prompt with the command
</p>
<div class="example">
<pre class="example">pkg install image-1.0.0.tar.gz
</pre></div>
<p>If the package is installed successfully nothing will be printed on
the prompt, but if an error occurred during installation it will be
reported. It is possible to install several packages at once by
writing several package files after the <code>pkg install</code> command.
If a different version of the package is already installed it will
be removed prior to installing the new package. This makes it easy to
upgrade and downgrade the version of a package, but makes it
impossible to have several versions of the same package installed at
once.
</p>
<p>To see which packages are installed type
</p>
<div class="example">
<pre class="example">pkg list
-| Package Name | Version | Installation directory
-| --------------+---------+-----------------------
-| image *| 1.0.0 | /home/jwe/octave/image-1.0.0
</pre></div>
<p>In this case only version 1.0.0 of the <code>image</code> package is
installed. The <code>'*'</code> character next to the package name shows that the
image package is loaded and ready for use.
</p>
<p>It is possible to remove a package from the system using the
<code>pkg uninstall</code> command like this
</p>
<div class="example">
<pre class="example">pkg uninstall image
</pre></div>
<p>If the package is removed successfully nothing will be printed in the
prompt, but if an error occurred it will be reported. It should be
noted that the package file used for installation is not needed for
removal, and that only the package name as reported by <code>pkg list</code>
should be used when removing a package. It is possible to remove
several packages at once by writing several package names after the
<code>pkg uninstall</code> command.
</p>
<p>To minimize the amount of code duplication between packages it is
possible that one package depends on another one. If a package
depends on another, it will check if that package is installed
during installation. If it is not, an error will be reported and
the package will not be installed. This behavior can be disabled
by passing the <samp>-nodeps</samp> flag to the <code>pkg install</code>
command
</p>
<div class="example">
<pre class="example">pkg install -nodeps my_package_with_dependencies.tar.gz
</pre></div>
<p>Since the installed package expects its dependencies to be installed
it may not function correctly. Because of this it is not recommended
to disable dependency checking.
</p>
<a name="XREFpkg"></a><dl>
<dt><a name="index-pkg-1"></a>: <em></em> <strong>pkg</strong> <em><var>command</var> <var>pkg_name</var></em></dt>
<dt><a name="index-pkg-2"></a>: <em></em> <strong>pkg</strong> <em><var>command</var> <var>option</var> <var>pkg_name</var></em></dt>
<dt><a name="index-pkg-3"></a>: <em>[<var>out1</var>, …] =</em> <strong>pkg</strong> <em>(<var>command</var>, … )</em></dt>
<dd><p>Manage or query packages (groups of add-on functions) for Octave.
</p>
<p>Different actions are available depending on the value of <var>command</var>
and on return arguments.
</p>
<p>Available commands:
</p>
<dl compact="compact">
<dt>‘<samp>install</samp>’</dt>
<dd><p>Install named packages. For example,
</p>
<div class="example">
<pre class="example">pkg install image-1.0.0.tar.gz
</pre></div>
<p>installs the package found in the file <samp>image-1.0.0.tar.gz</samp>.
</p>
<p>The <var>option</var> variable can contain options that affect the manner
in which a package is installed. These options can be one or more of
</p>
<dl compact="compact">
<dt><code>-nodeps</code></dt>
<dd><p>The package manager will disable dependency checking. With this option it
is possible to install a package even when it depends on another package
which is not installed on the system. <strong>Use this option with care.</strong>
</p>
</dd>
<dt><code>-local</code></dt>
<dd><p>A local installation (package available only to current user) is forced,
even if the user has system privileges.
</p>
</dd>
<dt><code>-global</code></dt>
<dd><p>A global installation (package available to all users) is forced, even if
the user doesn’t normally have system privileges.
</p>
</dd>
<dt><code>-forge</code></dt>
<dd><p>Install a package directly from the Octave-Forge repository. This
requires an internet connection and the cURL library.
</p>
<p><em>Security risk</em>: no verification of the package is performed
before the installation. There are no signature for packages, or
checksums to confirm the correct file was downloaded. It has the
same security issues as manually downloading the package from the
Octave Forge repository and installing it.
</p>
</dd>
<dt><code>-verbose</code></dt>
<dd><p>The package manager will print the output of all commands as
they are performed.
</p></dd>
</dl>
</dd>
<dt>‘<samp>update</samp>’</dt>
<dd><p>Check installed Octave-Forge packages against repository and update any
outdated items. This requires an internet connection and the cURL library.
Usage:
</p>
<div class="example">
<pre class="example">pkg update
</pre></div>
</dd>
<dt>‘<samp>uninstall</samp>’</dt>
<dd><p>Uninstall named packages. For example,
</p>
<div class="example">
<pre class="example">pkg uninstall image
</pre></div>
<p>removes the <code>image</code> package from the system. If another installed
package depends on the <code>image</code> package an error will be issued.
The package can be uninstalled anyway by using the <samp>-nodeps</samp> option.
</p>
</dd>
<dt>‘<samp>load</samp>’</dt>
<dd><p>Add named packages to the path. After loading a package it is
possible to use the functions provided by the package. For example,
</p>
<div class="example">
<pre class="example">pkg load image
</pre></div>
<p>adds the <code>image</code> package to the path.
</p>
</dd>
<dt>‘<samp>unload</samp>’</dt>
<dd><p>Remove named packages from the path. After unloading a package it is
no longer possible to use the functions provided by the package.
</p>
</dd>
<dt>‘<samp>list</samp>’</dt>
<dd><p>Show the list of currently installed packages. For example,
</p>
<div class="example">
<pre class="example">pkg list
</pre></div>
<p>will produce a short report with the package name, version, and installation
directory for each installed package. Supply a package name to limit
reporting to a particular package. For example:
</p>
<div class="example">
<pre class="example">pkg list image
</pre></div>
<p>If a single return argument is requested then <code>pkg</code> returns a cell
array where each element is a structure with information on a single
package.
</p>
<div class="example">
<pre class="example">installed_packages = pkg ("list")
</pre></div>
<p>If two output arguments are requested <code>pkg</code> splits the list of
installed packages into those which were installed by the current user,
and those which were installed by the system administrator.
</p>
<div class="example">
<pre class="example">[user_packages, system_packages] = pkg ("list")
</pre></div>
<p>The <code>"-forge"</code> option lists packages available at the Octave-Forge
repository. This requires an internet connection and the cURL library.
For example:
</p>
<div class="example">
<pre class="example">oct_forge_pkgs = pkg ("list", "-forge")
</pre></div>
</dd>
<dt>‘<samp>describe</samp>’</dt>
<dd><p>Show a short description of installed packages. With the option
<code>"-verbose"</code> also list functions provided by the package. For
example,
</p>
<div class="example">
<pre class="example">pkg describe -verbose
</pre></div>
<p>will describe all installed packages and the functions they provide.
Display can be limited to a set of packages:
</p>
<div class="example">
<pre class="example">pkg describe control signal # describe control and signal packages
</pre></div>
<p>If one output is requested a cell of structure containing the
description and list of functions of each package is returned as
output rather than printed on screen:
</p>
<div class="example">
<pre class="example">desc = pkg ("describe", "secs1d", "image")
</pre></div>
<p>If any of the requested packages is not installed, <code>pkg</code> returns an
error, unless a second output is requested:
</p>
<div class="example">
<pre class="example">[desc, flag] = pkg ("describe", "secs1d", "image")
</pre></div>
<p><var>flag</var> will take one of the values <code>"Not installed"</code>,
<code>"Loaded"</code>, or
<code>"Not loaded"</code> for each of the named packages.
</p>
</dd>
<dt>‘<samp>prefix</samp>’</dt>
<dd><p>Set the installation prefix directory. For example,
</p>
<div class="example">
<pre class="example">pkg prefix ~/my_octave_packages
</pre></div>
<p>sets the installation prefix to <samp>~/my_octave_packages</samp>.
Packages will be installed in this directory.
</p>
<p>It is possible to get the current installation prefix by requesting an
output argument. For example:
</p>
<div class="example">
<pre class="example">pfx = pkg ("prefix")
</pre></div>
<p>The location in which to install the architecture dependent files can be
independently specified with an addition argument. For example:
</p>
<div class="example">
<pre class="example">pkg prefix ~/my_octave_packages ~/my_arch_dep_pkgs
</pre></div>
</dd>
<dt>‘<samp>local_list</samp>’</dt>
<dd><p>Set the file in which to look for information on locally
installed packages. Locally installed packages are those that are
available only to the current user. For example:
</p>
<div class="example">
<pre class="example">pkg local_list ~/.octave_packages
</pre></div>
<p>It is possible to get the current value of local_list with the following
</p>
<div class="example">
<pre class="example">pkg local_list
</pre></div>
</dd>
<dt>‘<samp>global_list</samp>’</dt>
<dd><p>Set the file in which to look for information on globally
installed packages. Globally installed packages are those that are
available to all users. For example:
</p>
<div class="example">
<pre class="example">pkg global_list /usr/share/octave/octave_packages
</pre></div>
<p>It is possible to get the current value of global_list with the following
</p>
<div class="example">
<pre class="example">pkg global_list
</pre></div>
</dd>
<dt>‘<samp>build</samp>’</dt>
<dd><p>Build a binary form of a package or packages. The binary file produced
will itself be an Octave package that can be installed normally with
<code>pkg</code>. The form of the command to build a binary package is
</p>
<div class="example">
<pre class="example">pkg build builddir image-1.0.0.tar.gz …
</pre></div>
<p>where <code>builddir</code> is the name of a directory where the temporary
installation will be produced and the binary packages will be found.
The options <samp>-verbose</samp> and <samp>-nodeps</samp> are respected, while
all other options are ignored.
</p>
</dd>
<dt>‘<samp>rebuild</samp>’</dt>
<dd><p>Rebuild the package database from the installed directories. This can
be used in cases where the package database has been corrupted.
</p>
</dd>
</dl>
<p><strong>See also:</strong> <a href="System-Information.html#XREFver">ver</a>, <a href="Getting-Help.html#XREFnews">news</a>.
</p></dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="Using-Packages.html#Using-Packages" accesskey="n" rel="next">Using Packages</a>, Up: <a href="Packages.html#Packages" 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#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|