-2

With this leading to that, and on to this leading to that, I'm wondering

  1. How exactly these lines would need to be adjusted to only upgrade VirtualBox (i.e. https://launchpad.net/ubuntu/+source/virtualbox/6.1.38-dfsg-3~ubuntu1.22.04.1) from "proposed", e.g. replacing the asterisk below with "virtualbox" and "virtualbox-guest-utils" (?) and
  2. what all the below means?

https://wiki.ubuntu.com/Testing/EnableProposed

cat <<EOF >/etc/apt/preferences.d/proposed-updates
# Configure apt to allow selective installs of packages from proposed
Package: *
Pin: release a=$(lsb_release -cs)-proposed
Pin-Priority: 400
EOF

Elucidation much appreciated!

  • 1
    If your goal is to get the latest vb, this is not the way to do that. Why not just install the official oracle ppa? – Organic Marble Sep 09 '22 at 16:01
  • @OrganicMarble and other downvoter: did you follow the four links? I'm asking about a very specific way to upgrade (for reasons given in the links) and, unfortunately, the wiki above does not explain much. – nutty about natty Sep 10 '22 at 12:31
  • I am not a downvoter. Potential answerers should not have to read a bunch of links - put pertinent info in the question. If you have rationale for doing this way, don't keep it a secret. – Organic Marble Sep 10 '22 at 13:10
  • @OrganicMarble It's not a secret and I could add the main sections of the links but the question itself is still valid... https://help.ubuntu.com/community/PinningHowto is already a piece of the puzzle, for instance... but that answer (which I posted as a "stub") has already been deleted... really strange that downvoting and deleting is so quick here sometimes :/ Basically I'm asking for some guidance (specific example with VirtualBox) and explanation of the lines from https://wiki.ubuntu.com/Testing/EnableProposed which unfortunately is not too verbose about it. – nutty about natty Sep 10 '22 at 18:22

1 Answers1

2

I will issue a frame challenge at the end of this answer, showing that this is not the optimal way to achieve the goal. But until then, this is what one does and why one does it.

One needs only follow the very clear instructions in https://wiki.ubuntu.com/Testing/EnableProposed, making the appropriate changes for the jammy release.

This procedure assumes that the system being used is fully upgraded and has a working apt system.

Big picture of the procedure -

  • Step 1: Enable the proposed repo
  • Step 2: Block apt from automatically installing anything from the proposed repo
  • Step 3: Manually install only the packages one wants from the proposed repo

First let's look at the versions of virtualbox available in jammy by default:

apt policy virtualbox
virtualbox:
  Installed: (none)
  Candidate: 6.1.34-dfsg-3~ubuntu1.22.04.1
  Version table:
     6.1.34-dfsg-3~ubuntu1.22.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages
     6.1.32-dfsg-1build1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages

Onwards!

  • Step 1 - Enable the proposed repo as explained in the wiki

enter image description here

Now let's again look at the versions of virtualbox available

apt policy virtualbox
virtualbox:
  Installed: (none)
  Candidate: 6.1.38-dfsg-3~ubuntu1.22.04.1
  Version table:
     6.1.38-dfsg-3~ubuntu1.22.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-proposed/multiverse amd64 Packages
     6.1.34-dfsg-3~ubuntu1.22.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages
     6.1.32-dfsg-1build1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages

Yay, version 6.1.38 is available. But if we simply do a sudo apt upgrade at this point, we'll get not only that version of virtualbox but all the other potentially sketchy packages in the proposed repo. This is because it has priority 500 like the packages in the other repos.

Hence step 2

  • Step 2 - Block apt from automatically installing anything from the proposed repo

Issue a sudo su so that you can write to /etc/apt, then do what the wiki says:

cat <<EOF >/etc/apt/preferences.d/proposed-updates
# Configure apt to allow selective installs of packages from proposed
Package: *
Pin: release a=$(lsb_release -cs)-proposed
Pin-Priority: 400
EOF

then exit out of sudo su.

What this does is give the packages from the proposed repo a low priority, so that apt won't install them over packages from the normal repos, which have higher priority.

Like the wiki says, test that that worked by doing a sudo apt update. Hopefully no packages are waiting to be upgraded, because what one wanted to do was block apt from automatically upgraded packages from the proposed repo.

  • Step 3: Manually install only the packages one wants from the proposed repo

As the wiki says, fire up aptitude thusly:

sudo aptitude -t jammy-proposed

Now search in aptitude for virtualbox. When you find it, highlight it and press + to mark it for installation. Aptitude will find and mark its dependencies as well. It will look like this.

enter image description here

Now press g to install the packages. When it's finished, quit aptitude.

Once again, look at the versions (notice the low 400 priority on the installed package - you did it manually, so the priority was not a factor)

apt policy virtualbox
virtualbox:
  Installed: 6.1.38-dfsg-3~ubuntu1.22.04.1
  Candidate: 6.1.38-dfsg-3~ubuntu1.22.04.1
  Version table:
 *** 6.1.38-dfsg-3~ubuntu1.22.04.1 400
        400 http://us.archive.ubuntu.com/ubuntu jammy-proposed/multiverse amd64 Packages
        100 /var/lib/dpkg/status
     6.1.34-dfsg-3~ubuntu1.22.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages
     6.1.32-dfsg-1build1 500
        500 http://us.archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages

and run it!

enter image description here



Now for the frame challenge!

We went through all that to install version 6.1.38, which is the current version available through the official Oracle virtualbox ppa!

Make your life easy by installing virtualbox-6.1 from there

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
  • Package: * "all" packages? Pin: release a=$(lsb_release -cs)-proposed what's happening here? Pin-Priority: 400 how arbitrary is "400" ? would 390 also do the job – nutty about natty Sep 11 '22 at 17:50
  • Re "frame challenge": that's the first link in the question above: I tried to "play it safe" and do just that / switching to Oracle VirtualBox via the GUI but did not yet get passed the first (unsuccessful) attempt, cf. link. – nutty about natty Sep 11 '22 at 17:54
  • And granted: the proper way to do it would probably be to first cleanly uninstall the current installation of VirtualBox and then "just" follow the command line instructions; these are, on the virtualbox.org, not entirely explicit though, e.g. how best/exactly to add the line to /etc/apt/sources.list (cf. for instance https://stackoverflow.com/a/1584083/2153622 and https://stackoverflow.com/questions/850730/how-can-i-append-text-to-etc-apt-sources-list-from-the-command-line). – nutty about natty Sep 11 '22 at 18:03
  • PS: motivation for the selectively enabling the VirtualBox proposed is/was to "help" here: https://bugs.launchpad.net/ubuntu/+source/virtualbox/+bug/1988473 – nutty about natty Sep 11 '22 at 18:06
  • man lsb_release – nutty about natty Sep 12 '22 at 17:35