octave安装包pkg install命令及可选参数

两种方法

法一: 网上最多推荐的 pkg install -forge 包名,但没有成功 ,可能是公司无线网太不稳定
法二: http://octave.sourceforge.net/packages.php 找到需要的包并下载文件,cd切换到文件保存路径,pkg install 文件名即可,注意不要解压

pkg install 的可选参数

使用help pkg 查看pkg 的帮助信息,截取install的部分 ,看下法一和法二的不同:


   'install'
          Install named packages.  For example,

               pkg install image-1.0.0.tar.gz

          installs the package found in the file 'image-1.0.0.tar.gz'.
          The file containing the package can be an url, e.g.

               pkg install 'http://somewebsite.org/image-1.0.0.tar.gz'

          installs the package found in the given url.  This requires an
          internet connection and the cURL library.

          _Security risk_: no verification of the package is performed
          before the installation.  It has the same security issues as
          manually downloading the package from the given url and
          installing it.

          _No support_: the GNU Octave community is not responsible for
          packages installed from foreign sites.  For support or for
          reporting bugs you need to contact the maintainers of the
          installed package directly (see the 'DESCRIPTION' file of the
          package)

使用pkg install image-1.0.0.tar.gz来通过文件安装包。(即法二,所以明明这个方法在帮助文档的最前面为什么这么多人推荐用-forge?)
也可以写为一个url的形式,但需要网络连接。
存在的安全风险:在安装之间没有对包进行校验。其与手动从这个url下载包并安装,具有相同的安全问题。
不支持:GNU Octave 社区不对外部的网站下载的包负责,如果需要支持或需要提交bug,你须要直接联系这个包的维护者。

可选参数

          The OPTION variable can contain options that affect the manner
          in which a package is installed.  These options can be one or
          more of
          '-nodeps'
               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.  *Use this option with care.*

-nodeps 禁用依赖检查,即不检查包的依赖关系,即使当前安装的包的依赖包没有在系统中安装,这个包也会被安装。小心的使用这个option

          '-local'
               A local installation (package available only to current
               user) is forced, even if the user has system privileges.

-local 本地安装,仅为当前用户安装包,即使user 是管理员权限

          '-global'
               A global installation (package available to all users) is
               forced, even if the user doesn't normally have system
               privileges.

-global 全局(?)安装,为所有用户安装这个package,即使当前用户没有系统权限

          '-forge'
               Install a package directly from the Octave Forge
               repository.  This requires an internet connection and the
               cURL library.

               _Security risk_: 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.

-forge 直接从Octave 仓库中安装一个包,需要网络连接和cURL libarary
存在的安全风险:安装前没有进行校验。包没有签名和校验值来确认文件是否被正确下载。其与手动从Octave Forge 仓库 下载包并安装具有相同的安全问题。

          '-verbose'
               The package manager will print the output of all commands
               as they are performed.

-verbose 包管理器将会打印所有命令的输出,当他们被执行的时候(不知道能干什么用)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章