跳过获取已配置文件“ contrib / binary-i386 / Packages”作为存储库…不支持体系结构“ i386”


50

我安装了Ubuntu 18.04,然后在安装Virtualbox时执行了以下操作,并收到“ i386”错误消息:

$ 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'

我在Askubuntu上针对“ i386”消息找到了几个答案,但我不知道如何将其应用于我的情况

Answers:


100

编辑:

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

并更改:

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

对于

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

或打开终端并执行以下命令:

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

更新:

我留下了一个bash脚本,该脚本完全安装了virtualbox,没有错误,这可能很有用。在运行之前备份您的VM和设置(〜/ .config / VirtualBox)

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

#!/bin/bash
while true; do
read -p "Do you want to install Virtualbox? (y/n)" answer
case $answer in
  [Yy]* )
# execute command yes
echo "Virtualbox Pack setup..."
echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | tee /etc/apt/sources.list.d/virtualbox.list
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | apt-key add -
vboxmanage list runningvms | sed -r 's/.*\{(.*)\}/\1/' | xargs -L1 -I {} VBoxManage controlvm {} savestate
killall vboxwebsrv && pkill virtualbox
systemctl stop vboxweb-service.service
export VBOX_VER=`VBoxManage --version|awk -Fr '{print $1}'`
VBoxManage extpack uninstall "Oracle VM VirtualBox Extension Pack"
apt -y autoremove --purge virtualbox*
rm -rf /etc/vbox /opt/VirtualBox /usr/lib/virtualbox ~/.config/VirtualBox
apt update && apt autoclean && apt clean && apt autoremove && apt-get -y dist-upgrade && apt -y --fix-broken install
apt -y install virtualbox-6.0 bridge-utils
dpkg --configure -a && apt-get -f -y install
wget -c http://download.virtualbox.org/virtualbox/$VBOX_VER/Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VER.vbox-extpack
VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-$VBOX_VER.vbox-extpack
usermod -a -G vboxusers $USER
systemctl enable vboxweb-service && systemctl start vboxweb-service
update-grub
vboxconfig
echo "Done"
    break;;
        [Nn]* )
    # execute command no
        break;;
    * ) echo; echo "Select: YES (y) or NO (n)";;
 esac
done

来源:Virtualbox内核服务未运行


您好托马斯,问题解决了,我现在已经成功安装了Virualbox,谢谢
Newbie

这确实帮助我解决了VirtualBox安装问题,谢谢!!!!
杰克空间

别客气。我很高兴听到这一消息
ajcg

9

您应该尝试使用httpsdeb来源:

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

8

我想为此添加评论至secretAgent,但我对此没有足够的声誉。

由于此网站上列出的原因,我们不需要将apt包使用https:https//whydoesaptnotusehttps.com/

另外,如果您的virtualbox来源位于中/etc/apt/sources.list,则ajcg的答案可以修改为:

sudo nano /etc/apt/sources.list

编辑线

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

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

或者您可以启动终端并输入

echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee /etc/apt/sources.list
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.