This install guide assumes that you have already followed my Vagrant/VirtualBox Guide and have it running successfully.
This way is much, much faster, than using the snapd approach, but requires manually updating Hugo release download and install commands.
Open the “Vagrant” file that was created in the directory and add the below content and save:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provision :shell, path: "bootstrap-ubuntu.sh"
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
echo INSTALLING PACKAGE: tree------------------------------.
apt-get install tree -y
# List of releases: https://github.com/gohugoio/hugo/releases
# "sudo apt-get -y install hugo" doesn't grab the latest release.
# Replace the https link with the newest version if desired; at the time of this writing it was on 69.2
# So, at the time of this writing, you'd update the commands below:
# First, you'd replace the 'wget' link with: https://github.com/gohugoio/hugo/releases/download/v0.69.2/hugo_0.69.2_Linux-64bit.deb
# And then update the 'dpkg' command with the correct .deb version name.
echo INSTALLING PACKAGE: hugo------------------------------.
wget https://github.com/gohugoio/hugo/releases/download/v0.57.2/hugo_0.57.2_Linux-64bit.deb
sudo dpkg -i hugo_0.57.2_Linux-64bit.deb
SHELL
end
Next, in the same directory ensure a script file named “bootstrap-ubuntu.sh” exists and has:
#!/usr/bin/env bash
echo UPDATE: base machine------------------------------.
apt-get update
Having it setup this way allows for some flexibility in configuring the machine. You can run shell commands within the Vagrant file and/or have a bash script run.
Now, from that directory run:
vagrant status
For a clean install run:
vagrant destroy
Then run:
vagrant up
Instead of running vagrant destroy/up, you can also try to run the new commands with provision:
vagrant provision
This should install the supplied version of Hugo. Log into the machine with:
vagrant ssh
You should now be in the command window for the actual virtual machine. Run the “hugo version” command to ensure that it was installed successfully:
hugo version
That is it; you are now ready to create some awesome static sites with ease! As always, stay inb8a!