Package manager error

Asked by James

I have done something to the Package manager, and get this message.

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

Please let me know what to do, I have tried typing sudo dpkg --configure -a into the command line, and i get this.

dpkg: status database area is locked by another process

Don't know if this is another problem or not.

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Software Updater Edit question
Assignee:
No assignee Edit question
Solved by:
James
Solved:
Last query:
Last reply:
Revision history for this message
Ralph Janke (txwikinger) said :
#1

1) For the E: error please check if your directories /var/cache/apt/archives and /var/lib/dpkg/info exist and have contents.

2) for the dpkg: error message. Do you have another package manager running (adept, synaptics, ...)?

Revision history for this message
Sam Cater (wraund-deactivatedaccount) said :
#2

kill off any other programs that could be using package managing etc etc

Revision history for this message
James (jd-preston) said :
#3

1) they both exist and have a large number of contents - more in the second one. There is a 'lock' file in the first one.

2) I could of done at one time. I have been trying many things and can't remember what else was happening at the time. I have just tried it again and nothing happens now.

Revision history for this message
C de-Avillez (hggdh2) said :
#4

I am unsure what you mean on your last post: do you mean now it works, or that now it is failing in a different way?

Revision history for this message
James (jd-preston) said :
#5

I really don't know about the second problem, I just included that info in case it could help with the first problem.
The first problem still remains. I cannot get updates through package manager, nor through the command line or synaptic. I just get the error messages above.
This happened after I tried to install a program called virtualbox, but it did not install fully and crashed. Since then I cannot install anything.

Revision history for this message
Ralph Janke (txwikinger) said :
#6

Could you delete the lock file in /var/lib/dpkg/

sudo rm /var/lib/dpkg/lock

and see if it works.

Thanks

Revision history for this message
C de-Avillez (hggdh2) said :
#7

How did you download virtualbox? It seems the package did not go into the usual package cache -- /var/cache/apt/archive. If you have the package somewhere else, try the following:

sudo cp <virtualbox.deb> /var/cache/apt/archive

replacing <virtualbox.deb> by the correct filename for the package, then try again.

Also, make sure you do not have any other instance of package managers running. Only one of them can do system work at a time, which is what gives out the warning about being locked out.

Revision history for this message
James (jd-preston) said :
#8

I downloaded virtualbox from

http://www.virtualbox.org/

clicked on downloads and then, Ubuntu 6.10 Edgy.

I have deleted the locks, but no change. I can't find the package anywhere else to move it.

Revision history for this message
C de-Avillez (hggdh2) said :
#9

Please run 'sudo dpkg -C' and post the results. Whatever happens, it is highly probable you will need the VirtualBox install file again, so go ahead and download it again.

Additionally: the VirtualBox FAQ (http://virtualbox.org/wiki/User_FAQ) has the following observation, which I guess would describe your situation:

    * Debian/Ubuntu 1.3.2 packages: If the installation of the VirtualBox_*.deb package was not successful because the compilation of the kernel module fails, it might not be possible to remove the package nor to install other packages as the pre-remove (prerm) script of the package (which is executed prior to package removing or upgrading) aborts with an error "(Kernel module not found)...fail!". In that case do the following:
          o Edit /etc/init.d/virtualbox and change line 129 from 'exit 1' to 'exit 0'
          o Reinstall the virtualbox package by 'dpkg -i <the VirtualBox package for your distribution>'. An installation failure of this package is expected.
          o Edit /var/lib/dpkg/info/virtualbox.postinst and change line 39 from 'exit 1' to 'exit 0'
          o Execute 'dpkg --configure --pending'
          o The package should now be installed successfully. However, the kernel module is still not compiled. Before you will be able to execute VirtualBox you have to create a kernel module for your current kernel, as described in the User Manual (see our Downloads section).

Revision history for this message
James (jd-preston) said :
#10

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

This is the result of the command 'Sudo dpkg -C'

I have tired downloading Virtualbox again by going to the website, but the installation does not complete - so i don't seem to be able to re-install it.

Revision history for this message
C de-Avillez (hggdh2) said :
#11

What dpkg -C gives us is the certainty that only the virtualbox package is hosed. Now you have to follow the VirtualBox steps as outlined in their FAQ (and copied here in my previous response to you). Trying to simply reinstall it will not resolve the issue.

Again:

          o Edit /etc/init.d/virtualbox and change line 129 from 'exit 1' to 'exit 0'
          o Reinstall the virtualbox package by 'dpkg -i <the VirtualBox package for your distribution>'. An installation failure of this package is expected.
          o Edit /var/lib/dpkg/info/virtualbox.postinst and change line 39 from 'exit 1' to 'exit 0'
          o Execute 'dpkg --configure --pending'
          o The package should now be installed successfully. However, the kernel module is still not compiled. Before you will be able to execute VirtualBox you have to create a kernel module for your current kernel, as described in the User Manual (see our Downloads section).

Please bear in mind that this is a third-party package, and the authors are the ultimate resource.

Revision history for this message
Best James (jd-preston) said :
#12

I found the solution. The package had failed to install correctly and was in a half installed state (indicated by the "H" in the package status by running aptitute). All I needed to do was reinstall the package using dpkg by doing the following:

$sudo dpkg -i VirtualBox_1.3.8_Ubuntu_edgy_i386.deb

This installed it successfully and restored the package management system back in to a working state :)
Thanks for all your help!