5

Here is my bootstrap.sh:

#!/usr/bin/env bash

apt-get update
apt-get install -y apache2
apt-get install python-pip

if ! [ -L /var/www ]; then
  rm -rf /var/www
  ln -fs /vagrant /var/www
fi

Here is my Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "hashicorp/precise64"
  config.vm.provision :shell, path: "bootstrap.sh"
end

I ran

vagrant reload --provision
vagrant ssh

but when I type pip it returns

The program 'pip' is currently not installed. You can install it by typing: sudo apt-get install python-pip

I verified I was able to

sudo apt-get install library

in the ssh terminal, so I am not sure what is wrong.

Any help would be appreciated.

wogsland
  • 9,106
  • 19
  • 57
  • 93
testing
  • 2,303
  • 4
  • 20
  • 32
  • i guess it's installed, but for some reason is not added to path, so you can't invoke it by typing pip, check if it's really installed – midori Feb 04 '16 at 02:40
  • 3
    Try adding the `-y` flag to the command where you install `pip`, just like you have it for `apache2`, and provisioning again. This tells `apt-get` to assume "yes" for all questions, including "are you sure you want to install these packages". This flag is important for non-interactive APT use. – ChrisGPT was on strike Feb 04 '16 at 04:03

1 Answers1

7

Try replacing apt-get install python-pip with apt-get -y install python-pip as Chris already said in the comments.

Jeewes
  • 1,333
  • 2
  • 16
  • 18