I need to add a new APT mirror via command-line (I have to add it from a Bash Script).
You can found the Bash Script I'm working on here:
It's a script able to Undo the last APT command.
The Script have to works on every Ubuntu version from the 18.04.
The mirror I need to add is:
FOSS Oman Ubuntu Mirror - -HTTP
or
FOSS Oman Ubuntu Mirror - -HTTPS
32 Answers
Making some assumptions as the the commenters already noticed. Have a look at the MAN-pages for apt-mirror management. FOr instance and
Make sure your release/version is properly supported, otherwise you will break your system (not able to update/upgrade).
After some researches I found this:
what is the function of /etc/apt/sources.list.d?
A little extract:
The function of the
/etc/apt/sources.list.ddirectory is as follows:Using the directory you can easily add new repositories without the need to edit the central
/etc/apt/sources.listfile. I.e. you can just put a file with a unique name and the same format as/etc/apt/sources.listinto this folder and it is used by apt.In order to remove this source again you can just remove that specific file without the need for handling side effects, parsing or mangling with
/etc/apt/sources.list.
I think to can use this method to add my mirror. ;)