Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save angstyloop/bac6b8d8ad2bd210ce68304d4fdedd29 to your computer and use it in GitHub Desktop.
Save angstyloop/bac6b8d8ad2bd210ce68304d4fdedd29 to your computer and use it in GitHub Desktop.
Install VirtualBox Version 7.0 on Debian-based Linux
#!/bin/bash
# install_virtualbox_on_debian_based_linux.sh
# Install VirtualBox Version 7.0 on Debian-based Linux
# Add a line for the oracle virtualbox debian package to /etc/apt/sources.list
# (you can use echo/append). Replace "jammy" with your distribution name.
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian jammy contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
# Download and register the GPG armorfile containing the public key. Extract
# the public key from the armorfile to the OS keyring.
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc|sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor
# Check if the fingerprint of the key matches what's listed on virtualbox
# website. If it doesn't match print something and exit.
if ! gpg --show-keys /usr/share/keyrings/oracle-virtualbox-2016.gpg|grep -q B9F8D658297AF3EFC18D5CDFA2F683C52980AECF; then
echo Public key /usr/share/keyrings/oracle-virtualbox-2016.gpg does not have the correct fingerprint.
exit 1
fi
sudo apt-get update
sudo apt-get install -y virtualbox-7.0
# References
# https://www.virtualbox.org/wiki/Linux_Downloads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment