Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > b38d2da330d1936e5ab1307c039c4941 > files > 317

octave-doc-3.6.4-3.mga4.noarch.rpm

<html lang="en">
<head>
<title>Installing and Removing Packages - GNU Octave</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Octave">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Packages.html#Packages" title="Packages">
<link rel="next" href="Using-Packages.html#Using-Packages" title="Using Packages">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Installing-and-Removing-Packages"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Using-Packages.html#Using-Packages">Using Packages</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Packages.html#Packages">Packages</a>
<hr>
</div>

<h3 class="section">37.1 Installing and Removing Packages</h3>

<p>Assuming a package is available in the file <samp><span class="file">image-1.0.0.tar.gz</span></samp>
it can be installed from the Octave prompt with the command

<pre class="example">     pkg install image-1.0.0.tar.gz
</pre>
   <p class="noindent">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>To see which packages are installed type

<pre class="example">     pkg list
     -| Package Name  | Version | Installation directory
     -| --------------+---------+-----------------------
     -|        image *|   1.0.0 | /home/jwe/octave/image-1.0.0
</pre>
   <p class="noindent">In this case only version 1.0.0 of the <code>image</code> package is
installed.  The '*' character next to the package name shows that the
image package is loaded and ready for use.

   <p>It is possible to remove a package from the system using the
<code>pkg uninstall</code> command like this

<pre class="example">     pkg uninstall image
</pre>
   <p class="noindent">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>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><span class="option">-nodeps</span></samp> flag to the <code>pkg install</code>
command

<pre class="example">     pkg install -nodeps my_package_with_dependencies.tar.gz
</pre>
   <p class="noindent">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.

<!-- pkg scripts/pkg/pkg.m -->
   <p><a name="doc_002dpkg"></a>

<div class="defun">
&mdash; Command:  <b>pkg</b><var> command pkg_name<a name="index-pkg-3355"></a></var><br>
&mdash; Command:  <b>pkg</b><var> command option pkg_name<a name="index-pkg-3356"></a></var><br>
<blockquote><p>Manage packages (groups of add-on functions) for Octave.  Different actions
are available depending on the value of <var>command</var>.

        <p>Available commands:

          <dl>
<dt>&lsquo;<samp><span class="samp">install</span></samp>&rsquo;<dd>Install named packages.  For example,

          <pre class="example">               pkg install image-1.0.0.tar.gz
</pre>
          <p class="noindent">installs the package found in the file <samp><span class="file">image-1.0.0.tar.gz</span></samp>.

          <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

               <dl>
<dt><code>-nodeps</code><dd>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>

               <br><dt><code>-noauto</code><dd>The package manager will not automatically load the installed package
when starting Octave.  This overrides any setting within the package.

               <br><dt><code>-auto</code><dd>The package manager will automatically load the installed package when
starting Octave.  This overrides any setting within the package.

               <br><dt><code>-local</code><dd>A local installation (package available only to current user) is forced,
even if the user has system privileges.

               <br><dt><code>-global</code><dd>A global installation (package available to all users) is forced, even if
the user doesn't normally have system privileges.

               <br><dt><code>-forge</code><dd>Install a package directly from the Octave-Forge repository.  This
requires an internet connection and the cURL library.

               <br><dt><code>-verbose</code><dd>The package manager will print the output of all commands as
they are performed. 
</dl>

          <br><dt>&lsquo;<samp><span class="samp">update</span></samp>&rsquo;<dd>Check installed Octave-Forge packages against repository and update any
outdated items.  This requires an internet connection and the cURL library. 
Usage:

          <pre class="example">               pkg update
</pre>
          <br><dt>&lsquo;<samp><span class="samp">uninstall</span></samp>&rsquo;<dd>Uninstall named packages.  For example,

          <pre class="example">               pkg uninstall image
</pre>
          <p class="noindent">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><span class="option">-nodeps</span></samp> option.

          <br><dt>&lsquo;<samp><span class="samp">load</span></samp>&rsquo;<dd>Add named packages to the path.  After loading a package it is
possible to use the functions provided by the package.  For example,

          <pre class="example">               pkg load image
</pre>
          <p class="noindent">adds the <code>image</code> package to the path.  It is possible to load all
installed packages at once with the keyword &lsquo;<samp><span class="samp">all</span></samp>&rsquo;.  Usage:

          <pre class="example">               pkg load all
</pre>
          <br><dt>&lsquo;<samp><span class="samp">unload</span></samp>&rsquo;<dd>Remove named packages from the path.  After unloading a package it is
no longer possible to use the functions provided by the package.  It is
possible to unload all installed packages at once with the keyword
&lsquo;<samp><span class="samp">all</span></samp>&rsquo;.  Usage:

          <pre class="example">               pkg unload all
</pre>
          <br><dt>&lsquo;<samp><span class="samp">list</span></samp>&rsquo;<dd>Show the list of currently installed packages.  For example,

          <pre class="example">               installed_packages = pkg ("list")
</pre>
          <p class="noindent">returns a cell array containing a structure for each installed package.

          <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.

          <pre class="example">               [user_packages, system_packages] = pkg ("list")
</pre>
          <p>The option '-forge' lists packages available at the Octave-Forge repository. 
This requires an internet connection and the cURL library.  For example:

          <pre class="example">               oct_forge_pkgs = pkg ("list", "-forge")
</pre>
          <br><dt>&lsquo;<samp><span class="samp">describe</span></samp>&rsquo;<dd>Show a short description of the named installed packages, with the option
'-verbose' also list functions provided by the package.  For example,

          <pre class="example">               pkg describe -verbose all
</pre>
          <p class="noindent">will describe all installed packages and the functions they provide. 
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:

          <pre class="example">               desc = pkg ("describe", "secs1d", "image")
</pre>
          <p class="noindent">If any of the requested packages is not installed, pkg returns an
error, unless a second output is requested:

          <pre class="example">               [desc, flag] = pkg ("describe", "secs1d", "image")
</pre>
          <p class="noindent"><var>flag</var> will take one of the values "Not installed", "Loaded" or
"Not loaded" for each of the named packages.

          <br><dt>&lsquo;<samp><span class="samp">prefix</span></samp>&rsquo;<dd>Set the installation prefix directory.  For example,

          <pre class="example">               pkg prefix ~/my_octave_packages
</pre>
          <p class="noindent">sets the installation prefix to <samp><span class="file">~/my_octave_packages</span></samp>. 
Packages will be installed in this directory.

          <p>It is possible to get the current installation prefix by requesting an
output argument.  For example:

          <pre class="example">               pfx = pkg ("prefix")
</pre>
          <p>The location in which to install the architecture dependent files can be
independently specified with an addition argument.  For example:

          <pre class="example">               pkg prefix ~/my_octave_packages ~/my_arch_dep_pkgs
</pre>
          <br><dt>&lsquo;<samp><span class="samp">local_list</span></samp>&rsquo;<dd>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:

          <pre class="example">               pkg local_list ~/.octave_packages
</pre>
          <p>It is possible to get the current value of local_list with the following

          <pre class="example">               pkg local_list
</pre>
          <br><dt>&lsquo;<samp><span class="samp">global_list</span></samp>&rsquo;<dd>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:

          <pre class="example">               pkg global_list /usr/share/octave/octave_packages
</pre>
          <p>It is possible to get the current value of global_list with the following

          <pre class="example">               pkg global_list
</pre>
          <br><dt>&lsquo;<samp><span class="samp">build</span></samp>&rsquo;<dd>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

          <pre class="example">               pkg build builddir image-1.0.0.tar.gz ...
</pre>
          <p class="noindent">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><span class="option">-verbose</span></samp> and <samp><span class="option">-nodeps</span></samp> are respected, while
all other options are ignored.

          <br><dt>&lsquo;<samp><span class="samp">rebuild</span></samp>&rsquo;<dd>Rebuild the package database from the installed directories.  This can
be used in cases where the package database has been corrupted. 
It can also take the <samp><span class="option">-auto</span></samp> and <samp><span class="option">-noauto</span></samp> options to allow the
autoloading state of a package to be changed.  For example,

          <pre class="example">               pkg rebuild -noauto image
</pre>
          <p class="noindent">will remove the autoloading status of the image package.

        </dl>
        </p></blockquote></div>

   </body></html>