Autor |
Nachricht |
|
Titel: Apt-get error
Verfasst am: 23.05.2006, 12:15 Uhr
|
|
Anmeldung: 14. Feb 2006
Beiträge: 73
|
|
I keep getting the following message in apt-get:
Unable to parse package file /etc/apt/preferences (1)
What does this mean?
How do I fix it?
In addition, Kpackage doesn't want to retrieve updated files....
Is this part of the same problem? |
|
|
|
|
 |
|
Titel: Apt-get error
Verfasst am: 23.05.2006, 12:26 Uhr
|
|
Team Member


Anmeldung: 06. Mai 2005
Beiträge: 3087
Wohnort: berlin
|
|
just add a linefeed (empty line) to /etc/apt/preferences, save and good to go.
greetz
devil |
_________________ <<We are Xorg - resistance is futile - you will be axximilated>>
Host/Kernel/OS "devilsbox" running[2.6.19-rc1-git5-kanotix-1KANOTIX-2006-01-RC4 ]
CPU Info AMD Athlon 64 3000+ clocked at [ 803.744 MHz ]
|
|
|
|
 |
|
Titel: Apt-get error
Verfasst am: 23.05.2006, 12:27 Uhr
|
|

Anmeldung: 05. Jul 2004
Beiträge: 121
Wohnort: Hannover
|
|
Hi!
As root:
Code:
echo >> /etc/apt/preferences
|
|
|
|
|
 |
|
Titel: Apt-get error
Verfasst am: 24.05.2006, 02:40 Uhr
|
|
Anmeldung: 14. Feb 2006
Beiträge: 73
|
|
That solved the problem nicely... |
_________________ Guerilla Penguinista
|
|
|
|
 |
|
Titel: RE: Apt-get error
Verfasst am: 04.06.2006, 04:58 Uhr
|
|
Anmeldung: 12. Apr 2006
Beiträge: 2
|
|
First submisson:
I just had the same no-parse problem with /etc/apt/preferences that aking469 had. I found this thread and used devil28's guidance, 'add a linefeed...' to solve this little poser.
Now I'm curious why that worked? It wasn't very intuitive from my, ancient newbie, side of the field (my last serious programming was done in Fortran - card punch machines and all!).
kilo hotel |
|
|
|
|
 |
|
Titel: RE: Apt-get error
Verfasst am: 04.06.2006, 06:28 Uhr
|
|
Team Member


Anmeldung: 06. Mai 2005
Beiträge: 3087
Wohnort: berlin
|
|
well, that empty line should have been there in the first place to meet unix file-format, but someone forgot.
apt upgraded itself to a new version and from then on demanded unix file-format and not dos file-format. who knows why....
btw.: old dogs can learn new operating systems:wink:
greetz
devil |
_________________ <<We are Xorg - resistance is futile - you will be axximilated>>
Host/Kernel/OS "devilsbox" running[2.6.19-rc1-git5-kanotix-1KANOTIX-2006-01-RC4 ]
CPU Info AMD Athlon 64 3000+ clocked at [ 803.744 MHz ]
|
|
|
|
 |
|
Titel: RE: Apt-get error
Verfasst am: 04.06.2006, 19:48 Uhr
|
|
Anmeldung: 12. Mar 2005
Beiträge: 1005
|
|
What's annoying is that all the package maintainers had to do was have apt add the linefeed to that file when the new apt package is installed. Why that wasn't done is hard to understand since there may be nothing easier to do.
A linefeed at the end will not alter the existing file in any way, and you can have a hundred extra line feeds without changing how apt works.
this one is definitely the weakest failing I've seen so far in debian sid, that should have been fixed within a day of the package release, but it's still in it.
I don't agree with devil28 as to the cause however, the absence of a linefeed does not have to be a dos/unix issue, it's simply how the file is parsed.
As I've noted before, .htaccess files have the same issue, the parser goes through them line by line, it knows it's reached the end of a line by the presence of the \n character, linefeed.
So what happens when you don't have that linefeed on the last line? The parser sits there, waiting for the last line to be parsed, but it can't be parsed, because it doesn't end.
If you remove the linefeed from the last line of any website using .htaccess files, the entire website will instantly fail, with a 500 error, for I assume the exact same reason.
So I'd guess, though I could of course be wrong, that apt simply changed how it parses it, not sure exactly what the change would be. With htacess, this has nothing to do with dos/unix at all, it's just the presence or absence of a closing \n character on each line. And since it's by definition present on each line before the last line, the only line that could suffer from its absence would be the last line.
I have scripts that parse input slightly differently, they parse each line after a line feed, so if the last one doesn't have it, it still gets parsed, but there are different ways to do it. |
|
|
|
|
 |
|
Titel: RE: Apt-get error
Verfasst am: 04.06.2006, 22:03 Uhr
|
|
Anmeldung: 12. Apr 2006
Beiträge: 2
|
|
devil,
Thanks!
re: "btw.: old dogs can learn new operating systems:wink:"
It would seem the latter have the bulge on the former:nudge:
73, kilo hotel |
|
|
|
|
 |
|
Titel: Re: RE: Apt-get error
Verfasst am: 08.06.2006, 10:09 Uhr
|
|
Anmeldung: 19. Mai 2006
Beiträge: 5
|
|
ai4kh hat folgendes geschrieben::
First submisson:
I just had the same no-parse problem with /etc/apt/preferences that aking469 had. I found this thread and used devil28's guidance, 'add a linefeed...' to solve this little poser.
Now I'm curious why that worked? It wasn't very intuitive from my, ancient newbie, side of the field (my last serious programming was done in Fortran - card punch machines and all!).
kilo hotel
Same here. Actually, this is the 2nd time I tried to correct this problem...after inserting the linefeed at the beginning of /apt/preferences, I inserted it at the end, now everything is working again. |
|
|
|
|
 |
|