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

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.

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!

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