How to append a repository to sources.list via command line

August 12, 2014 | By | Reply More

In order to add a repository line to /etc/apt/sources.list on Ubuntu based distribution, we can do the graphical way using gedit or we can also use nano, vi or any other text editor you like. But, there is an easier way to append the new repository to existing sources.list file directly from a command line. This tutorial is going to show you How to append a repository to sources.list via command line.

ubuntu tutorial

For example, I want to add the following repository line to my /etc/apt/sources.list

deb http://download.virtualbox.org/virtualbox/debian trusty contrib

Then, I use this command to do this

[codesyntax lang=”bash”]

[/codesyntax]

Now the new repository line should be appear on the sources.list file

[codesyntax lang=”bash”]

[/codesyntax]

The new repository was added to the last line of sources.list.

Tags: ,

Category: Ubuntu

Leave a Reply