Can someone please explain what's the use of these?
sudo apt-get update
sudo apt-get upgrade
apt-add-repository
and what are the combinations to use these?
Can someone please explain what's the use of these?
sudo apt-get update
sudo apt-get upgrade
apt-add-repository
and what are the combinations to use these?
A bit of background
For update and install Ubuntu like systems uses a concept called software source or repository.
A repository is collection of libraries, executable.
The libraries, software's inside a repo is maintained using a list file. So when somebody update the list file in server , the user will download the latest list file. This list file indicates which files has update and which are not. Using this you can download only the updated component. No need to get whole software.
Beside Ubuntu official repo, there are many 3rd party developers who distribute there application. Ubuntu provided them a easy way to distribute in Ubuntu. That is called a PPA
.
A PPA
is also a repo, but maintained by the developer. Ubuntu doesn't take responsibility.
Your questions answer
apt-add-repository your-repository-here
is to add a PPA as a source of software for your computer.
apt-get-update
is to get the latest source file list (not the software, it downloads only the index) from the all added repo. Like you added some repo in first step. Those software won't be available till you execute them.
sudo apt-get upgrade
is to update all available updates for the installed software. It uses the latest list file downloaded as a reference to determine which components needs to be installed .