Can't succesfully install VIrtualBox from repository

I want to install VIrtualBox on Fedora by adding a repository, but I can’t succesfully achieve that. I have done this:

Added repository by following instructions here:

  1. Executed

    sudo wget https://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo while being in /etc/yum.repos.d/
    
  2. Executed

    dnf config-manager --add-repo /etc/yum.repos.d/virtualbox.repo
    

    To succesfully do that, I had to execute

    sudo dnf install dnf-plugins-core
    
  3. Executed

    dnf config-manager --set-enabled virtualbox
    
  4. Tried executing

    sudo dnf install virtualbox
    

    and

    sudo dnf install VirtualBox
    

    but only got last metadata expiration check and no match for argument messages.
    I also tried:

    sudo dnf update
    sudo dnf upgrade
    

Where’s my error in trying to install VIrtualBox?

What is the actual repo name?
That can be seen by cat /etc/yum.repos.d/virtualbox.repo
If the name was not correct when you tried to enable it then it would not be enabled.
If not enabled properly then it would not install.
If the repo file is not properly formatted it may not enable or install.

Step 2 has never been needed for me with any repo file I have ever installed. If properly formatted, the repo file being in that location automatically makes it available to the system.

The command dnf repolist will show you all the currently enabled repos. If the virtual box repo is not in that list then it was not enabled properly. That can be due to using the wrong name or because of an incorrectly formatted .repo file.

The command dnf repolist all will show all currently installed repos with either ‘enabled’ or ‘disabled’ at the far right for each.

Noted about step 2, thanks.

cat /etc/yum.repos.d/virtualbox.repo gave me this:

[virtualbox]
name=Fedora $releasever - $basearch - VirtualBox
baseurl=http://download.virtualbox.org/virtualbox/rpm/fedora/$releasever/$basearch
enabled=1
gpgcheck=1
epo_gpgcheck=1
gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc

dnf repolist had virtualbox in that id and name:

repo id                         repo name
virtualbox                      Fedora 35 - x86_64 - VirtualBox

I guess I had to enter repo name instead of repo id?

That output of the virtualbox.repo show it correctly as does dnf repolist.
Now the only thing needed is to use the correct package name to install it.
Try sudo dnf install VirtualBox --releasever=33

If that does not work, and since VirtualBox has not been renamed for the rpm file, you may need to manually download it before installing then install it locally.
The file to download from that repo is
http://download.virtualbox.org/virtualbox/rpm/fedora/35/x86_64/VirtualBox-6.1-6.1.32_149290_fedora33-1.x86_64.rpm

I got this after executing sudo dnf install VirtualBox --releasever=33:

No match for argument: VirtualBox
Error: Unable to find a match: VirtualBox

Installed it by executing a file from that link.

Can you explain, what do you mean by “VIrtualBox has not been renamed for the rpm file”?
Also, if VirtualBox now is installed in this way, will I get updates for it from repository, or I will have to check manually if there’s a new update and install it by downloading file again?

Apparently VirtualBox does not set up their metadata for the repo to allow installing with just the package name as most fedora compatible repos do. This would explain why it would not be found with that dnf command. Probably the install would have worked if I had suggested sudo dnf install VirtualBox* --releasever=33. I did not expect them to have the metadata structured differently than most fedora repos.

Also the file name, even though they created a (linked) directory for fedora 35 and did an update in Jan 22, actually resides in a repo directory for fedora 33 and the actual file downloaded contains fedora33 as part of the name. Thus my “not renamed” comment.

Updates ? I don’t know but unless the repo structure & metadata is fixed it might become necessary to do manual updates instead of relying on the repo.

What does dnf list installed VirtualBox* tell you?

The package is called VirtualBox-6.1, not VirtualBox

install command using dnf: sudo dnf install VirtualBox-6.1

1 Like

I think you don’t need add repository virtual box for install virtual box in Fedora 35 or Fedora 36(I run this on Fedora 35), Because there is already in repo official fedora. See my SS below you just type this:
sudo dnf install VirtualBox

No, what you are doing is installing virtualbox from rpmfusion.org, which isn’t a Fedora official software repo.

I am not saying you can’t install VirtualBox from rpmfusion, but can’t install VirtualBox without adding a repo.

1 Like

Error: No matching Packages to list

And also, thanks for the explanation!

Thank you! This worked. Can you explain how can I find out how the package is named so next time I wouldn’t have the same problem with other repos?

You can check this out https://www.if-not-true-then-false.com/ .It explains pretty much everything that’s needed to get virtualbox up and running.

1 Like
dnf search VirtualBox

If your search should return results from third-party repo (I.e. oracle), you must have it enabled.

1 Like

For what it’s worth, the Rpmfusion version is not the same, as it’s the open source community version and not the license encumbered PUEL version from the vbox website. It won’t have all the same features, but you’re also less likely to deal with shenanigans from Oracle about it such as Oracle demands $12K from network biz that doesn't use its software • The Register