Ubuntu – Skipping acquire of configured file ‘contrib/binary-i386/Packages’ as repository … doesn’t support architecture ‘i386’

18.04package-managementvirtualbox

I installed Ubuntu 18.04 and then while installing Virtualbox i get the 'i386' error message after I did:

$ sudo apt-get update
Get:1 http://nl.archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                                
Hit:3 http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu bionic InRelease                                         
Hit:4 http://nl.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:5 http://nl.archive.ubuntu.com/ubuntu bionic-backports InRelease
Get:6 http://download.virtualbox.org/virtualbox/debian bionic InRelease [4429 B]
Get:7 http://download.virtualbox.org/virtualbox/debian bionic/contrib amd64 Packages [1426 B]
Fetched 248 kB in 1s (209 kB/s)     
Reading package lists... Done
N: Skipping acquire of configured file 'contrib/binary-i386/Packages' as repository 'http://download.virtualbox.org/virtualbox/debian bionic InRelease' doesn't support architecture 'i386'

I found several answers on Askubuntu for the 'i386' message but I don't know how to apply this to my situation

Best Answer

Edit:

sudo nano /etc/apt/sources.list.d/virtualbox.list

and change:

deb https://download.virtualbox.org/virtualbox/debian bionic contrib

for

deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian bionic contrib

Or open terminal an execute the following command:

echo "deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list

Or run this bash script to install virtualbox and its dependencies from Oracle repository (tested in Ubuntu 18.04/20.04):

chmod +x VboxInstall.sh && ./VboxInstall.sh

#!/bin/bash
# Install Virtualbox from Oracle Repository
echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list
sudo su -c 'wget -q -O- https://www.virtualbox.org/download/oracle_vbox.asc | apt-key add -'
sudo su -c 'wget -q -O- http://download.virtualbox.org/virtualbox/debian/oracle_vbox_2016.asc | apt-key add -'
sudo apt-get update
sudo apt-get -y install linux-headers-$(uname -r) build-essential gcc make perl dkms bridge-utils
sudo apt-get -y install virtualbox-6.1
sudo dpkg --configure -a && sudo apt-get -f -y install
export VBOX_VER=`VBoxManage --version | awk -Fr '{print $1}'`
wget -c http://download.virtualbox.org/virtualbox/$VBOX_VER/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VER.vbox-extpack
sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VER.vbox-extpack
sudo usermod -a -G vboxusers $USER
sudo update-grub
sudo /sbin/vboxconfig

Important: If you have a previous versions of virtualbox installed (from Ubuntu or Oracle repositories), remove it and backup your VM and config before running script

# Purge Virtualbox
sudo vboxmanage list runningvms | sed -r 's/.*\{(.*)\}/\1/' | sudo xargs -L1 -I {} VBoxManage controlvm {} savestate
sudo VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"
sudo systemctl stop vboxweb-service.service
# using wildcard may not work on some linux systems, and you have to specify the version to remove:
sudo apt-get -y autoremove --purge virtualbox*
sudo rm -rf /etc/vbox /usr/lib/virtualbox /opt/VirtualBox /etc/apt/sources.list.d/virtualbox.list
# optional:
# sudo rm -rf ~/.config/VirtualBox

Source: Virtualbox kernel service is not running