• 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 not found

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.

If you encounter the below error while running the add-apt-repository command:

add-apt-repository: command not found

you may try installing the below package:

# apt-get install software-properties-common

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. How to Password Protect GRUB2 in Oracle Enterprise Linux 7
  2. esearch: command not found
  3. btrfs inspect-internal Command Examples in Linux
  4. lvconvert Command Examples in Linux
  5. How To Change Timezone for Oracle Grid Infrastructure
  6. How to monitor /etc/shadow and /etc/passwd file for changes with Auditd?
  7. chfn Command Examples in Linux
  8. How to Install Oracle Linux (UEK-2) with btrfs as a root filesystem
  9. How to Setup a squid proxy server on CentOS/RHEL 7
  10. Understanding The sysfs File System (/sys) in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright