• 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

apt-add-repository Command Examples

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.

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. dmidecode: command not found
  2. How to disable FIPS mode on CentOS/RHEL 7
  3. Linux OS Service ‘sendmail’
  4. Understanding MySQL Privileges
  5. mdadm Command Examples in Linux
  6. brctl: command not found
  7. CentOS / RHEL : How to make iptable rules persist across reboots
  8. pacaur Command Examples in Linux
  9. Linux Boot Process
  10. dbus-daemon Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright