使用Vagrantfile将Cabal安装在根目录而不是/ home / vagrant目录中

编程入门 行业动态 更新时间:2024-10-26 15:26:04
本文介绍了使用Vagrantfile将Cabal安装在根目录而不是/ home / vagrant目录中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 下面是流浪文件的内容。当我运行 vagrant up 命令时,它会根据需要安装cabal,但它位于根目录中。因此,它变得不可用。我想使用 cabal update 将cabal版本更新到最新版本。但是它没有发生。

最后,在我的虚拟机中,我有旧版本的cabal,它带有 haskell-platform

==>默认:设置haskell-platform(2013.2.0.0.debian3)... ==>默认值:处理libc-bin(2.19-0ubuntu6.6)的触发器... ==>默认值:******************************** ==>默认:配置文件路径源是默认配置文件。 ==>默认:配置文件/root/.cabal/config找不到。 ==>默认:将默认配置写入/root/.cabal/config ==> default:从hackage.haskell下载最新的软件包列表 ==>默认值:******************************** ==>默认值:解决依赖关系... ==>默认:正在下载binary-0.7.6.1 ... ==>默认值:配置二进制-0.7.6.1 ... ==>默认值:构建二进制-0.7.6.1 ... ==>默认值:预处理流浪汉FILE低于库二进制0.7.6.1 ...

内容:

Vagrant.configure(2)do | config | config.vm.box = Ubuntu的/ trusty32 config.vm.box_check_update =假 config.vm.provider VirtualBox的 做| VB | vb.gui =真 vb.memory = 2048 端 config.vm.provision 壳,内联:其中;< - 壳 cd / home / vagrant sudo apt-get update echo-------------------------- --- echo----------------------------- sudo apt-get -y安装拉链 sudo易于得到-y安装的git sudo易于得到-y安装建立必要的 sudo易于得到-y安装libmakefile解析器-perl的 sudo易于-get -y install libreoffice-dev sudo apt-get -y install haskell-platform echo****************** ************** cabal update echo******************* ************* cabal install cabal-install echo+++++++++++ ====== ==== ++++ ===== #echoPATH = / home / vagrant / .cabal / bin:$ PATH>> /home/vagrant/.bashrc SHELL

解决方案

我个人有更多的运气配置流浪汉,但如果你想这样做,你有没有尝试过:

sudo -u vagrant cabal install cabal-install

THe below is the content of the vagrant file. When I run vagrant up command, it installs cabal as required but it is in the root directory. Hence, it becomes unusable. I want to update the cabal version to latest version using cabal update. But it is not happening.

Finally, in my VM, I have old version of cabal which comes with haskell-platform which is of no use to me. However, when I execute these commands separately by explicitly logging into VM, and not putting anything in Vagrantfile, it works and I get cabal version 1.22.6.0 which is what I need, but by using Vagrantfile. How do I make sure that cabal is not getting installed in the root directory ? Instead I think it should get installed in the /home/vagrant directory like this: /home/vagrant/.cabal/bin

==> default: Setting up haskell-platform (2013.2.0.0.debian3) ... ==> default: Processing triggers for libc-bin (2.19-0ubuntu6.6) ... ==> default: ******************************** ==> default: Config file path source is default config file. ==> default: Config file /root/.cabal/config not found. ==> default: Writing default configuration to /root/.cabal/config ==> default: Downloading the latest package list from hackage.haskell ==> default: ******************************** ==> default: Resolving dependencies... ==> default: Downloading binary-0.7.6.1... ==> default: Configuring binary-0.7.6.1... ==> default: Building binary-0.7.6.1... ==> default: Preprocessing library binary-0.7.6.1...

CONTENTS OF VAGRANT FILE BELOW:

Vagrant.configure(2) do |config| config.vm.box = "ubuntu/trusty32" config.vm.box_check_update = false config.vm.provider "virtualbox" do |vb| vb.gui = true vb.memory = "2048" end config.vm.provision "shell", inline: <<-SHELL cd /home/vagrant sudo apt-get update echo "-----------------------------" echo "-----------------------------" sudo apt-get -y install zip sudo apt-get -y install git sudo apt-get -y install build-essential sudo apt-get -y install libmakefile-parser-perl sudo apt-get -y install libreoffice-dev sudo apt-get -y install haskell-platform echo " ********************************" cabal update echo " ********************************" cabal install cabal-install echo "+++++++++++==========++++=====" # echo "PATH=/home/vagrant/.cabal/bin:$PATH" >> /home/vagrant/.bashrc SHELL

解决方案

I've personally had more luck configuring vagrant with ansible, but if you wish to do it this way, have you tried:

sudo -u vagrant cabal install cabal-install

更多推荐

使用Vagrantfile将Cabal安装在根目录而不是/ home / vagrant目录中

本文发布于:2023-08-02 11:50:08,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:根目录   而不是   目录中   安装在   Cabal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!