I finally found a solution to the ‘No version specified, and no candidate version available for php’ problem
According to this AskUbuntu answer, I need to run the following command to add more repository
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo apt-get update
To resolve it in the Chef way, I need this in my recipe:
include_recipe "ubuntu"
The ubuntu
recipe will replace the /etc/apt/sources.list
with this content:
#
# Ubuntu trusty - Generated by Chef
#
deb http://us.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
#
# Security updates
#
deb http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted universe multiverse