According to How can PPAs be removed? there are mainly 3 methods to get rid of a PPA:
Use the
add-apt-repository
command:sudo add-apt-repository --remove ppa:???/???
Manually remove the
.list
file:sudo rm /etc/apt/sources.list.d/????.list
Use additional tools like e.g.
ppa-purge
... (not topic of this question)
I am curious what the difference between the first and second option is, i.e. is there anything more that add-apt-repository --remove
does, compared to just deleting the .list
file?
One example I could think of would be GPG keys that were installed together with the PPA. Will add-apt-repository
handle and remove them in contrast to just rm
-ing the .list
file?
Please note that neither removing GPG keys nor using ppa-purge
is the topic of this question!
Both commands remove the PPA, but there is one basic difference:
This command will only delete content of
.list
file. It will not remove the file itself.Once you run this command, it will completely remove the PPA file.
However, in my opinion, it's better to use :
I generally use the last command with the trailing asterisk (
*
), because whenever we add any repository it will create two files under/etc/apt/sources.list.d/
. First one is the.list
file and second one is a backup of that, having the extension.list.save
.same case with command
sudo apt-key del ????
andsudo rm /etc/apt/trusted.gpg.d/file.gpg
. whenever we add keys two file created under/etc/apt/trusted.gpg.d/
file.gpg
andfile.gpg~
when you run commandone file
file.gpg
will be deleted and second one will remainfile.gpg~
as it is . However, in my opinion, it's better to use :No, apt-add-repository will not handle the GPG keys, so if you want to remove the keys as well, use rm /etc/apt/sources.list.d/???.list and then the GPG Keys from /etc/apt/trusted.gpg.d/