The SPM crashes and not updating & upgrading via terminal due to package virtualbox-6.1

Asked by Navin Talati

Sir,

My OS is Ubuntu 20.04 LTS.

When I upate and upgrade from terrminal it is not operated/executed due to some faulty Oracle VM virtualbox package. Upo upgrasding, it shows.....
“E: The package virtualbox-6.1 needs to be reinstalled, but I can't find an archive for it.”

I tried through SPM but it crashes with a warning massage as under:

E: The package virtualbox-6.1 needs to be reinstalled, but I can't find an archive for it.
E: Internal error opening cache (1). Please report.

The package virtualbox-6.1 is also not gettig reinstalled through Gdebi application.

How to resolve this issue? - Please guide with appropriate command lines for this.

Reards.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

For diagnostic purposes please provide the output tat you receive for the following commands:

uname -a
lsb_release -crid
sudo dpkg --audit
apt-cache policy virtualbox-6.1
sudo apt update

if you have the right version of virtualbox-6.1*.deb still available on your system, please also add the output of

sudo dpkg -i virtualbox-6.1_6.1.22-144080~Ubuntu~eoan_amd64.deb

(correct the file name, if you have a different version)

Revision history for this message
Navin Talati (n-m-talati) said :
#2

Sir,
Thanks for your positive reply. The output of first 5 stuffs is as under:

------------ OUT PUT-----------
navin@linux:~$ uname -a
Linux linux 5.8.0-50-generic #56~20.04.1-Ubuntu SMP Mon Apr 12 21:46:35 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
navin@linux:~$ lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 20.04.2 LTS
Release: 20.04
Codename: focal
navin@linux:~$ sudo dpkg --audit
[sudo] password for navin:
The following packages are in a mess due to serious problems during
installation. They must be reinstalled for them (and any packages
that depend on them) to function properly:
 virtualbox-6.1 Oracle VM VirtualBox

navin@linux:~$ apt-cache policy virtualbox-6.1
virtualbox-6.1:
  Installed: 6.1.18-142142~Ubuntu~eoan
  Candidate: 6.1.18-142142~Ubuntu~eoan
  Version table:
 *** 6.1.18-142142~Ubuntu~eoan 100
        100 /var/lib/dpkg/status
navin@linux:~$ sudo apt update
Hit:1 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:4 http://ppa.launchpad.net/costales/yaru-colors-folder-color/ubuntu focal InRelease
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Hit:6 http://ppa.launchpad.net/gezakovacs/ppa/ubuntu focal InRelease
Get:7 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [982 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [474 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [263 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu focal-updates/main DEP-11 48x48 Icons [55.6 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu focal-updates/main DEP-11 64x64 Icons [87.9 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [13.3 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [572 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [774 kB]
Get:15 http://in.archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [166 kB]
Get:16 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [323 kB]
Get:17 http://in.archive.ubuntu.com/ubuntu focal-updates/universe DEP-11 48x48 Icons [204 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu focal-updates/universe DEP-11 64x64 Icons [362 kB]
Get:19 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [17.4 kB]
Get:20 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
Get:21 http://in.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1,768 B]
Get:22 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [229 kB]
Get:23 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [655 kB]
Get:24 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [131 kB]
Get:25 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [24.4 kB]
Get:26 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [7,508 B]
Get:27 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [58.2 kB]
Fetched 5,728 kB in 4s (1,472 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
23 packages can be upgraded. Run 'apt list --upgradable' to see them.
navin@linux:~$
------------ END OF OUT PUT-------------------

Sir, for the last suggested out put, I am little confused that output of which version is required?

Presently the installed version is specified as under:
VirtualBox Graphical Iser interface
Version 6.1.18 r142142(Qt5.12.8)

When I load it (i.e. starts the application), pops-up for upgradable available new version of that as under:
A new version of VirtualBox has been released! Version 6.1.22 is available at virtualbox.org.You can download this version using the link:https://download.virtualbox.org/virtualbox/6.1.22/virtualbox-6.1_6.1.22-144080~Ubuntu~eoan_amd64.deb
So, for which version should I give you the output? (---- i.e. for “Version 6.1.18 r142142(Qt5.12.8)” OR for “ Version 6.1.22”)

Regards.
Navin Talati /14-05-2021

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

dpkg recommend reinstalling the current version which is (see your output);

navin@linux:~$ apt-cache policy virtualbox-6.1
virtualbox-6.1:
  Installed: 6.1.18-142142~Ubuntu~eoan
  Candidate: 6.1.18-142142~Ubuntu~eoan

so you need https://download.virtualbox.org/virtualbox/6.1.18/virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb

Download it and then install it with the command

sudo dpkg -i virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb

If that is done, then you can do the upgrade.

Revision history for this message
Navin Talati (n-m-talati) said :
#4

Sir,
...so the existing (i.e. presently installed version 6.1.18 r142142) is not required to be uninstall first. - isn't it?

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

dpkg is a bit peculiar if there is a package in a broken status (as it currently is the case with your virtualbox-6.1 package).
dpkg does not allow uninstalling a package in that broken status (unless you force uninstallation) or doing anything else with that package. You have to re-install the same version before you can do an upgrade.

My recommendation:

sudo dpkg -i virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb
sudo dpkg -i virtualbox-6.1_6.1.22-144080~Ubuntu~eoan_amd64.deb

one after the other in this sequence.

Revision history for this message
Navin Talati (n-m-talati) said :
#6

Thanks for the reply – Sir.

1.
As per your instructions, I again downloaded the following versions from the respective links.

virtualbox-6.1_6.1.22-144080~Ubuntu~eoan_amd64.deb
(from: https://download.virtualbox.org/virtualbox/6.1.22/virtualbox-6.1_6.1.22-144080~Ubuntu~eoan_amd64.deb) -------(Ref:#2)

AND

virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb
(from: https://download.virtualbox.org/virtualbox/6.1.18/virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb) --------- (Ref:#3)

Both have location in “Downloads” folder by default in my system. These are kept there.
(If I have to place them in some another folder, please guide for that.)

2.
Then I applied stuffs one by one as recommended in #5. The output is as under:
-----------------------------------------
navin@linux:~$ sudo dpkg -i virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb
[sudo] password for navin:
dpkg: error: cannot access archive 'virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb': No such file or directory

navin@linux:~$ sudo dpkg -i virtualbox-6.1_6.1.22-144080~Ubuntu~eoan_amd64.deb
dpkg: error: cannot access archive 'virtualbox-6.1_6.1.22-144080~Ubuntu~eoan_amd64.deb': No such file or directory
navin@linux:~$
-------------------------------------------

3.
Also in Terminal, following stuffs applied one by one:
sudo apt-get update
sudo apt upgrade
sudo apt-get install -f
...but finally says the same thing that...”The package virtualbox-6.1 needs to be reinstalled, but I can't find an archive for it.”

Here giving you the output of above THREE commands:
------------------------------------------
navin@linux:~$ sudo apt-get update
Hit:1 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Hit:4 http://ppa.launchpad.net/costales/yaru-colors-folder-color/ubuntu focal InRelease
Hit:5 http://ppa.launchpad.net/gezakovacs/ppa/ubuntu focal InRelease
Get:6 http://security.ubuntu.com/ubuntu focal-security InRelease [109 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [474 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [983 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [263 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [572 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [774 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [323 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu focal-updates/universe DEP-11 64x64 Icons [362 kB]
Get:14 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
Get:15 http://in.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [1,768 B]
Get:16 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [24.4 kB]
Get:17 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [58.3 kB]
Fetched 4,162 kB in 2s (1,821 kB/s)
Reading package lists... Done

navin@linux:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package virtualbox-6.1 needs to be reinstalled, but I can't find an archive for it.

navin@linux:~$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package virtualbox-6.1 needs to be reinstalled, but I can't find an archive for it.
----------------------------------------

If, I am missing something to apply, please lead me for that.

How to proceed further in the matter?

Regards.
Navin Talati /15-05-2021

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#7

Did you read the message that you got? Didn't the word "error" in the message ring a bell?

sudo dpkg -i virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb
dpkg: error: cannot access archive 'virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb': No such file or directory

You have to cd (change directory) to the directory where the *.deb file is stored, or provide the directory name together with the file name.

Probably

cd ~/Downloads
sudo dpkg -i virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb

or
sudo dpkg -i ~/Downloads/virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb

Revision history for this message
Navin Talati (n-m-talati) said :
#8

Sir,

Thanks for the guidance and pointing out my mistake in understanding the massage. According to you instruction, I could:

1.......processed “sudo dpkg -i ~/Downloads/virtualbox-6.1_6.1.18-142142~Ubuntu~eoan_amd64.deb”

2.......update and upgrade.

3.......open SPM.

4.......make “Software Updater” working.

5.......and also could apply and run “sudo dpkg -i ~/Downloads/virtualbox-6.1_6.1.22-144080~Ubuntu~eoan_amd64.deb” successfully.

Thanks once again with best regards.

Navin Talati / 15-05-2021

Revision history for this message
Navin Talati (n-m-talati) said :
#9

Thanks Manfred Hampl, that solved my question.