Ubuntu: Basics of software repositories

Ubuntu: Basics of software repositories

Ubuntu uses apt for package management. Apt stores a list of repositories or software channels in the file

/etc/apt/sources.list

This is important to note as if you want to add sources for software packages you are going to either edit this file or add a referenced source file in the same format.

As with anything that deals with your system’s configuration it is recommended you perform a backup. A simple file copy operation would suffice:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

a typical source.list file looks as follows:

## Note, this file is written by cloud-init on first boot of an instance

## modifications made here will not survive a re-bundle.

## if you wish to make changes you can:

## a.) add ‘apt_preserve_sources_list: true’ to /etc/cloud/cloud.cfg

## or do the same in user-data

## b.) add sources in /etc/apt/sources.list.d

## c.) make changes to template file /etc/cloud/templates/sources.list.tmpl

#

 

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to

# newer versions of the distribution.

deb http://azure.archive.ubuntu.com/ubuntu/ saucy main

deb-src http://azure.archive.ubuntu.com/ubuntu/ saucy main

If you want to add an additional repository you can do it via the command line:

sudo add-apt-repository ppa:<repository-name>

This will result in a new file created under /etc/apt/sources.list.d/ where the .list files are included as part of the sources.list. This approach allows for enhanced ease when it comes to maintaining multiple ppa sources.

 

Enhanced by Zemanta

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: