How to Add and Remove APT Repositories

Ubuntu based Linux distributions rely on a program called APT to handle package management. Using the command “apt-get”, you can install, remove and update other programs. The packages installed with APT are determined by software repositories, and while every Linux distribution has default repositories, you can also add or remove third-party sources.

To add a Personal Package Archive (PPA) to your Ubuntu server or virtual private server (VPS), run this command:

sudo add-apt-repository [ppa name]

For example, if the PPA is ppa:server/school, you would type:

sudo add-apt-repository pp:server/school

The output will look like this:

tavis@serverschool:~$ sudo add-apt-repository ppa:server/school

[sudo] password for tavis:

Server school is a fake program I made up for the purposes of this article

More info: http://www.serverschool.com

Press [ENTER] to continue or ctrl-c to cancel adding it

…followed by gpg information

Then, to refresh the repository list, you need to run:

sudo apt-get update

Finally, install the software you wanted:

sudo apt-get install server-school

To remove a PPA, you can use a similar command structure:

sudo add-apt-repository –remove [ppa name]

So, to remove the server school repository, you would type:

sudo add-apt-repository –remove ppa:server/school

As with any third-party software, be careful when adding PPAs, especially from sources you do not fully trust. If you are unsure about a PPA, it is best to leave it off of your server.

How to Add and Remove APT Repositories
Ubuntu based Linux distributions rely on a program called APT to handle package management. Using the command “apt-get”, you can install, remove and update other programs. The packages installed with APT are determined by software repositories, and while every Linux distribution has default repositories, you can also add or remove third-party sources.
To add a Personal Package Archive (PPA) to your Ubuntu server or virtual private server (VPS), run this command:
sudo add-apt-repository [ppa name]
For example, if the PPA is ppa:server/school, you would type:
sudo add-apt-repository pp:server/school
The output will look like this:
tavis@serverschool:~$ sudo add-apt-repository ppa:server/school
[sudo] password for tavis:
Server school is a fake program I made up for the purposes of this article
More info: http://www.serverschool.com
Press [ENTER] to continue or ctrl-c to cancel adding it
…followed by gpg information
Then, to refresh the repository list, you need to run:
sudo apt-get update
Finally, install the software you wanted:
sudo apt-get install server-school
To remove a PPA, you can use a similar command structure:
sudo add-apt-repository –remove [ppa name]
So, to remove the server school repository, you would type:
sudo add-apt-repository –remove ppa:server/school
As with any third-party software, be careful when adding PPAs, especially from sources you do not fully trust. If you are unsure about a PPA, it is best to leave it off of your server.










Comments: