I have two repository that I want my script to verify if they are on the system. How can I verify by command line if a repository is already added to the system and, if not, add them?
You can see all repository enabled in terminal with this command below (It will print all repository line starting with
If you want to see only the repositories with binary packages not source packages (deb-src), use another grep to exclude entries with
To add the repository using command line, just use this kind of command:
(I am assuming your repository source line is like this
This command uses
Please note that without using
Alternatively you can use your own file for the custom repo without touching
It will create a file in
Note that, to add repository source to the system your script need to be run with root priviledge
I dont know if this is what you need but typing
in a terminal or in dash-command windows will open a list of software sources.
Use this command to add your PPA
Hope that helps
EDIT: You can edit the file with
to install it.
I would just use