add/remove applications & terminal

Asked by moran60

--------------- [translated through translate.google.com] -----------------------

these functions are locked by these error message:

E: Could not open lock file / var / lib / apt / lists / lock - open (2 No such file or directory)
E: Unable to lock the list directory

and first:

Unable to download all the archive index

The repository may no longer be available or no longer reachable due to network problems. If available, you will use an older version of the index, otherwise it will be ignored. Check your network connection and make sure the address entered in the preferences is correct.

I ask help to you, another time...

 --------------- [Original content] --------------------------

these functions are locked by these error message:

E: Impossibile aprire il file di lock /var/lib/apt/lists/lock - open (2 Nessun file o directory)
E: Impossibile bloccare la directory dell'elenco

and first:

Impossibile scaricare tutti gli indici dell'archivio

Il repository potrebbe non essere più disponibile o non più raggiungibile per problemi di rete. Se disponibile, verrà utilizzata una versione vecchia degli indici, altrimenti verrà ignorato. Controllare la connessione di rete e assicurarsi che l'indirizzo inserito nelle preferenze sia corretto.

I ask help to you, another time...

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
moran60
Solved:
Last query:
Last reply:
Revision history for this message
J. Austin Rodriguez (jeanaustinr) said :
#1

Hi. The contents of your questions appears to be in Italian (I guess?). Could you please translate it so that others might understand and able to help you? Thank you.

Revision history for this message
J. Austin Rodriguez (jeanaustinr) said :
#2

Be sure there are no two package installers (Ubuntu Software Center, Synaptic, or Terminal) open when you are installing something. This will cause conflict. In that case, a locked directory.

If you prefer using the Terminal, you can re-run 'sudo apt-get update' then install the software you like.

Revision history for this message
moran60 (mele-more) said :
#3

these functions ( add/remove applications and terminal) are locked by these error messages:

"It's impossible open the file of lock /var/lib/apt/lists/lock - open (2 no fyle or directory)
"It's impossible to lock the directory of the list"

and first:

Impossible to download all the menu [indici ( as the second finger of the hand or as menu in the second page of a book), in italian languages]( in english i don't know)] of the archives

"Repository couldn't be enable and cannot reach for system problems
If enable it shall (or will...) used an old version of the menu (indici)
to control the connections and if it's correct the address inserted in the preferences"

It's not the best english but i hope you understand...

for the first question.

For the second also in the terminal write the message

Impossible open the file lock /var/lib/apt/lists/lock - open (2 no fyle or directory)
"It's impossible to lock the directory of the list"

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

sudo fuser -vki /var/lib/dpkg/lock;sudo dpkg --configure -a

Will free up the packages, you should make sure there are no package accessing apps open, as Jean said.

Revision history for this message
moran60 (mele-more) said :
#5

I've wrote
sudo fuser -vki /var/lib/dpkg/lock;sudo dpkg --configure -a

to terminal.
Then i've tried with

sudo apt-get update

but the message is changed so:

Impossible open the file lock /var/lib/apt/lists/lock - open (20 is not a directory)
Impossible to create a lock on the directory lists

Revision history for this message
Sam_ (and-sam) said :
#6

> (20 is not a directory)

It's a file.
Close all package management related GUIs.
Try via CLI:

sudo rm /var/lib/apt/lists/lock
sudo apt-get update
sudo apt-get upgrade

In case try to switch to mainserver and verify you have correct sources enabled regarding distribution.
https://help.ubuntu.com/community/Repositories/Ubuntu#Download%20Server

http://www.ubuntu-it.org/

Revision history for this message
moran60 (mele-more) said :
#7

 Effects of your indications:

"raee@ubuntu:~/Desktop$ sudo rm /var/lib/apt/lists/lock
rm: impossible remove "/var/lib/apt/lists/lock": No file or directory
raee@ubuntu:~/Desktop$ sudo apt-get update
E: Impossible open il file of lock /var/lib/apt/lists/lock - open (2 No file or directory)
E: Impossible create a lock on the directory of list
raee@ubuntu:~/Desktop$ sudo apt-get upgrade
writing of the packages lists... Done
Generation of the dependencie's tree loading
writing state informations done
0 aggiornati, 0 installed, 0 to remove e 0 not aggiornati"

And now, what can I do?.

Revision history for this message
Sam_ (and-sam) said :
#8

> raee@ubuntu:~/Desktop$ sudo rm /var/lib/apt/lists/lock

moran,
you're doing it in ~/Desktop directory, which of course doesn't contain the lock file.

When you open a terminal, usually it opens in ~/ also known as /home/user.
You can verify it by typing:
pwd

## which stands for 'print working directory'

The output should look like this:
/home/raee

Just leave it this way and try again:
sudo rm /var/lib/apt/lists/lock
sudo apt-get update
sudo apt-get upgrade

https://help.ubuntu.com/10.04/basic-commands/C/

Revision history for this message
moran60 (mele-more) said :
#9

I haven't answered to your descriptions, because now the problem is return to work in my P.C. as I write in other question. But when I can use it, I remember that I had error's message to digit the commands

sudo apt-get update & sudo apt-get upgrade

Now I've found the mode to digit commmands non da raee/desktop bensì da root/desktop. I don't know if there's a sostantial difference, but digiting command

apt-get update

I have had better results, with a long list appearsed on the screen, but always with an error message at the end. Now I can't tell more.

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

As you just wrote you still have problems with apt-get "always with an error message at the end".
To be able to help we need to know what error message that is.
Can you please again open a terminal and enter the command
sudo apt-get update
and copy the output. (If it is very, very, very long and repeating the same error again and again, then showing just the first ten lines might be reasonable).

Revision history for this message
Sam_ (and-sam) said :
#11

> raee/desktop bensì da root/desktop don't know if there's a sostantial difference

Yep, there is a substantial difference, one is the desktop directory of user, the other of root.
You don't need to change the directory to whatever 'desktop', commands won't work in there.
Anyway, just open a terminal and run the 'update' commands and post output here.

Just for future reference.
http://wiki.ubuntu-it.org/Documentazione/Indice

Revision history for this message
J. Austin Rodriguez (jeanaustinr) said :
#12

Or you can post the results here http://pastebin.ubuntu.com/ and then point us to the link generated

Revision history for this message
moran60 (mele-more) said :
#13

I can return to this error message after various problems. I've tried a number of solutions, together yours, that I've found in forums and similar discussions. But they are as a code that cat eat to itself.
sudo apt-get update
sudo apt-get install -f
sudo dpkg --configure -a
sudo rm var/lib/....
sudo fuser vki...
and other commands are the first that give that error message. i running those with only mouse or keyboard attached in P.C.; with the other applications closed or with Internet opened. With raee/user, root/user and home/user/root and solutions that for other member has been good, but the error is always here. The real problem, perhaps, is that I don't know as it's begun. Now when I return at home, I'll post that asks Samantha... and we see where is the truc(trucco).
If my friend helpme, I'd already formatted all, but he's always busy

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#14

Try:

sudo fuser -vki /var/lib/dpkg/lock;sudo dpkg --configure -a

May help

Revision history for this message
Sam_ (and-sam) said :
#15

moran,
there is no need to format the disk. When the issue occurs again what then, format again?

Please try to follow user requests otherwise it remains difficult to help, thanks.
Just open a terminal and type at first:
pwd

then type:
sudo apt-get update
sudo apt-get upgrade

Please post complete output, don't shorten anything or leave anything out, thanks.

Revision history for this message
moran60 (mele-more) said :
#16

Here I am with the post of the commands you asked:

raee@ubuntu:-/Scrivania$ pwd
/home/raee/Scrivania

raee@ubuntu:-/Scrivania$ sudo apt-get update
password for raee:
Ign http://ppa.launchpad.net jaunty Release.gpg
Ign http://ppa.launchpad.net jaunty/main Translation-it
GET:1 http://ppa.launchpad.net jaunty Release
Ign http://ppa.launchpad.net jaunty/main Packages
Ign http://ppa.launchpad.net jaunty/main Sources
Ign http://ppa.launchpad.net jaunty/main Packages
Ign http://ppa.launchpad.net jaunty/main Sources
GET:2 http://ppa.launchpad.net jaunty/main Packages
GET:3 http://ppa.launchpad.net jaunty/main Sources

Scaricato 11,1kb in 0s (23,6kb/s)

E: impossibile aprire il file di lock in /var/lib/dpkg/lock - (20 - non è una directory)
[Could not open lock in /var/lib/dpkg/lock - (20 - no file or directory]
E: Impossibile acquisire il blocco sulla directory di amministrazione (/var/lib/dpkg/). E' necessario essere root.
[It's impossible create a lock in the directory's list. It's need to be root]

raee@ubuntu:-/Scrivania$ sudo apt-get upgrade

E: impossibile aprire il file di lock in /var/lib/dpkg/lock - (20 - non è una directory)
[Could not open lock in /var/lib/dpkg/lock - (20 - no file or directory)
E: Impossibile acquisire il blocco sulla directory di amministrazione (/var/lib/dpkg/). E' necessario essere root.
[It's impossible create a lock in the directory's list. It's need to be root]

Passing the ball to you, thanks for your interest (I've posted manually the questions...)
For the same message (more and than) I cannot use synaptic, update manager, add/remove applications, etc...as wrote... at the base of the problem and in the answer of the command:

sudo fuser -vki /var/lib/dpkg/lock;sudo dpkg --configure -a

That don't open nothing solution, with similar message...I'm in the dark night, light on...
(Ah...my dark English...)

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#17

Jaunty is no longer supported so you will not get updates or support in the official ubuntu channels and here

Revision history for this message
moran60 (mele-more) said :
#18

And then what does I must do? Do I must take it lost? Don't you help me?
I don't know because this thing is succeed and I don't must solve it?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#19

i suggest you upgrade to Lucid, Maverick or Natty (Natty is released in April). You may get luck with:

sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
sudo aptitude clean
sudo aptitude autoclean
sudo apt-get update
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo aptitude install -f
sudo aptitude update
sudo aptitude dist-upgrade

Revision history for this message
moran60 (mele-more) said :
#20

Thanks you very much. I'll tried this solution you gently suggest. It's as round around the same commands, but I'd never tried in this order. I hope to unlock something, so I finish to break the balls, vulgarly said. (Oh, excuse me...I never change...)
I'll know you tell...

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

The error message "E: impossibile aprire il file di lock in /var/lib/dpkg/lock - (20 - non è una directory)" points me towards a different direction (is /var/lib/dpkg a directory?).

Can you please execute the following commands and show us the output

file /var
file /var/lib
file /var/lib/dpkg
file /var/lib/dpkg/lock
ls -la /var/lib/dpkg

Revision history for this message
moran60 (mele-more) said :
#22

Excuse me the stupid ask. Tomorrow I don't connect...for family's problems...
What's do you intend as file? I must write just "file" or what?
For the suggest of actionparsnip, it don't succeed nothing of better. The problem and the messages remain the same. I couldn't post the post, because router don't me give the access to internet in these day. But now I try the new indications if the situation is better, when I return at home...
Thanks...

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

I agree that some of the commands in unix look cryptic to the user.

The command 'file' tries to identify what kind of contents a file has - if it is a text file, an executable, a directory file, empty, ...
My approach is to find out if the directory tree (well, at least the part used by package management) on your system is correct. So please issue the commands in a terminal, just as written above, and provide us with the output.

file /var
file /var/lib
file /var/lib/dpkg
file /var/lib/dpkg/lock
ls -la /var/lib/dpkg

Revision history for this message
moran60 (mele-more) said :
#24

Here's the post:

file /var
/var: directory

file /var/lib
/var/lib: directory

file /var/lib/dpkg
/var/lib/dpkg: very short file (no magic)

file /var/lib/dpkg/lock
/var/lib/dpkg/lock ERROR: cannot open 'var/lib/dpkg/lock' (not a directory)

ls -la /var/lib/dpkg
-rw-r--r-- 1 root root 1 feb 7 13:26 /var/lib/dpkg

I've made as "root@ubuntu$" because i must open desktop with startx, the terminal is opened so and I must remake all configurations, but it's another question.
Coming to us, I wait other indications...

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

"file /var/lib/dpkg
/var/lib/dpkg: very short file (no magic)"

I assume that is the problem. Instead of being a directory with files under it, /var/lib/dpkg is a plain file. Correcting that should make the package management programs run again.

Please execute the following commands from a terminal:

sudo rm /var/lib/dpkg
sudo mkdir --mode=644 /var/lib/dpkg
sudo dpkg --configure -a

and report if there are still error messages, or if it seems to be working as it should..

If there are no error messages any more, you can continue with

sudo apt-get update
sudo apt-get upgrade

Revision history for this message
moran60 (mele-more) said :
#26

sudo rm /var/lib/dpkg
sudo mkdir --mode = 644 /var/lib/dpkg
sudo dpkg --configure -a
"Unable to access dpkg status <area>: no such file or directory"

Update and upgrade always the same message

I've leaved my computer so.

The first time the error message was

"dpkg: failed to open package info file '/var/lib/dpkg/status' for reading: no such file or directory"
and update & upgrade were more complicated. Then I've close P.C & when I repeat the commands were changed. What's error message was better?

I hope don't make difference...but i lose myself in a glass of water. With my mother in hospital for a little operation, it succeed...

This evening I can return to be busy with my computer because she already made it and she's fine
Excuse me my divagations...

Aren't you tired to help me, if it possible...thanks.

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

As it can be seen from the messages above, you had a problem in your system, that the directory /var/lib/dpkg somehow got broken. Although the commands above have now recreated the directory file, the contents have not been restored. And the contents are rather important, because they are the inventory of the package management systems, telling which packages are installed on your system.

Google shows a few possibilities about how to try to recreate the contents, e.g. http://qref.sourceforge.net/Debian/reference/examples/debian-package-database-rebuild (needs modifications for ubuntu first!), but I am not sure if any of the procedures will provide everything needed for your system to run reasonably well. Of course if you have a recent backup of the files in that directory, restoring them would be all you need.

I am sorry to say, but I guess you should consider re-installing your system. As some of the logs above indicate that you are still using jaunty (9.04, which is already declared end of live since Oct. 23rd 2010), you should download one of the current versions (10.04 LTS or 10.10) and start with a clean install of a new system. This hopefully will remedy all other problems you mentioned above like the graphical desktop environment not starting. Don't forget to save all documents before starting the rebirth of your system.

Just a last remark: I realized that the file mode that I wrote in my previous post was not completely right, although I do not expect that it makes any difference.
You might correct it by
sudo chmod 755 /var/lib/dpkg

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

Wait a moment, just found out something that might help.
You should have some backup files automatically created in /var/backups

If you have a file named dpkg.status.0 in the /var/backups directory you might try this:

sudo chmod 755 /var/lib/dpkg
sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status

then try

sudo dpkg --configure -a

Revision history for this message
moran60 (mele-more) said :
#29

sudo chmod 755 /var/lib/dpkg
chmod: cannot access '/var/lib/dpkg': no such file or directory

sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
cp: cannot create regular file '/var/lib/dpkg/status': no such file or directory

sudo dpkg --configure -a
unable to access to dpkg status area: no such file or directory

It's seems ìt's hard to solve this problem...
I need of my friend, to change version of Ubuntu, because he had installed this version and he have cd for install operative system, but I find him always busy and makes me wait for his help. And I walk in the labirint of P.C., as one that drink alcoholic drinks. as I made until to 15 year ago. But like I won that battle, I hope to solve this question, always if it possible...
Compliments for your patience...
P.S.
Is there a system to see if I have a file named dpkg.status.0?
As do I must enter in /var/backups directory?
Is it important yet?

I remain in your hands, until you help me...
So I know a lot of things...also to use this operative system. And what it don't makes, when it's goes in the right way!

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

As we have seen from the dialogue above, your system had a severe problem in the files where the package management stores its data.

I think it is time for a decision between two possibilities:

1. There are techniques to reconstruct the contents of the broken directory, but I do not know if that ever will deliver a system that is stable and consistent, and which can then be upgraded to up-to-date versions without further hassle. (Note that your version is already declared 'end-of-live' and should be upgraded to a current version.)

2. Starting from scratch with installing a new and current version of Ubuntu will provide you with a clean system without errors and inconsistencies.

It is up to you to decide what way you want to go. You might take into account the amount of support that you can get from your local friend, the capabilities of your hardware (including internet connection specifics), whether you have spent much effort in configuring your system as you have it now, if you have equipment to make a backup of your current files, etc.etc. Whichever way you want to go, I am sure that you will find support in the community when you need. If you need more information for taking a decision please do not hesitate to ask.

Revision history for this message
moran60 (mele-more) said :
#31

It's the same problem that I have from the start of this question. If I had had the support of my friend, I had not had this difficult question. It-s three months that I ask to him to dedicate to me a moment, without results. It's clear that the second way to solve the problem it's the way that I must do. But like can I do. if I must do it by myself, without support of installing cd, always I need of it?
If the first solution is only lost time, what does I need to install the version of ubuntu that you suggest? Can I do it with only your help?
You are very good and patient with me, in every way...(I'm glad you understand my english, and I understand yours, more correct...)

Revision history for this message
Sam_ (and-sam) said :
#32

Did you actually review the link provided above, which incl. all info you need in italian?
http://www.ubuntu-it.org/
http://wiki.ubuntu-it.org/Documentazione
http://help.ubuntu-it.org/

Or contact italian team on IRC, maybe someone lives near you.
https://wiki.ubuntu.com/ItalianTeam

Revision history for this message
moran60 (mele-more) said :
#33

I've took a Cd installer and I'm trying to remasterize all