I’ve built a server on precise64 box (Ubuntu 12) and now want to upgrade it to trusty64 (Ubuntu 14). Can I simply change the config.vm.box
from ubuntu/precise64
to ubuntu/trusty64
and then do a vagrant provision (or is it reload?), or will this potentially cause problems on my existing vm which has a lot of software installed on it already?
Can I simply change the
config.vm.box
fromubuntu/precise64
toubuntu/trusty64
and then do a vagrant provision (or is it reload?), or will this potentially cause problems on my existing vm which has a lot of software installed on it already?
Well, if you change the value from ubuntu/precise64
to ubuntu/trusty64
all that will do is indicate that if you destroy the existing Vagrant VM (via vagrant destroy [box name]
) and then rebuild it via vagrant up [box name]
that the new Vagrant box will be ubuntu/trusty64
. Meaning, you will not affect an OS upgrade of your existing boxes by simply changing the value of config.vm.box
.
If you want to upgrade your existing box to Ubuntu 14 from Ubuntu 12 without affecting already installed software on the the Ubuntu 12 install, you need to SSH into that Ubuntu 12 box and run this command to get the update manager core package installed:
sudo apt-get install update-manager-core
The run do-release-upgrade
to actually do the upgrade from Ubuntu 12 to Ubuntu 14:
sudo do-release-upgrade
That said, read my note at the bottom on how a clean upgrade from one major release of an OS to another is not as simple as you might think.
But that said, this is really not the way Vagrant should be upgraded or what it’s intended for. You are saying you have tons of software installed on the box, but if you installed those manually, you are not really leveraging Vagrant’s core strength: The ability to build, destroy and rebuild virtual machines on demand.
The way I use Vagrant is to have it build boxes but also run a provisioning script that can automate the process of software install and configuration.
But that said, when I had to upgrade my own Vagrant stuff from Ubuntu 12 to Ubuntu 14, I had to adjust my provisioning scripts to account for new items such as new file system locations, new versions of core software and such… Meaning, it’s not always a straightforward process and is highly dependent on what software you are using and what your specific configuration of that software is.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments