How to add & remove PPA repo on Xubuntu

How to add and remove PPA repo on Xubuntu

In this tutorial we will be looking at how to add and remove PPA repository on xubuntu or ubuntu in general. PPA repository or Personal Package Archive is a repository that are not maintain by official ubuntu developers.

Sometimes you need to add these repository, because the official repository of ubuntu might be outdated or simply because there are better version of the software that you are looking for and it's available via PPA.

How to add PPA repository
To add ppa repository you need to know the exact name of the repo, usually it starts with ppa:whatevername/whatever, and you can add it using add-apt-repository command.
sudo add-apt-repository [ppa-name]
Example:
sudo add-apt-repository ppa:wine/wine-builds
sudo add-apt-repository ppa:gwibber-daily/ppa
sudo add-apt-repository ppa:chromium-daily/ppa

How to remove PPA repository
The command to remove ppa repository is the same as adding it, but you need to add --remove parameter, like this:
sudo add-apt-repository --remove [ppa-name]
Example:
sudo add-apt-repository --remove ppa:wine/wine-builds
sudo add-apt-repository --remove ppa:gwibber-daily/ppa
sudo add-apt-repository --remove ppa:chromium-daily/ppa

How to show list of PPA repository
Unfortunately there is no dedicated command for showing list of ppa repository, the only way to show list of ppa repo is by creating script that will show list of ppa on our computer. The script is like this:
#! /bin/sh 
# listppa Script to get all the PPA installed on a system 
for APT in `find /etc/apt/ -name \*.list`; do
    grep -o "^deb http://ppa.launchpad.net/[a-z0-9\-]\+/[a-z0-9\-]\+" $APT | while read ENTRY ; do
        USER=`echo $ENTRY | cut -d/ -f4`
        PPA=`echo $ENTRY | cut -d/ -f5`
        echo sudo apt-add-repository ppa:$USER/$PPA
    done
done

Save as ppa.sh and then give execute permission to the script
chmod +x ppa.sh
Run the script like this:
./ppa.sh


Share this

Previous
Next Post »