• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

add-apt-repository Command Examples

by admin

add-apt-repository is a command line utility that is used to add or enable a repository in the APT (Advanced Packaging Tool) package manager on Debian, Ubuntu, and other Debian-based Linux distributions.

A repository is a collection of software packages that are stored on a remote server and made available for installation on your Linux system. The add-apt-repository command allows you to add a repository to your system’s APT sources list, which is a configuration file that APT uses to find and install packages.

To use add-apt-repository, you need to provide it with the URL of the repository you want to add. For example:

$ sudo add-apt-repository "deb https://myrepo.com/ubuntu bionic main"

This will add the repository at the URL https://myrepo.com/ubuntu to your APT sources list and enable it for installation. You will then need to update your package list using the apt update command before you can install any packages from the new repository.

Keep in mind that you should only add repositories from trusted sources, as adding a repository from an untrusted source could potentially compromise the security of your system.

add-apt-repository Command Examples

1. Add a new apt repository:

# add-apt-repository {{repository_spec}}

2. Remove an apt repository:

# add-apt-repository --remove {{repository_spec}}

3. Update the package cache after adding a repository:

# add-apt-repository --update {{repository_spec}}

4. Allow source packages to be downloaded from the repository:

# add-apt-repository --enable-source {{repository_spec}}

Filed Under: Linux

Some more articles you might also be interested in …

  1. feedreader Command Examples in Linux
  2. datamash Command Examples in Linux
  3. CentOS / RHEL 7 : How to configure cache-only nameserver
  4. How to effectively use Man Pages under Linux
  5. scrot: command not found
  6. firejail: command not found
  7. chronyc : command not found
  8. How Passwordless SSH works in Linux / UNIX
  9. protonvpn-cli connect Command Examples
  10. kill: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • “aws s3 presign” Command Examples
  • “aws s3 mv” Command Examples
  • “aws s3 mb” Command Examples
  • “aws s3 ls” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright