Home

addaptrepository

Addaptrepository, commonly invoked as add-apt-repository, is a command-line utility for Debian-based Linux distributions that manage APT repositories. It is provided by the software-properties-common package and is widely used on Ubuntu and derivatives to simplify adding and removing repository entries, including personal package archives (PPAs). The tool writes new repository definitions to files under /etc/apt/sources.list.d and can import the repository’s GPG key to allow package verification.

The command accepts a repository specification in either PPA form or a standard APT source line. Examples

Usage and options are designed to be straightforward. Typical workflow involves adding the repository, possibly confirming

Security and maintenance notes: only add repositories from trusted sources, as enabling new sources affects system

include
adding
a
PPA,
such
as
add-apt-repository
ppa:deadsnakes/ppa,
or
adding
a
conventional
deb
line
like
add-apt-repository
"deb
http://archive.ubuntu.com/ubuntu
focal
main
universe".
It
also
supports
removing
repositories
with
-r
and
can
update
the
package
list
automatically
with
options
like
-u
or
--update,
though
users
can
also
run
sudo
apt
update
manually
after
changes.
key
imports,
and
then
refreshing
the
package
index
before
installing
software
from
the
new
source.
The
command
is
particularly
convenient
for
enabling
PPAs
or
third-party
repositories
that
are
not
part
of
the
distribution’s
official
sources.
security.
After
modifying
repositories,
run
a
package
index
update
and
install
or
upgrade
packages
as
needed.
If
necessary,
repositories
can
be
removed
cleanly
with
add-apt-repository
-r.