I would like to ask a very basic question but I have never thought about it before. Well, when someone installs an application from terminal, he has to add the repository first, right? On the other side, when someone installs an application from the Ubuntu Software Center, is the repository then added automatically?
I am asking those questions to figure out this: When I run update and then upgrade, will this application be upgraded or not? Is the result same in two options?
That is not really accurate, but not far off.
The Ubuntu Software Center is a set of repositories. Many, many applications are already in the repositories. To install those you do not need to add a new repository.
When one installs an application that has its own repository (virtualbox) and you want to use command line apt-get or the software center you need to have the repository added, key added and then update (apt-get update). There are also additional repositories that have large numbers of applications like playdeb which has many, many games in their repository.
After that you can install from a repository using either the GUI software center or command line apt-get install xxx
You can also install a .deb file using dpkg or other installs can be done using a binary installer or even just uncompressing the binary files.
Summary:
The only really big difference between installing things from the Software Center or another gui and doing it from the command line is when things go wrong.
In most guis,installation error messages are hidden and they just give you a general message that it didn't work. When you do it from the command line, you see all the messages that are generated. Often, this information can be used to fix the problem or it will tell you why you probably don't want to fix it. E.g. installing the package would break or uninstall other packages that are already installed.
Sometimes, a package fails to install just because one of its dependencies is not installed (and the regular install doesn't automatically fix that like most do). When this happens, you can often just install the missing package first and then your install will succeed.
Also, apt-get will inform you of other associated packages that are "recommended" along with your package, so you can look them up and see if you want any of them.
It also reports on any packages that were installed previously that are probably not needed any more and tells you how to remove them.
You shouldn't add/delete packages from either of these last two steps without carefully reviewing the packages involved, but it's usually safe.
In Ubuntu 12.04, newly installed apps get added to the launcher by default, but this only happens for apps installed using the Software Center.
Repositories have to be added and enabled only once. You likely see instructions like:
Adding a repository has to be done only once. In the above example, the bumblebee program is not available in the default repositories, hence you have to enable this third-party repository (using the
add-apt-repository
program).The second line,
apt-get update
, refreshes the package lists to retrieve the latest information about the packages. If a new repository was added, this will inform the database of new packages from this repository.The third command,
apt-get install ...
is equivalent to selecting a package for installation.The Ubuntu software center allows you to install software that is available in the repositories. The result is no different as when you "manually" install packages using the
apt-get install
command. You will still get updates and such from the repositories.Finally, you may encounter instructions like "download foo.deb and install it with
sudo dpkg -i foo.deb
". In this case, you won't receive upgrades unless the author of the package makes modifications to the system configuration (like Google Chrome).Software center is a front-end UI of the apt tool. When you install a software from the software center, it's installed with apt. So, when you do an
apt-get update
and aapt-get upgrade
you'll update the software you've installed from the center. Furthermore, if the software center have to add a repository automatically, i'll be also used by apt, because as I said, the software center use apt. when you install something withapt
you don't always have to add a repository, if you typeapt-get install vlc
it'll install vlc but you haven't added a repository.