1

This question already has an answer here:

I am running lubuntu (actually kodibuntu) as my server. whilst attempting to add a package there was an error in the sourceslist. config rendering synaptic package manager useless.

I cant change the file as a have no text editor installed (and no way to install one it seems); (I really only have chrome browser that is gui).

What is the simplest way to either edit the file in the command line or remove it. I have enabled the root account but am not 100% confident that i will not do something stupid such as make root the owner of my home directory without having gksu nautilus installed.

is there a command to undo a change in sources list? I could boot a live cd and edit the file but again this would have me tapping commands in as root and probably break the whole system.

if somebody could point me in the right direction it would be appreciated, even just some way to install a text editor. would nano be installed? thanks

marked as duplicate by A.B., muru, chaos, kos, Eric Carvalho Sep 15 '15 at 14:22

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    It's highly unlikely that you don't have one of nano or vi installed. If not, try the sed solution by izx. – muru Sep 15 '15 at 4:44
  • hey thanks, i have just found a few helpful answers. thanks anyway. – rob Sep 15 '15 at 4:46
3

Pretty sure, you will have terminal editor called nano installed. You need to edit sources.list file with root privileges so run it with

$ sudo nano /etc/apt/sources.list

Now you can change the contents the same way as in graphical editor (apart from using mouse to move cursor - you need to use arrow keys).

When you're finished press Ctrl+x and then y to save changes and exit.

A side note: don't be afraid of running commands as root - your Linux will not do anything beyond what you will write in console yourself. And to know what you're doing you need to know at least basic commands. If you don't know what a command does - use man [command]. For you to change ownership of your home dir to root, you'd have to execute chown command, so no danger here :)

Not the answer you're looking for? Browse other questions tagged or ask your own question.