Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Backup and update not working.

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Gnigma
Posts: 15
Joined: 2020-02-05 14:02

Backup and update not working.

#1 Post by Gnigma »

I keep getting an error message on both of these:

E: Malformed entry 26 in list file /etc/apt/sources.list (Component)
E: The list of sources could not be read.

I don't know what this means, and there are not 26 of anything in any of my sources lists.

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Backup and update not working.

#2 Post by sgosnell »

It means line 26 (!) of your /etc/apt/sources.list file. If you post the contents of the file, perhaps someone can find the error. But without that, no one can possibly help you further.
Take my advice, I'm not using it.

Gnigma
Posts: 15
Joined: 2020-02-05 14:02

Re: Backup and update not working.

#3 Post by Gnigma »

Then there must be a way to get the contents of the file, but I'm telling you, there are not 26 lines in anything I can look at.

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Backup and update not working.

#4 Post by LE_746F6D617A7A69 »

Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

Gnigma
Posts: 15
Joined: 2020-02-05 14:02

Re: Backup and update not working.

#5 Post by Gnigma »

It annoys the hell out of me, too.

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Backup and update not working.

#6 Post by sgosnell »

You can get the contents of the file, just like with any other file, by opening it with a text editor or by running in a terminal

Code: Select all

cat /etc/apt/sources.list
Just like you did in one of the threads linked above. You said you cleaned it up, but apparently the cleaning went awry.
Take my advice, I'm not using it.

Gnigma
Posts: 15
Joined: 2020-02-05 14:02

Re: Backup and update not working.

#7 Post by Gnigma »

Yeah, well, that gives me this:

cat /etc/apt/sources.list
#


# deb cdrom:[Debian GNU/Linux 10.2.0 _Buster_ - Official amd64 NETINST 20191116-09:56]/ buster main

deb http://ftp.us.debian.org/debian/ buster main contrib
deb-src http://ftp.us.debian.org/debian/ buster main contrib

deb http://ftp.us.debian.org/debian/ buster/updates main contrib
deb-src http://ftp.us.debian.org/debian/ buster/updates main contrib

# buster-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ buster-updates main contrib
deb-src http://ftp.us.debian.org/debian/ buster-updates main contrib

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.


I still do not see 26 lines.

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Backup and update not working.

#8 Post by sgosnell »

Try this. You don't need the source code, so comment those out to save time and bandwidth.

Code: Select all

deb http://ftp.us.debian.org/debian/ buster main contrib
#deb-src http://ftp.us.debian.org/debian/ buster main contrib
deb http://security.debian.org/debian-security/ buster/updates main contrib
#deb-src http://security.debian.org/debian-security/ buster/updates main contrib

# buster-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ buster-updates main contrib 
#deb-src http://deb.debian.org/debian/ buster-updates main contrib  
Get rid of everything else. There may be stray unprintable characters in the file somewhere.
Take my advice, I'm not using it.

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Backup and update not working.

#9 Post by LE_746F6D617A7A69 »

sgosnell wrote:Get rid of everything else.
There's a catch in this sentence: most likely the sources.list has been damaged by using wrong editor/text encoding ;)
I would say that it's better to backup the old file and create a completely new one using f.e. the nano editor as root.

Anyway, it would be nice to see the output of:

Code: Select all

xxd -g1 /etc/apt/sources.list
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

Gnigma
Posts: 15
Joined: 2020-02-05 14:02

Re: Backup and update not working.

#10 Post by Gnigma »

xxd -g1 /etc/apt/sources.list
00000000: 23 20 0a 0a 0a 23 20 64 65 62 20 63 64 72 6f 6d # ...# deb cdrom
00000010: 3a 5b 44 65 62 69 61 6e 20 47 4e 55 2f 4c 69 6e :[Debian GNU/Lin
00000020: 75 78 20 31 30 2e 32 2e 30 20 5f 42 75 73 74 65 ux 10.2.0 _Buste
00000030: 72 5f 20 2d 20 4f 66 66 69 63 69 61 6c 20 61 6d r_ - Official am
00000040: 64 36 34 20 4e 45 54 49 4e 53 54 20 32 30 31 39 d64 NETINST 2019
00000050: 31 31 31 36 2d 30 39 3a 35 36 5d 2f 20 62 75 73 1116-09:56]/ bus
00000060: 74 65 72 20 6d 61 69 6e 0a 0a 64 65 62 20 68 74 ter main..deb ht
00000070: 74 70 3a 2f 2f 66 74 70 2e 75 73 2e 64 65 62 69 tp://ftp.us.debi
00000080: 61 6e 2e 6f 72 67 2f 64 65 62 69 61 6e 2f 20 62 an.org/debian/ b
00000090: 75 73 74 65 72 20 63 6f 6e 74 72 69 62 20 6d 61 uster contrib ma
000000a0: 69 6e 0a 64 65 62 2d 73 72 63 20 68 74 74 70 3a in.deb-src http:
000000b0: 2f 2f 66 74 70 2e 75 73 2e 64 65 62 69 61 6e 2e //ftp.us.debian.
000000c0: 6f 72 67 2f 64 65 62 69 61 6e 2f 20 62 75 73 74 org/debian/ bust
000000d0: 65 72 20 6d 61 69 6e 20 63 6f 6e 74 72 69 62 0a er main contrib.
000000e0: 0a 64 65 62 20 68 74 74 70 3a 2f 2f 66 74 70 2e .deb http://ftp.
000000f0: 75 73 2e 64 65 62 69 61 6e 2e 6f 72 67 2f 64 65 us.debian.org/de
00000100: 62 69 61 6e 2f 20 62 75 73 74 65 72 2f 75 70 64 bian/ buster/upd
00000110: 61 74 65 73 20 6d 61 69 6e 20 63 6f 6e 74 72 69 ates main contri
00000120: 62 0a 64 65 62 2d 73 72 63 20 68 74 74 70 3a 2f b.deb-src http:/
00000130: 2f 66 74 70 2e 75 73 2e 64 65 62 69 61 6e 2e 6f /ftp.us.debian.o
00000140: 72 67 2f 64 65 62 69 61 6e 2f 20 62 75 73 74 65 rg/debian/ buste
00000150: 72 2f 75 70 64 61 74 65 73 20 6d 61 69 6e 20 63 r/updates main c
00000160: 6f 6e 74 72 69 62 0a 0a 23 20 62 75 73 74 65 72 ontrib..# buster
00000170: 2d 75 70 64 61 74 65 73 2c 20 70 72 65 76 69 6f -updates, previo
00000180: 75 73 6c 79 20 6b 6e 6f 77 6e 20 61 73 20 27 76 usly known as 'v
00000190: 6f 6c 61 74 69 6c 65 27 0a 64 65 62 20 68 74 74 olatile'.deb htt
000001a0: 70 3a 2f 2f 66 74 70 2e 75 73 2e 64 65 62 69 61 p://ftp.us.debia
000001b0: 6e 2e 6f 72 67 2f 64 65 62 69 61 6e 2f 20 62 75 n.org/debian/ bu
000001c0: 73 74 65 72 2d 75 70 64 61 74 65 73 20 6d 61 69 ster-updates mai
000001d0: 6e 20 63 6f 6e 74 72 69 62 0a 64 65 62 2d 73 72 n contrib.deb-sr
000001e0: 63 20 68 74 74 70 3a 2f 2f 66 74 70 2e 75 73 2e c http://ftp.us.
000001f0: 64 65 62 69 61 6e 2e 6f 72 67 2f 64 65 62 69 61 debian.org/debia
00000200: 6e 2f 20 62 75 73 74 65 72 2d 75 70 64 61 74 65 n/ buster-update
00000210: 73 20 6d 61 69 6e 20 63 6f 6e 74 72 69 62 0a 0a s main contrib..
00000220: 23 20 54 68 69 73 20 73 79 73 74 65 6d 20 77 61 # This system wa
00000230: 73 20 69 6e 73 74 61 6c 6c 65 64 20 75 73 69 6e s installed usin
00000240: 67 20 73 6d 61 6c 6c 20 72 65 6d 6f 76 61 62 6c g small removabl
00000250: 65 20 6d 65 64 69 61 0a 23 20 28 65 2e 67 2e 20 e media.# (e.g.
00000260: 6e 65 74 69 6e 73 74 2c 20 6c 69 76 65 20 6f 72 netinst, live or
00000270: 20 73 69 6e 67 6c 65 20 43 44 29 2e 20 54 68 65 single CD). The
00000280: 20 6d 61 74 63 68 69 6e 67 20 22 64 65 62 20 63 matching "deb c
00000290: 64 72 6f 6d 22 0a 23 20 65 6e 74 72 69 65 73 20 drom".# entries
000002a0: 77 65 72 65 20 64 69 73 61 62 6c 65 64 20 61 74 were disabled at
000002b0: 20 74 68 65 20 65 6e 64 20 6f 66 20 74 68 65 20 the end of the
000002c0: 69 6e 73 74 61 6c 6c 61 74 69 6f 6e 20 70 72 6f installation pro
000002d0: 63 65 73 73 2e 0a 23 20 46 6f 72 20 69 6e 66 6f cess..# For info
000002e0: 72 6d 61 74 69 6f 6e 20 61 62 6f 75 74 20 68 6f rmation about ho
000002f0: 77 20 74 6f 20 63 6f 6e 66 69 67 75 72 65 20 61 w to configure a
00000300: 70 74 20 70 61 63 6b 61 67 65 20 73 6f 75 72 63 pt package sourc
00000310: 65 73 2c 0a 23 20 73 65 65 20 74 68 65 20 73 6f es,.# see the so
00000320: 75 72 63 65 73 2e 6c 69 73 74 28 35 29 20 6d 61 urces.list(5) ma
00000330: 6e 75 61 6c 2e 0a 23 20 64 65 62 2d 73 72 63 20 nual..# deb-src
00000340: 68 74 74 70 3a 2f 2f 66 74 70 2e 75 73 2e 64 65 http://ftp.us.de
00000350: 62 69 61 6e 2e 6f 72 67 2f 64 65 62 69 61 6e 2f bian.org/debian/
00000360: 20 62 75 73 74 65 72 20 6d 61 69 6e 20 63 6f 6e buster main con
00000370: 74 72 69 62 0a trib.

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Backup and update not working.

#11 Post by LE_746F6D617A7A69 »

The text encoding is correct (plain ASCII) - so the problem is somewhere else.

Side note: can You please learn how to use Code tags?
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Backup and update not working.

#12 Post by Head_on_a_Stick »

LE_746F6D617A7A69 wrote:I would say that it's better to backup the old file and create a completely new one using f.e. the nano editor as root
^ This.

But text editors are bloat:

Code: Select all

sudo tee /etc/apt/sources.list <<END
deb https://deb.debian.org/debian buster main contrib non-free
deb https://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb https://deb.debian.org/debian buster-updates main contrib non-free
END
Here documents ftw!
deadbang

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Backup and update not working.

#13 Post by LE_746F6D617A7A69 »

Head_on_a_Stick wrote:But text editors are bloat
Got You!
If the text editors are so bad / bloated, then how are You writing/editing Your posts without using that bloated editors? hmm? :mrgreen:

But seriously:
That hex dump of sources.list shows that the file is correct - the count of bytes containing newlines (0x0A) is 21 -> 20 text lines + 1 newline at the end of the file -> so how it is possible that apt reports an error at line 26?

Something smells here ...
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

CwF
Global Moderator
Global Moderator
Posts: 2715
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 201 times

Re: Backup and update not working.

#14 Post by CwF »

I have navigated to etc/apt/sources.list in Thunar and right clicked to edit as root in Mousepad, but I usually edit the repositories in Synaptic itself. Works fine. No special chants or sacrifices.

OP should check in etc/apt/sources.d and etc/apt/preferences.d for oddities.

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Backup and update not working.

#15 Post by sgosnell »

Apt also reads files in etc/apt/sources.list.d. Check if there are iany files in that directory, and if so, please post them. Seeing your history, I would bet a small sum that there are leftover files there, perhaps from the Ubuntu PPAs or other installed packages.
Take my advice, I'm not using it.

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Backup and update not working.

#16 Post by cuckooflew »

-> so how it is possible that apt reports an error at line 26?

Something smells here ...
I notice that here: http://forums.debian.net/viewtopic.php? ... 04#p726538
The /etc/apt/sources.list file does have more the 26 lines, 28 to be exact... Any way, I agree,
You said you cleaned it up, but apparently the cleaning went awry.
Is probably what happened, I wonder if the OP also ran 'apt update' after editing the file ?
Probably would be best to delete/remove the old one, and start fresh with a good sources.list file , EG: the example shown here
sgosnell wrote:Try this. You don't need the source code, so comment those out to save time and bandwidth.

Code: Select all

deb http://ftp.us.debian.org/debian/ buster main contrib
#deb-src http://ftp.us.debian.org/debian/ buster main contrib
deb http://security.debian.org/debian-security/ buster/updates main contrib
#deb-src http://security.debian.org/debian-security/ buster/updates main contrib

# buster-updates, previously known as 'volatile'
deb http://deb.debian.org/debian/ buster-updates main contrib 
#deb-src http://deb.debian.org/debian/ buster-updates main contrib  
Get rid of everything else. There may be stray unprintable characters in the file somewhere.
Be sure to run 'apt update' after replacing or editing the file, if you don't do that the changes will not take effect, and you will still get the same error. I guess apt stores the file in some cache or something, and does not refresh that, until 'apt update' is run, in other words it must be updated first.
Something similar happened to me years ago, after I edited my sources.list file, it still said it could not find the repository I had added, I double checked, and yes I had added the lines I needed, so I was baffled, and started reading the "apt-get" documentation, and also searching, some where it was mentioned that 'apt-get update' needed to be run, in order to update it.
========================
It was this: https://www.debian.org/doc/manuals/apt- ... co.en.html
Do not forget to run apt-get update after modifying the /etc/apt/sources.list file. You must do this to let APT obtain the package lists from the sources you specified.
It is now "obsolete " but uses debian stable as the example, ...
Also the manual says:
https://manpages.debian.org/buster/apt/ ... .5.en.html
The information available from the configured sources is acquired by apt-get update (or by an equivalent command from another APT front-end).
Not as clear as the older documentation, and I don't see any where on the debian wiki where they mention it,... seems like it used to, but any way that is another topic,...
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Backup and update not working.

#17 Post by LE_746F6D617A7A69 »

sgosnell wrote:Apt also reads files in etc/apt/sources.list.d. Check if there are iany files in that directory, and if so, please post them. Seeing your history, I would bet a small sum that there are leftover files there, perhaps from the Ubuntu PPAs or other installed packages.
That could be possible, but the error message is:
Gnigma wrote:E: Malformed entry 26 in list file /etc/apt/sources.list (Component)
E: The list of sources could not be read.
The hex dump showed that the encoding is correct, there are no invisible characters, and there are really only 20 lines of text -> so it's obvious that the error message has been generated for some other version of sources.list ...
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

Re: Backup and update not working.

#18 Post by sgosnell »

When apt does an update, it reads and concatenates sources.list plus the files in sources.list.d. At least that's my understanding. I've seen this happen when the error was in one of the files in sources.list.d, but the output in the terminal did not specify the file. The concatenated total is treated as one file, AFAIK.
Take my advice, I'm not using it.

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 68 times

Re: Backup and update not working.

#19 Post by LE_746F6D617A7A69 »

sgosnell wrote:When apt does an update, it reads and concatenates sources.list plus the files in sources.list.d. At least that's my understanding. I've seen this happen when the error was in one of the files in sources.list.d, but the output in the terminal did not specify the file. The concatenated total is treated as one file, AFAIK.
Yes, finally all the entries are used to download the updates, but in case if /etc/apt/sources.list.d/some_sources.list is malformed the error message would be:
E: Malformed line X in source list /etc/apt/sources.list.d/some_sources.list

I've just double-checked this - and this is not the case here.

EDIT !
I've just realized that the error message is different from the message reported by OP: different APT version? - definitely not Buster!
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Backup and update not working.

#20 Post by cuckooflew »

I just realized, kind of dumb on my part, obviously if there is a "mal formed" line, then one would not be able to run

Code: Select all

apt udate
after editing it.
The OP should show us again, what they actually have in both

Code: Select all

 /etc/apt/sources.list 
and in:

Code: Select all

/etc/apt/sources.list.d/some_sources.list 
But also use code boxes, to be sure it is clear.
I would just start with the first 3 basic, and essential sources, then add the additional lines as needed, run apt update each time, if and when it gets a line that breaks it again, it is easy to know it was that line, it needs to be corrected. Hope that makes sense, or in reverse start removing lines, until they get something that works,
so it's obvious that the error message has been generated for some other version of sources.list ...
Maybe there are some things the OP is not telling us, or a prankster has messed with their system and they don't know it :?: :mrgreen: :?:
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

Post Reply