openresty1.15.8.2版本opm包管理工具的使用

1、OpenResty1.15.8.2版本已经包含并默认安装了opm。所以你不需要自己安装opm,我们只需要做一个软连接就可以了。

2、进入openresty的bin目录下,可以看到opm
cd /usr/local/openresty/bin

[root@ZYL /]# cd /usr/local/openresty/bin/
[root@ZYL bin]# ls
md2pod.pl  nginx-xml2pod  openresty  opm  resty  restydoc  restydoc-index
[root@ZYL bin]# 

3、给opm做个软连接
ln -s pwd/opm /usr/local/bin/opm
非root用户需在软连接前加上sudo: sudo ln -s pwd/opm /usr/local/bin/opm

[root@ZYL bin]# ln -s `pwd`/opm  /usr/local/bin/opm

(如果软连接不成功,需要安装安装了perl-Digest-MD5后,问题即可解决。yum -y install perl-Digest-MD5)

查看是否连接成功:
opm --help

[root@ZYL bin]# opm --help
opm [options] command package...

Options:
    -h
    --help              Print this help.

    --install-dir=PATH  Install into the specified PATH directory instead of the system-wide
                        OpenResty installation tree containing this tool.

    --cwd               Install into the current working directory under ./resty_modules/
                        instead of the system-wide OpenResty installation tree containing
                        this tool.

Commands:
    build               Build from the current working directory a package tarball ready
                        for uploading to the server.

    clean ARGUMENT...   Do clean-up work. Currently the valid argument is "dist", which
                        cleans up the temporary files and directories created by the "build"
                        command.

    info PACKAGE...     Output the detailed information (or meta data) about the specified
                        packages.  Short package names like "lua-resty-lock" are acceptable.

    get PACKAGE...      Fetch and install the specified packages. Fully qualified package

显示如上,那么恭喜你连接成功了。

4、opm的使用
搜索指定软件包名称
opm search session

[root@ZYL bin]# opm search session
bungle/lua-resty-session                          Session Library for OpenResty - Flexible and Secure

搜索具有多个模式“lru”和“cache”的软件包名称和摘要。
opm search lru cache

[root@ZYL bin]# opm search lru cache
openresty/lua-resty-lrucache                      Lua-land LRU Cache based on LuaJIT FFI

附:
#show usage.
opm --help

#search package names and abstracts with the user pattern “lock”.
opm search lock

#search package names and abstracts with multiple patterns “lru” and “cache”.
opm search lru cache

#install a package named lua-resty-foo under the name of some_author
opm get some_author/lua-resty-foo

#get a list of lua-resty-foo packages under all authors.
opm get lua-resty-foo

#show the details of the installed package specified by name.
opm info lua-resty-foo

#show all the installed packages.
opm list

#upgrade package lua-resty-foo to the latest version.
opm upgrade lua-resty-foo

#update all the installed packages to their latest version.
opm update

#uninstall the newly installed package
opm remove lua-resty-foo

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值