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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

apt-add-repository: command not found

by admin

apt-add-repository is a command-line tool that is used to add a new package repository to the list of repositories available to the apt package manager. It is included in the software-properties-common package, which is installed by default on many popular Linux distributions such as Ubuntu and Debian.

To use apt-add-repository, you need to provide it with the repository’s location, which is typically specified as a URL. For example, to add the repository for the Google Chrome browser, you can use the following command:

# sudo apt-add-repository "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main"

This will add the specified repository to the list of available repositories, allowing you to install packages from that repository using the apt package manager.

Note that apt-add-repository is primarily used to add third-party repositories to a system. Most Linux distributions come with a set of default repositories that are configured by default, and you can install packages from these repositories using the apt package manager without the need to add any additional repositories.

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

apt-add-repository: command not found

you may try installing the below package:

# apt-get install software-properties-common

apt-add-repository Command Examples

1. Add a new apt repository:

# apt-add-repository {{repository_spec}}

2. Remove an apt repository:

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

3. Update the package cache after adding a repository:

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

4. Enable source packages:

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

Filed Under: Linux

Some more articles you might also be interested in …

  1. sort Command Examples in Linux
  2. pw-record Command Examples in Linux
  3. cargo: Manage Rust projects and their module dependencies (crates)
  4. echo: command not found
  5. run-mailcap: command not found
  6. dpkg Command Examples in Linux
  7. avifenc Command in Linux with Examples
  8. engrampa: command not found
  9. CentOS / RHEL 7 : How to enable or disable automatic updates (via packagekit)
  10. Linux filesystem is filling, despite no large files or directories

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright