使用 apt-get install luarocks 后无需重新登录即可安装 rocks

使用 apt-get install luarocks 后无需重新登录即可安装 rocks

我正在尝试编写一个安装脚本,该脚本需要安装 luarocks 和一些 rocks。

后:sudo apt-get -y install luarocks

但在我重新登录之前,如果我尝试:luarocks install loadcaffe

我明白了

Error: Your user does not have write permissions in /usr/local/lib/luarocks/rocks
-- you may want to run as a privileged user or use your local tree with --local.

如果我尝试以下两种方法之一:

luarocks --local install loadcaffe
sudo luarocks install loadcaffe

我得到:

Error: No results matching query were found.

重新登录后,一切如预期:

luarocks install loadcaffe

我已经尝试了两种方法source ~/.bashrctorch-activate直接运行,但都无法解决问题。

还尝试过:

  • bash -c luarocks install loadcaffe
  • screen luarocks install loadcaffe

答案1

您可以尝试用这个命令:

sudo luarocks --from=https://raw.githubusercontent.com/torch/rocks/master/ install loadcaffe

相关内容