12

Is there a way to install a newer version than in the repository?

Ubuntu installs vagrant 1.4.3 at the moment, but I need at least 1.5

rubo77
  • 31,573
  • 49
  • 159
  • 281

5 Answers5

13

Check out the Vagrant downloads page. It has a 1.7.1 available.

EricM
  • 246
  • 2
  • 2
7

@rubo77's answer is good for a quick and dirty fix.

I prefer to upgrade single packages from future versions with a bit more finesse.

Advantages of this approach:

  • "apt-get upgrade" will track the vivid version of vagrant for security updates, bug fixes, etc.

  • Nothing will get updated to the vivid versions unless you specify [package-name]/vivid on the apt command-line

  • After this change, you don't have to back out the changes to the configs and you can easily get other packages from vivid on demand

First, set the pin preference to 99 (below the manual-install-only threshold) for the vivid release:

cat <<EOF | sudo tee /etc/apt/preferences.d/vivid-manual-only
Package: *
Pin: release n=vivid
Pin-Priority: 99
EOF

Second, create a repo sources file pointing to the vivid repos:

grep '\sutopic\s' /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/vivid.list
sudo sed 's/utopic/vivid/g' -i /etc/apt/sources.list.d/vivid.list

Now update the package indexes:

sudo apt-get update

At this point, apt-cache policy will show us that the system is aware of the package in the vivid repo, but will not automatically install any of them (because of the priority "99"):

ubuntu@ip-172-31-27-91:~$ apt-cache policy vagrant
vagrant:
  Installed: 1.4.3+dfsg1-1
  Candidate: 1.4.3+dfsg1-1
  Version table:
     1.6.5+dfsg1-2 0
        99 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ vivid/universe amd64 Packages
 *** 1.4.3+dfsg1-1 0
        500 http://us-east-1.ec2.archive.ubuntu.com/ubuntu/ utopic/universe amd64 Packages
ubuntu@ip-172-31-27-91:~$

Now you can install the more recent version manually with "apt-get install [package]/[release]:

sudo apt-get install vagrant/vivid
Steven K
  • 4,506
  • 22
  • 24
  • This looks fine, but why does it want to upgrade `phonon-backend-gstreamer phonon-backend-gstreamer-common` if i type `apt-get upgrade` now? before there were no updates on those – rubo77 Jan 06 '15 at 00:30
  • @rubo77 Not sure, try `apt-cache policy phonon-backend-gstreamer` and see which sources it's considering... – Steven K Jan 06 '15 at 00:34
  • it is trying to install those from vivid now, but not everything from vivid is installed. https://gist.github.com/rubo77/a339ab56d99156e81012 – rubo77 Jan 06 '15 at 00:42
  • Hmm, can you compare with this: https://gist.github.com/anonymous/d2861b070d3ff1c399cd ... for me, you can see the candidate for installation is 4.7.80 even though it's aware of 4.8.2 in the vivid repo, since the vivid priority is so low. – Steven K Jan 06 '15 at 00:43
  • I fixed it, I had some trusty sources for mariadb in my sources.list, so that wasn't replaced, I deleted them in `sources.list.d/vivid.list` and now it is like yours – rubo77 Jan 06 '15 at 00:53
  • I suspect it's because you have 4.7.80-0ubuntu2~ubuntu14.04 installed which is more recent than 4.7.80-0ubuntu1 in the utopic repo. I imagine you used to track the utopic-backports repository but now you don't? – Steven K Jan 06 '15 at 00:54
  • I see. Good catch @rubo77 – Steven K Jan 06 '15 at 00:55
  • But why does this source make this mehaviour? `deb http://mirror.netcologne.de/mariadb/repo/5.5/ubuntu trusty main ` – rubo77 Jan 06 '15 at 00:57
  • I think it's because the previously-installed version gets priority 100, matching the prio we set for vivid. Try changing the Pin-Priority in `/etc/apt/preferences.d/vivid-manual-only` from 100 to 99, I think that might help. I'll change my answer to recommend 99 instead of 100 in case other readers are tracking non-standard repos. – Steven K Jan 06 '15 at 01:10
  • but still there are some others with priority 100 now: https://gist.github.com/rubo77/b4923e3d339b5e786368 Also vivid backports is not useful in the `sed`'ed source file, maybe you shouldnnt use sed for the creation in your answer, or at least disable backports in the vivid.list – rubo77 Jan 06 '15 at 01:15
  • Let's do `n=vivid` instead of `a=vivid` in the vivid-manual-only file. Using `a=vivid` didn't work for ones with properties like `a=vivid-security`, but they all have `n=vivid` – Steven K Jan 06 '15 at 01:19
  • What about the backport sources? they do not seem useful in the vivid.list file – rubo77 Jan 06 '15 at 01:22
  • Yes, good point. I changed the `cp` to `grep` the original sources.list and use only the vanilla utopic lines (`utopic` with a space before and after, not matching utopic-backports or utopic-security) for the new sources file. How does that work for you? – Steven K Jan 06 '15 at 01:27
  • Not sure, but aren't there interesting packages in `vivid-security and vivid-updates`? – rubo77 Jan 06 '15 at 01:30
  • Tried this on 14.04.2 and it didn't work. `E: Release ‘vivid’ for ‘vagrant’ was not found` – Drew Noakes Jun 05 '15 at 17:11
  • Got it working by replacing `utopic` with `trusty`. – Drew Noakes Jun 05 '15 at 17:17
  • **Important note**: If you use the pinning on vivid packages, you will not be able to do a `do-release-upgrade` later. you have to delete that file before the upgrade, see http://askubuntu.com/questions/667500/no-updates-for-14-10/667503#667503 – rubo77 Aug 30 '15 at 21:50
  • Check your pin settings with `apt-cache policy` the distro with the highest priority is taken – rubo77 Feb 10 '16 at 09:08
3

Install vagrant from Ubuntu 15.04 beta by changing the sources to vivid for the install:

sudo sed 's/utopic/vivid/g' -i /etc/apt/sources.list 
sudo apt-get update
sudo apt-get install vagrant
sudo sed 's/vivid/utopic/g' -i /etc/apt/sources.list 
sudo apt-get update

This will install vagrant 1.6.5 at the moment

rubo77
  • 31,573
  • 49
  • 159
  • 281
2

I've created a repository at http://vagrant-deb.linestarve.com/ which provides the latest packages from vagrantup.com so you don't have to update manually.

These are the same files as on the Vagrant download page, just put into a repository.

Wolfgang
  • 220
  • 1
  • 6
  • 1
    It is very unlikely, that we should distrust you, but how would it be assured, that the code is still the same as the original? – rubo77 May 26 '16 at 17:44
  • @rubo77: The .deb files are copied directly from the Vagrant release page and should be byte-for-byte identical. Just compare the checksums from the Vagrant download page (e.g. [vagrant_1.8.1_SHA256SUMS](https://releases.hashicorp.com/vagrant/1.8.1/vagrant_1.8.1_SHA256SUMS)) against the .deb files in http://vagrant-deb.linestarve.com/pool/main/v/vagrant/. – Wolfgang May 26 '16 at 18:26
  • @rubo77 I've just updated the repository so I'm only serving the index files; the actual packages are now downloaded directly from https://releases.hashicorp.com/ – Wolfgang Sep 11 '17 at 16:03
0

Change the version number to the latest version

  1. wget https://releases.hashicorp.com/vagrant/1.9.1/vagrant_1.9.1_x86_64.deb
  2. sudo dpkg -i vagrant_1.9.1_x86_64.deb
  3. vagrant version