LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-29-2019, 11:39 PM   #1
Commomore
LQ Newbie
 
Registered: May 2018
Posts: 22

Rep: Reputation: Disabled
Error: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:22


I am trying to add sources to my repositories but I keep getting this error:

Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:22

This is my /etc/apt/sources.list:

# deb cdrom:[Debian GNU/Linux 9.7.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20190123-19:36]/ stretch main

deb cdrom:[Debian GNU/Linux 9.7.0 _Stretch_ - Official amd64 xfce-CD Binary-1 20190123-19:36]/ stretch main

# Line commented out by installer because it failed to verify:

# Line commented out by installer because it failed to verify:


# stretch-updates, previously known as 'volatile'
# A network mirror was not selected during install. The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.

deb http://security.debian.org/debian-security/ stretch/updates main
deb-src http://security.debian.org/debian-security/ stretch/updates main


deb http://deb.debian.org/debian/ stretch-updates main
deb-src http://deb.debian.org/debian/ stretch-updates main


deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
deb http://deb.debian.org/debian/ stretch main contrib non-free
deb-src http://deb.debian.org/debian/ stretch main contrib non-free

deb http://deb.debian.org/debian/ stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian/ stretch-updates non-free contrib main

deb http://security.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://security.debian.org/debian-security/ stretch/updates main contrib non-free
 
Old 01-30-2019, 04:05 PM   #2
agillator
Member
 
Registered: Aug 2016
Distribution: Mint 19.1
Posts: 419

Rep: Reputation: Disabled
1. How are you attempting to add repositories?
2. What is in your /etc/apt/sources.list.d directory?
 
Old 01-30-2019, 04:39 PM   #3
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
It is a harmless error notifying you that there are redundant, duplicate entries in your sources.list. You may feel free to ignore this error.

What is the actual problem you are trying to solve?

Generally speaking, not a good idea to directly edit system files (like sources.list) unless you are 100% sure it is necessary, and that you know exactly what you are doing. No harm in this case, but it could have been a lot worse, you are lucky no damage was caused.

Last edited by snowday; 01-30-2019 at 04:41 PM.
 
Old 01-31-2019, 08:43 PM   #4
Commomore
LQ Newbie
 
Registered: May 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by agillator View Post
1. How are you attempting to add repositories?
2. What is in your /etc/apt/sources.list.d directory?
The /etc/apt/sources.list.d directory is empty. No file in there.
I edited /etc/apt/sources.list and added more repositories.
 
Old 01-31-2019, 08:46 PM   #5
Commomore
LQ Newbie
 
Registered: May 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by snowpine View Post
It is a harmless error notifying you that there are redundant, duplicate entries in your sources.list. You may feel free to ignore this error.

What is the actual problem you are trying to solve?

Generally speaking, not a good idea to directly edit system files (like sources.list) unless you are 100% sure it is necessary, and that you know exactly what you are doing. No harm in this case, but it could have been a lot worse, you are lucky no damage was caused.
But there are no duplicate entries in my sources.list file. But if it this is a harmless message then I don't need to care.
I thought this is the recommended way. How should I do it? Add the dipositories to Synaptic Package Manager?
Debian makes things difficult for users that aren't experts.
 
Old 01-31-2019, 10:37 PM   #6
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Quote:
Originally Posted by Commomore View Post
But there are no duplicate entries in my sources.list file. But if it this is a harmless message then I don't need to care.
I thought this is the recommended way. How should I do it? Add the dipositories to Synaptic Package Manager?
Debian makes things difficult for users that aren't experts.
I recommend to delete the following two lines. Do you see how they are defining the 'main' sources, and then you go ahead and define the 'main' sources again 2 lines later, thereby creating the duplicate?

Code:
deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
Or you can ignore the harmless warning message. Either way. Your choice. I do not think Linux is not difficult; I think Linux is easy. In this case, you made an error in a mission-critical system config, and Linux politely and non-judgmentally informed you of your human error so you can fix it. It even told you the exact line number (line 22) where the duplicate 'main' entry occurs.

I personally find that Windows and Mac are more difficult, because those "user friendly" operating systems like to hide the information you actually need to solve the problem; Windows and Mac probably would not so directly tell you the specific word you need to change on the specific line number of the specific file. The answer to your question is literally embedded within the question itself.
 
Old 01-31-2019, 10:45 PM   #7
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Maybe it will make mores sense if I take this:

Code:
deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
deb http://deb.debian.org/debian/ stretch main contrib non-free
deb-src http://deb.debian.org/debian/ stretch main contrib non-free
And re-write it like this:

Code:
deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
deb http://deb.debian.org/debian/ stretch main
deb http://deb.debian.org/debian/ stretch contrib
deb http://deb.debian.org/debian/ stretch non-free
deb-src http://deb.debian.org/debian/ stretch main 
deb-src http://deb.debian.org/debian/ stretch contrib
deb-src http://deb.debian.org/debian/ stretch non-free
Are the duplicate/redundant 'main' lines easier to see when I re-format the code like that?

Last edited by snowday; 01-31-2019 at 10:48 PM.
 
Old 02-01-2019, 01:09 AM   #8
Commomore
LQ Newbie
 
Registered: May 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by snowpine View Post
I recommend to delete the following two lines. Do you see how they are defining the 'main' sources, and then you go ahead and define the 'main' sources again 2 lines later, thereby creating the duplicate?

Code:
deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
Or you can ignore the harmless warning message. Either way. Your choice. I do not think Linux is not difficult; I think Linux is easy. In this case, you made an error in a mission-critical system config, and Linux politely and non-judgmentally informed you of your human error so you can fix it. It even told you the exact line number (line 22) where the duplicate 'main' entry occurs.

I personally find that Windows and Mac are more difficult, because those "user friendly" operating systems like to hide the information you actually need to solve the problem; Windows and Mac probably would not so directly tell you the specific word you need to change on the specific line number of the specific file. The answer to your question is literally embedded within the question itself.
Thanks. I appreciate linux and I will never use Windows again. I just think there should be an easier way to do this. Xubuntu made it easier and let's you add or remove repositories easily. Debian does not. That was what I was trying to say.
 
Old 02-01-2019, 01:18 AM   #9
Commomore
LQ Newbie
 
Registered: May 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by snowpine View Post
Maybe it will make mores sense if I take this:

Code:
deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
deb http://deb.debian.org/debian/ stretch main contrib non-free
deb-src http://deb.debian.org/debian/ stretch main contrib non-free
And re-write it like this:

Code:
deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
deb http://deb.debian.org/debian/ stretch main
deb http://deb.debian.org/debian/ stretch contrib
deb http://deb.debian.org/debian/ stretch non-free
deb-src http://deb.debian.org/debian/ stretch main 
deb-src http://deb.debian.org/debian/ stretch contrib
deb-src http://deb.debian.org/debian/ stretch non-free
Are the duplicate/redundant 'main' lines easier to see when I re-format the code like that?
I don't understand why you re-wrote it like that. I can see that line 2 and 6 are identical the way you wrote it. But none of the lines in my sources.list file are identical. Anyway, not that important since it won't break my system.
 
Old 02-01-2019, 04:03 AM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by Commomore View Post
I don't understand why you re-wrote it like that. I can see that line 2 and 6 are identical the way you wrote it. But none of the lines in my sources.list file are identical. Anyway, not that important since it won't break my system.
It doesn't matter if none of the lines are identical. main is mentioned multiple times for the same repos.

Please refer to https://wiki.debian.org/SourcesList#...e_sources.list and get rid of the following lines:

Code:
deb http://security.debian.org/debian-security/ stretch/updates main
deb-src http://security.debian.org/debian-security/ stretch/updates main

deb http://deb.debian.org/debian/ stretch-updates main
deb-src http://deb.debian.org/debian/ stretch-updates main

deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
 
Old 02-01-2019, 09:43 AM   #11
snowday
Senior Member
 
Registered: Feb 2009
Posts: 4,667

Rep: Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411Reputation: 1411
Quote:
Originally Posted by Commomore View Post
I don't understand why you re-wrote it like that. I can see that line 2 and 6 are identical the way you wrote it. But none of the lines in my sources.list file are identical. Anyway, not that important since it won't break my system.
And I honestly don't understand why you are editing a system file that you admittedly don't understand how it works. I'm sincerely not trying to be critical or belittling. I just don't understand what problem you were trying to solve by adding the 'main' repository multiple times. What was your purpose of doing this, and why do you think Debian should make it "easy" to do this?
 
Old 02-05-2019, 12:10 AM   #12
Commomore
LQ Newbie
 
Registered: May 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
It doesn't matter if none of the lines are identical. main is mentioned multiple times for the same repos.

Please refer to https://wiki.debian.org/SourcesList#...e_sources.list and get rid of the following lines:

Code:
deb http://security.debian.org/debian-security/ stretch/updates main
deb-src http://security.debian.org/debian-security/ stretch/updates main

deb http://deb.debian.org/debian/ stretch-updates main
deb-src http://deb.debian.org/debian/ stretch-updates main

deb http://deb.debian.org/debian/ stretch main
deb-src http://deb.debian.org/debian/ stretch main
Oh I see. Thank you.
 
Old 02-05-2019, 12:24 AM   #13
Commomore
LQ Newbie
 
Registered: May 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by snowpine View Post
And I honestly don't understand why you are editing a system file that you admittedly don't understand how it works. I'm sincerely not trying to be critical or belittling. I just don't understand what problem you were trying to solve by adding the 'main' repository multiple times. What was your purpose of doing this, and why do you think Debian should make it "easy" to do this?
I am not completely clueless. I have edited this file before and had no issues. Just wanted to add the non-free repository.

A turtle can't walk unless it sticks its head out of its shell. I tried it in order to learn. Maybe not the best approach.

Debian should make things simple out of empathy for new users and beginners. Maybe it's an ego thing. Some people have pointed that
out. I don't know.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
E: Type 'sudo' is not known on line 1 in source list /etc/apt/sources.list.d/mono-official.list 221B Linux - Newbie 6 09-07-2017 12:14 PM
E:Type 'Reading' is not known on line 53 in source list /etc/apt/sources.list, E:The hunterclan0405 Linux - Newbie 2 01-15-2011 11:08 PM
'E:Malformed line 54 in source list /etc/apt/sources.list (dist parse), E:The list of vsssuccess@gmail.com Linux - Desktop 1 11-17-2010 08:17 AM
apt-get; E: Type 'GPG' is not known on line 20 in source list /etc/apt/sources.list tomorrow Linux - Newbie 9 05-21-2009 08:42 AM
Need Recommendation for Debian Etch sources.list ( /etc/apt/sources.list ) forgox Debian 6 05-05-2007 01:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration