Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I install something in the terminal, such as chromium, I would type in

sudo apt-get install chromium-browser

How does the terminal know that chromium-browser is a valid package to install? Is there some list of all packages that can be installed? How does it find the packages?

share|improve this question
    
In Ubuntu Software installation is different. It is so secured. They are installed from a trusted pool. Advanced and freely available applications which needed for majority of the functions in computing are in that pool. You can select and install from either Software Center or running sudo apt-get install [PACKAGENAME] command. –  user224082 Dec 22 '13 at 9:56
    
plz ask a single question. –  Avinash Raj Dec 22 '13 at 10:31
add comment

2 Answers 2

apt-get searches for the specified package in the repositories given in the /etc/apt/sources.list file and /etc/apt/sources.list.d directory.

share|improve this answer
add comment

Whenever you call apt-get update the repositories contained in the sources.list get read, this tells apt-get from where to get packages lists. This list get downloaded and stored in /var/lib/apt/lists for posterior use. These are lists of all packages available from the repositories you selected. Even if you remove your sources.list, this list will be available for APT. That's why you should always do update whenever you add/remove/modify a repository, to keep these lists updated.


How does the terminal know that chromium-browser is a valid package to install?

"The terminal" knows nothing. APT read all the lists in /var/lib/apt/lists and determine if the package is available. If the package is not found in any of the lists, you will get:

E: Unable to locate package <package>

Is there some list of all packages that can be installed?

This changes from repository to repository. Your local copy/list of your active repositories is found in /var/lib/apt/lists.


How does it find the packages?

$ sudo apt-get check
Reading package lists... Done
Building dependency tree       
Reading state information... Done

The line of interest is

Reading package lists... Done

which tells you that APT reads the list, from /var/lib/apt/lists.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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