[SOLVED] Error: Target Sources (main/source/Sources) is configured multiple times in /etc/apt/sources.list:22
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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 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.
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.
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.
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
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?
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.