LinuxQuestions.org
Visit Jeremy's Blog.
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 03-14-2014, 09:03 PM   #1
icorey2014
LQ Newbie
 
Registered: Mar 2014
Posts: 5
Blog Entries: 1

Rep: Reputation: Disabled
Accidental File Overwrite


Earlier today, I was attempting to install flash to my debian linux through the terminal, and I was prompted by the site to edit a file called sources.list. I accidentally deleted a line, and overwrote it with a subtle variation of the line that the site gave me. Hoever, this did not work, and now, when I go to install a package file or something in that general area, I get a notification saying that line #2 is not valid, and the entire file cannot be read for the sources. I don't know what the original line was, is there any way I can recover the file to how it existed before I made the changes? If not, how can I fix this problem, or will I have to end up reinstalling linux to my computer? I only have the netbook, and an unrooted android phone (That won't tether to the computer), plus an 8GB flash drive.
 
Old 03-14-2014, 09:13 PM   #2
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: Ubuntu
Posts: 80
Blog Entries: 4

Rep: Reputation: 42
Perhaps this link would be of use to you: https://wiki.debian.org/SourcesList? You could copy their example.
If you also want the contrib and non-free components, add contrib non-free after main. I am assuming the file is /etc/apt/sources.list.
 
Old 03-14-2014, 09:19 PM   #3
icorey2014
LQ Newbie
 
Registered: Mar 2014
Posts: 5
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Didn't work. I still get the following message:

E: Type '' is not known on line 2 in source list /etc/apt/sources.list
E: The list of sources could not be read.

I didn't delete any of the other lines that were alread on there. You're right, the file is /etc/apt/sources.list.
 
Old 03-14-2014, 09:23 PM   #4
icorey2014
LQ Newbie
 
Registered: Mar 2014
Posts: 5
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
I also tried making a backup file of the original, and renaming it sources1.list, and deleting all the old lines, and then saving that as the primary sources.list file. Still getting the same message.
 
Old 03-15-2014, 05:44 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
It would help if you show us how your file actually looks like, so that we can spot and correct the error.
 
Old 03-15-2014, 10:48 AM   #6
icorey2014
LQ Newbie
 
Registered: Mar 2014
Posts: 5
Blog Entries: 1

Original Poster
Rep: Reputation: Disabled
Well, I did some extra repositioning of the lines, and it seems to be working fine now. I think I just didn't put the lines in the correct place. How do I mark the thread as resolved?
 
Old 03-18-2014, 06:51 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,133
Blog Entries: 2

Rep: Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839Reputation: 4839
Use the thread tools right above the first post.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
UNDO or similar for Thuna 1.4.0? Accidental file moving mechagojira Linux - Software 1 05-06-2013 11:13 AM
can't overwrite a file because it's being used? jorx Linux - Software 5 02-17-2013 09:52 PM
Accidental overwrite of .bashrc with different script. AceOfSpade Ubuntu 2 01-24-2011 09:28 AM
How do you overwrite the contents of a file without changing the file size? lothario Linux - Software 3 07-13-2010 08:43 AM
using sed to insert line into file and overwrite the current file jadeddog Programming 3 06-11-2009 07:14 PM

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

All times are GMT -5. The time now is 02:39 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration