Can anyone answer question to log number 272011

Asked by Rachel Gould

Question relates to the following error message that i get when trying to install updates

E: Could not open lock file /var/lib/dpkg/lock - open (2 No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
E: _cache->open() failed, please report.

Any ideas on how to fix this problem to a novice user?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu synaptic Edit question
Assignee:
No assignee Edit question
Solved by:
marcobra (Marco Braida)
Solved:
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Please open a Terminal from the menu Applications->Accessories->Terminal and type:

sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get clean
sudo apt-get autoremove

give your user password when requested, you don't see nothing when you type it, then press enter.

If this solves you problem, please mark as Solved. If not, please clarify your question.

Hope this helps

Revision history for this message
Rachel Gould (argould-vodafone) said :
#2

The below command is what I get after following only 3 of the recommended step. I think that this is the main problem. Don't know how to fix it. Once this is fixed, I think that that should be the end of it.

Any further suggestions?

E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
andrew@andrew-desktop:~$

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#3

Can you tell me the exact command you have typed... ?

Thank you

Revision history for this message
Rachel Gould (argould-vodafone) said :
#4

I copied what you suggested into terminal then it asked for password then after i entered it the first line of below came up so i pasted all of what you said again and the rest is all below.

Thanks for you time hope you can help me sort it.

dpkg: unable to open/create status database lockfile: No such file or directory
andrew@andrew-desktop:~$ sudo dpkg --configure -a
dpkg: unable to open/create status database lockfile: No such file or directory
andrew@andrew-desktop:~$ sudo apt-get -f install
E: Could not open lock file /var/lib/dpkg/lock - open (2 No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
andrew@andrew-desktop:~$ sudo apt-get --fix-missing install
E: Could not open lock file /var/lib/dpkg/lock - open (2 No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
andrew@andrew-desktop:~$ sudo apt-get clean
andrew@andrew-desktop:~$ sudo apt-get update
Hit http://security.ubuntu.com hardy-security Release.gpg
Hit http://nz.archive.ubuntu.com hardy Release.gpg
Ign http://nz.archive.ubuntu.com hardy/main Translation-en_NZ
Ign http://nz.archive.ubuntu.com hardy/restricted Translation-en_NZ
Ign http://nz.archive.ubuntu.com hardy/universe Translation-en_NZ
Hit http://archive.canonical.com hardy Release.gpg
Hit http://archive.ubuntu.com hardy-backports Release.gpg
Ign http://nz.archive.ubuntu.com hardy/multiverse Translation-en_NZ
Get:1 http://nz.archive.ubuntu.com hardy-updates Release.gpg [189B]
Ign http://nz.archive.ubuntu.com hardy-updates/main Translation-en_NZ
Ign http://nz.archive.ubuntu.com hardy-updates/restricted Translation-en_NZ
Hit http://nz.archive.ubuntu.com hardy Release
Hit http://nz.archive.ubuntu.com hardy-updates Release
Hit http://nz.archive.ubuntu.com hardy/main Packages
Hit http://nz.archive.ubuntu.com hardy/restricted Packages
Hit http://nz.archive.ubuntu.com hardy/main Sources
Hit http://nz.archive.ubuntu.com hardy/restricted Sources
Hit http://nz.archive.ubuntu.com hardy/universe Packages
Hit http://nz.archive.ubuntu.com hardy/universe Sources
Hit http://nz.archive.ubuntu.com hardy/multiverse Packages
Hit http://nz.archive.ubuntu.com hardy/multiverse Sources
Ign http://security.ubuntu.com hardy-security/main Translation-en_NZ
Hit http://nz.archive.ubuntu.com hardy-updates/main Packages
Hit http://nz.archive.ubuntu.com hardy-updates/restricted Packages
Hit http://nz.archive.ubuntu.com hardy-updates/main Sources
Hit http://nz.archive.ubuntu.com hardy-updates/restricted Sources
Ign http://archive.ubuntu.com hardy-backports/main Translation-en_NZ
Ign http://archive.canonical.com hardy/partner Translation-en_NZ
Ign http://security.ubuntu.com hardy-security/restricted Translation-en_NZ
Hit http://archive.canonical.com hardy Release
Ign http://archive.ubuntu.com hardy-backports/restricted Translation-en_NZ
Hit http://archive.canonical.com hardy/partner Packages
Ign http://security.ubuntu.com hardy-security/universe Translation-en_NZ
Ign http://archive.ubuntu.com hardy-backports/universe Translation-en_NZ
Ign http://security.ubuntu.com hardy-security/multiverse Translation-en_NZ
Hit http://security.ubuntu.com hardy-security Release
Hit http://security.ubuntu.com hardy-security/main Packages
Ign http://archive.ubuntu.com hardy-backports/multiverse Translation-en_NZ
Hit http://archive.ubuntu.com hardy-updates Release.gpg
Hit http://security.ubuntu.com hardy-security/restricted Packages
Hit http://security.ubuntu.com hardy-security/main Sources
Ign http://archive.ubuntu.com hardy-updates/universe Translation-en_NZ
Hit http://security.ubuntu.com hardy-security/restricted Sources
Ign http://archive.ubuntu.com hardy-updates/multiverse Translation-en_NZ
Get:2 http://archive.ubuntu.com hardy-security Release.gpg [189B]
Hit http://security.ubuntu.com hardy-security/universe Packages
Hit http://security.ubuntu.com hardy-security/universe Sources
Ign http://archive.ubuntu.com hardy-security/main Translation-en_NZ
Hit http://security.ubuntu.com hardy-security/multiverse Packages
Ign http://archive.ubuntu.com hardy-security/restricted Translation-en_NZ
Hit http://security.ubuntu.com hardy-security/multiverse Sources
Ign http://archive.ubuntu.com hardy-security/universe Translation-en_NZ
Ign http://archive.ubuntu.com hardy-security/multiverse Translation-en_NZ
Hit http://archive.ubuntu.com hardy-backports Release
Hit http://archive.ubuntu.com hardy-updates Release
Get:3 http://archive.ubuntu.com hardy-security Release [58.5kB]
Err http://archive.ubuntu.com hardy-security Release

Hit http://archive.ubuntu.com hardy-backports/main Packages
Hit http://archive.ubuntu.com hardy-backports/restricted Packages
Hit http://archive.ubuntu.com hardy-backports/universe Packages
Hit http://archive.ubuntu.com hardy-backports/multiverse Packages
Hit http://archive.ubuntu.com hardy-updates/universe Packages
Hit http://archive.ubuntu.com hardy-updates/multiverse Packages
Fetched 379B in 6s (59B/s)
W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://archive.ubuntu.com hardy-security Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <email address hidden>

W: Failed to fetch http://nz.archive.ubuntu.com/ubuntu/dists/hardy-updates/Release rename failed, No such file or directory (/var/lib/apt/lists/partial/nz.archive.ubuntu.com_ubuntu_dists_hardy-updates_Release.gpg -> /var/lib/apt/lists/nz.archive.ubuntu.com_ubuntu_dists_hardy-updates_Release.gpg).

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/hardy-security/Release

W: Some index files failed to download, they have been ignored, or old ones used instead.
E: Could not open lock file /var/lib/dpkg/lock - open (2 No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
andrew@andrew-desktop:~$ sudo apt-get upgrade
E: Could not open lock file /var/lib/dpkg/lock - open (2 No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
andrew@andrew-desktop:~$ sudo apt-get dist-upgrade
E: Could not open lock file /var/lib/dpkg/lock - open (2 No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
andrew@andrew-desktop:~$ sudo apt-get clean
andrew@andrew-desktop:~$ sudo apt-get autoremove
E: Could not open lock file /var/lib/dpkg/lock - open (2 No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Revision history for this message
Rachel Gould (argould-vodafone) said :
#5

marcobra wrote:
> Your question #45720 on synaptic in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/synaptic/+question/45720
>
> Status: Open => Needs information
>
> marcobra requested for more information:
> Can you tell me the exact command you have typed... ?
>
> Thank you
>

I typed the first three commands that were from you. When I hit return
I got the following,

> E: Could not open lock file /var/lib/dpkg/lock - open (2 No such file or directory)
>

That is also what comes up when I attempt to install updates.

Hope this helps

> E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Revision history for this message
Abhishek (abhishekrane) said :
#6

try this,

pgrep dpkg
you will get a number for example 3222
then type
sudo kill -9 3222

Revision history for this message
Rachel Gould (argould-vodafone) said :
#7

E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to
correct the problem.
E: _cache->open() failed, please report.

andrew@andrew-desktop:~$ sudo dpkg --configure -a
[sudo] password for andrew:
Setting up sudo (1.6.9p10-1ubuntu3.3) ...

Setting up libfreetype6 (2.3.5-1ubuntu4.8.04.1) ...

Setting up libxml2 (2.6.31.dfsg-2ubuntu1.2) ...

Setting up language-pack-en (1:8.04+20080805) ...
Setting up apturl (0.2.6ubuntu1~hardy1) ...

Setting up linux-image-2.6.24-19-generic (2.6.24-19.41) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.24-19-generic
Not updating initrd symbolic links since we are being updated/reinstalled
(2.6.24-19.36 was configured last, according to dpkg)
Not updating image symbolic links since we are being updated/reinstalled
(2.6.24-19.36 was configured last, according to dpkg)
Running postinst hook script /sbin/update-grub.
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.24-19-generic
Found kernel: /boot/vmlinuz-2.6.24-18-generic
Found kernel: /boot/vmlinuz-2.6.24-17-generic
Found kernel: /boot/vmlinuz-2.6.24-16-generic
Found kernel: /boot/vmlinuz-2.6.22-14-generic
Found kernel: /boot/vmlinuz-2.6.20-16-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

Setting up app-install-data-commercial (9.3) ...
Caching application data...
Generating mime/codec maps...

Setting up eject (2.1.5-6ubuntu1) ...
Setting up language-pack-gnome-en (1:8.04+20080805) ...
Setting up libfreetype6-dev (2.3.5-1ubuntu4.8.04.1) ...

Setting up libglib2.0-0 (2.16.4-0ubuntu3) ...

dpkg: error processing brasero (--configure):
 Package is in a very bad inconsistent state - you should
 reinstall it before attempting configuration.
Setting up libglib2.0-dev (2.16.4-0ubuntu3) ...
Processing triggers for libc6 ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
 brasero
andrew@andrew-desktop:~$

THe top message is what I got after the latest attempt to install updates.

Ran that in terminal and got the above.

Any suggestions?

Revision history for this message
Best marcobra (Marco Braida) (marcobra) said :
#8

Try...
From a terminal type:

sudo apt-get --purge remove brasero
sudo dpkg --configure -a

and if you get no errors...

sudo apt-get -f install
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install brasero

Hope this helps

Revision history for this message
Rachel Gould (argould-vodafone) said :
#9

Thanks marcobra, that solved my question.

Revision history for this message
Rachel Gould (argould-vodafone) said :
#10

Now for the next problem. Thanks to those who helped with first prob. This message appears when trying to update package info.

W: A error occurred during the signature verification. The repository is not updated and the previous index files will be used.GPG error: http://archive.ubuntu.com hardy-security Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <email address hidden>

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/hardy-security/Release

W: Some index files failed to download, they have been ignored, or old ones used instead.

Any suggestions? Thanks.