Sometimes, problems with Linux can seem like trying to swim with a blind fold on. You try to go in a straight line but inevitably go in circles while at the same time pumping your head into unseen obstacles.
Well, I've been running into problems with the Xandros GNU/Linux utility called Xandros Networks (XN) that is used to update the system. Actually, XN is sort of a front end for various Debian
utilities, the main one being apt-get.
In any case, the text below is the running commentary of my problem. It is partially solved, but as you will find out if you read through the entire thing, not completely so. Note, my comments are in
regular text and the replies, from someone called redrum, are in italics. I have to thank redrum for his never ending patience and willingness to
help. I am placing this here so I will have a record of what to do if this happens again (which it has).
--------------
Whenever I run XN or apt-get, I get an error saying it is unable to parse package file (see the full text below).
I'm using Desktop Professional version 4.
Any idea on the cause and a solution?
# apt-get update
Hit http://xnv4.xandros.com xandros4.0-xn/main Packages
Ign http://xnv4.xandros.com xandros4.0-xn/main Release
Hit http://xnv4.xandros.com xandros4.0-xn/contrib Packages
Ign http://xnv4.xandros.com xandros4.0-xn/contrib Release
Hit http://xnv4.xandros.com xandros4.0-xn/non-free Packages
Ign http://xnv4.xandros.com xandros4.0-xn/non-free Release
Hit http://xnv4.xandros.com unsupported4.0-xn/main Packages
Hit http://xnv4.xandros.com unsupported4.0-xn/main Release
Hit http://xnv4.xandros.com unsupported4.0-xn/contrib Packages
Hit http://xnv4.xandros.com unsupported4.0-xn/contrib Release
Hit http://xnv4.xandros.com unsupported4.0-xn/non-free Packages
Hit http://xnv4.xandros.com unsupported4.0-xn/non-free Release
Reading Package Lists... Error!
E: Unable to parse package file
/var/lib/apt/lists/xnv4.xandros.com_4.0_pkg_dists_xandros4.0-xn_main_binary-i386_Release
(1)
E: Problem opening
/var/lib/apt/lists/xnv4.xandros.com_4.0_pkg_dists_xandros4.0-xn_contrib_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
PostPosted: Wed Feb 07, 2007 Post subject:
Reply with quote
Check and see if you have the file /var/lib/dpkg/status.. If it does
not exist, as root, type cp /var/lib/dpkg/status_old var/lib/dpkg/status
Then try apt-get update again...
PostPosted: Thu Feb 08, 2007 Post subject: Reply with
quote Edit/Delete this post
Thanks for the reply but I checked for the file and it is there...
PostPosted: Thu Feb 08, 2007 Post subject:
Reply with quote
Ok, next log into root, make a new folder on your desktop, and copy the
contents (with the exception of the partial folder) of
/var/lib/apt/lists into that folder.
Then type apt-get update again and see what happens.
PostPosted: Thu Feb 08, 2007 Post subject: Reply with
quote Edit/Delete this post
To clarify, I copied the contents of the folder to my desktop (with the
exception of the folder named "partial"). However, if I were to run
apt-get update at that point without, I assume, deleting the contents
of the /list directory (there being no instructions to do so), this
would not materially affect things. So, I deleted the contents of the
directory (with the exception of the directory named "partial") and ran
apt-get update:
# apt-get update
Get:1 http://xnv4.xandros.com xandros4.0-xn/main Packages [376kB]
Get:2 http://xnv4.xandros.com xandros4.0-xn/main Release [77.7kB]
Get:3 http://xnv4.xandros.com xandros4.0-xn/contrib Packages [99B]
99% [3 Packages gzip 0] [Waiting for headers]
gzip: stdin: not in gzip format
Err http://xnv4.xandros.com xandros4.0-xn/contrib Packages
Sub-process gzip returned an error code (1)
Ign http://xnv4.xandros.com xandros4.0-xn/contrib Release
Get:4 http://xnv4.xandros.com xandros4.0-xn/non-free Packages [2527B]
Ign http://xnv4.xandros.com xandros4.0-xn/non-free Release
Get:5 http://xnv4.xandros.com unsupported4.0-xn/main Packages [4938kB]
Get:6 http://xnv4.xandros.com unsupported4.0-xn/main Release [95B]
Get:7 http://xnv4.xandros.com unsupported4.0-xn/contrib Packages
[74.5kB]
Get:8 http://xnv4.xandros.com unsupported4.0-xn/contrib Release [98B]
Get:9 http://xnv4.xandros.com unsupported4.0-xn/non-free Packages
[77.7kB]
Get:10 http://xnv4.xandros.com unsupported4.0-xn/non-free Release [99B]
Fetched 5547kB in 29s (188kB/s)
Failed to fetch
http://xnv4.xandros.com/4.0/pkg/dists/xandros4.0-xn/contrib/binary-i386/Packages.gz
Sub-process gzip returned an error code (1)
Reading Package Lists... Error!
E: Unable to parse package file
/var/lib/apt/lists/xnv4.xandros.com_4.0_pkg_dists_xandros4.0-xn_main_binary-i386_Release
(1)
E: Problem opening
/var/lib/apt/lists/xnv4.xandros.com_4.0_pkg_dists_xandros4.0-xn_non-free_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
PostPosted: Thu Feb 08, 2007 Post subject:
Reply with quote
Yes, that is what I wanted to try, and I apologize for not being more
specific.. So we verified that's not going to fix the problem.. Lets go
ahead and restore the copied folders to the folder and try something
else..
As root, lets back up your current status file:
mv /var/lib/dpkg/status /var/lib/dpkg/status.bak
Then lets restore the file using the status_old file:
cp /var/lib/dpkg/status_old var/lib/dpkg/status
Then try apt-get update again...
PostPosted: Thu Feb 08, 2007 Post subject: Reply with
quote Edit/Delete this post
First, thank you for your continuing patience and willingness to help
me with this problem. I appreciate the help.
Now, to clarify and to keep a record for anyone who may need
to do the same, I made the backup copy of status to status.bak. But I
then could not find a "status_old" file. However, I did find a
"status-old" file (note the hyphen rather than the underscore).
I assumed this was the file you were referring to and
therefore renamed it to "status" and ran apt-get update:
apt-get update
Get:1 http://xnv4.xandros.com xandros4.0-xn/main Packages [376kB]
Get:2 http://xnv4.xandros.com xandros4.0-xn/main Release [77.7kB]
Hit http://xnv4.xandros.com xandros4.0-xn/contrib Packages
Ign http://xnv4.xandros.com xandros4.0-xn/contrib Release
Hit http://xnv4.xandros.com xandros4.0-xn/non-free Packages
Ign http://xnv4.xandros.com xandros4.0-xn/non-free Release
Hit http://xnv4.xandros.com unsupported4.0-xn/main Packages
Hit http://xnv4.xandros.com unsupported4.0-xn/main Release
Hit http://xnv4.xandros.com unsupported4.0-xn/contrib Packages
Hit http://xnv4.xandros.com unsupported4.0-xn/contrib Release
Hit http://xnv4.xandros.com unsupported4.0-xn/non-free Packages
Hit http://xnv4.xandros.com unsupported4.0-xn/non-free Release
Fetched 454kB in 24s (18.7kB/s)
Reading Package Lists... Error!
E: Unable to parse package file
/var/lib/apt/lists/xnv4.xandros.com_4.0_pkg_dists_xandros4.0-xn_main_binary-i386_Release
(1)
E: Problem opening
/var/lib/apt/lists/xnv4.xandros.com_4.0_pkg_dists_xandros4.0-xn_contrib_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.
PostPosted: Thu Feb 08, 2007 Post subject:
Reply with quote
Hey no prob... I live for challenges, lol.. Anyways lets restore your
status file by typing the following commands as root.. (and yes, its a
hyphen, sorry..)
rm /var/lib/dpkg/status
/var/lib/dpkg/status.bak /var/lib/dpkg/status
Now for a question... Does the file
'/var/lib/apt/lists/xnv4.xandros.com_4.0_pkg_dists_xandros4.0-xn_main_binary-i386_Release
(1)' actually exist?
PostPosted: Fri Feb 09, 2007 Post subject: Reply with
quote Edit/Delete this post
No, it does not. Although there is one that is the same except for the
"(1)" at the end of the name.
PostPosted: Thu Feb 22, 2007 Post subject: Reply with
quote Edit/Delete this post
See this bug report which appears to be this problem:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=388708
If it is, how can this be corrected in Xandros?
PostPosted: Thu Feb 22, 2007 Post subject:
Reply with quote
Try commenting out (putting a number sign in front of) all lines in
your /etc/apt/sources.list
Then try typing as root apt-get update and see what
happens.. if all seems OK try opening XN and re-enabling the main
source.
PostPosted: Fri Feb 23, 2007 Post subject: Reply with
quote Edit/Delete this post Delete this post
Okay, this sort of solved the problem.
As root, I opened the file /etc/apt/sources.list in an editor
and typed in the number sign in front of all the lines in the file:
# deb http://xnv4.xandros.com/4.0/pkg xandros4.0-xn main
contrib non-free
# deb http://xnv4.xandros.com/4.0/upkg-i386 unsupported4.0-xn main
contrib non-free
I then saved the file and exited the editor. Then, still as
root and at the command line, I typed in apt-get update. This ran
without errors. So exited the command line and clicked on the desktop
icon for Xandros Networks (XN).
Once that was running, I clicked on the "Edit" menu and chose
"Set Application Sources". And finally, I clicked on the "Xandros
distribution site" box, which enabled this and clicked on the "OK"
button.
At that point, everything seemed to be working. That is, I no
longer got any errors in XN nor when I ran apt-get update at the
command line. However, as soon as I clicked on the "Install All Latest
Updates from Xandros" icon, I got the:
Unable to parse package file
/var/lib/apt/lists/xnv4.xandros.com_4.0_pkg_dists_xandros4.0-xn_main_binary-i386_Release
(1)
Problem opening
/var/lib/apt/lists/xnv4.xandros.com_4.0_pkg_dists_xandros4.0-xn_contrib_binary-i386_Packages
The package lists or status file could not be parsed or opened.
Strangely enough, unlike before, XN and apt-get update still
otherwise run without errors. That said, even though "News" says there
are security updates in "Application Updates", when I click on
Application Updates, it is empty. Perhaps this is unrelated. Perhaps
not.
Any ideas?
Aloha