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.

i'm new to using ubuntu or any linux distro.

On reading and watching tutorials on the internet, I've seen others just use

sudo apt-get install package-name

while others do these commands before using sudo apt-get install

sudo add-apt-repository (commands here)

what's the better way to install packages?

share|improve this question

3 Answers 3

up vote 2 down vote accepted
sudo apt-get install package-name

This command installs a new package. But if the package can't be found you have to tell the installer where to find it, and that's when you add a PPA(repositiry).

sudo add-apt-repository

Using a Personal Package Archive (PPA), you can distribute software and updates directly to Ubuntu users. Create your source package, upload it and Launchpad will build binaries and then host them in your own apt repository.

That means Ubuntu users can install your packages in just the same way they install standard Ubuntu packages and they'll automatically receive updates as and when you make them.

Every individual and team in Launchpad can have one or more PPAs, each with its own URL.

Packages you publish in your PPA will remain there until you remove them, they're superseded by another package that you upload or the version of Ubuntu against which they're built becomes obsolete.1

1Source:Launchpad Help

share|improve this answer
    
thanks for your response now i understand it. xD –  chanHXC Apr 29 '13 at 9:44

If you run

sudo apt-get install package-name

It installs the latest version of package-name available in the official repository or in one of the ppa. So Ubuntu comes with an official repository where there is many packages in relatively recent version. But some packages are not yet in the official repository so their developer (or other people) create a ppa to make it available for you through apt-get. That is an easy way to install packages that are not yet officially supported by Ubuntu.

Sometimes, there is also ppa with newer version of packages that the version in the official repository. Be aware that sometimes, these ppa contains unstable version but most of the time it is stated in the tutorials or even in the names of the ppa or their description.

Also, if you prefer a graphical interface instead of the command line, you can use the Ubuntu Software Center instead of apt-get.

I would say that the version in the Ubuntu Software Center is preferred but if it is not yet available and if it is stable, add the ppa. Or if you need a feature from a newer release, use the ppa too. The ppa are very confortable, their upgrade also appear in the Software Update. However, you sometimes only need a few days before Ubuntu release the new version or the software, that's always the case with. Most of the times, if the tutorials are up to date, you can follow their recommendation IMHO.

share|improve this answer
    
clearly explained thanks :) thanks –  chanHXC Apr 29 '13 at 9:57

The first command you listed here is used to install packages, whereas the second one is a script which allows you to add external software repositories to your system really easily.

An example:

Typing in sudo apt-get install geary will install Geary, a lightweight email client.

However if you'd like to test a daily build of geary (daily might be unstable) you could add a repository (ppa) by doing this: sudo apt-add-repository ppa:yorba/daily-builds

share|improve this answer
    
in few words. but very helpful. thanks –  chanHXC Apr 29 '13 at 9:57

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.