I want to add these four ppa's to my machine.
sudo add-apt-repository ppa:noobslab/malys-themes
sudo add-apt-repository ppa:alecive/antigone
sudo add-apt-repository ppa:nitrux/nitrux-artwork
sudo add-apt-repository ppa:upubuntu-com/themes
Instead of adding them one-at-a-time, I thought I would list them one after another - like we do when installing apps.
sudo add-apt-repository ppa:noobslab/malys-themes ppa:alecive/antigone ppa:nitrux/nitrux-artwork ppa:upubuntu-com/themes
But it returned an error: Error: need a repository as argument
I searched around and saw this question How to install multiple PPAs and applications at once? but it proposes a bash script as a solution.
Is there a way to add multiple ppa's at once without using a script?
EDIT
Am just curious, why doesn't
sudo add-apt-repository ppa:noobslab/malys-themes ppa:alecive/antigone ppa:nitrux/nitrux-artwork ppa:upubuntu-com/themes
work but
sudo apt-get install moka-icon-theme moka-icon-theme-blue moka-icon-theme-dark malys-deda awoken-icon-theme nitrux-icon-theme nouvegnomegray
works?
EDIT 2
Is there any workaround where
sudo add-apt-repository ppa:noobslab/malys-themes ppa:alecive/antigone ppa:nitrux/nitrux-artwork ppa:upubuntu-com/themes
can be made to work?
And I totally understand the risks here.
It doesn't work because who wrote the original script (you can look at it, it's a python script) didn't think that could be useful.
The rationale may be that adding a repository is a thing that is better done slowly. You should check the signature for example --- and double check you really want it.
So it's basically a design decision. You could probably easily modify the script if you want it, or repeating the command on the command line...
(is that a script or not? A rose is a rose under another name?)
Don't do this, but... unix is famous for letting user shooting themselves in the foot,so...
If you really want your "multiple add-apt-repository"(1) work, do this:
1) find where add-apt-repository is.
2) rename it
3) replace it with a simple script:
with the contents:
4) make it executable:
5) and now you can use your command:
Why you should not do it? Because next time there will be an update to the package that contains the original
apt-add-repository
, problems will arise. Like having your script overwritten or (worst) not having the package updated.It is in effect much better to avoid touching the system program and simply put the script in your
~/bin
with another name, likemy_aptadd
. You are now safe and happy.Or if you are really fond of the original name, you can create a directory in your home folder like
~/override
, prepend it to your PATH in.profile
(likeexport PATH=$HOME/override:$PATH
), and save the script there --- obviously with the full path, original/usr/bin/add-apt-repository
in it to avoid an infinite loop. You will then regret it when someone will drop a file called "ls" in it with contentexe rm $*
(2), but hey...So why I wrote it here? Because this is really a useful technique sometime to "fix" programs that otherwise will not run. For example, I have this to add environment variables to programs that otherwise will misbehave, and that are called by other programs that I can't or won't modify.
Footnotes:
(1) I never noticed before but in my system exists even
apt-add-repository
, which is a symlink toadd-apt-repository
. I can understand why, but it's a call for a mess waiting to happen...(2) it's wrong. On purpose.
I've been over this before when talking about how to backup installed PPAs. The following takes a file where all your PPAs are listed and installs them:
It's fairly trivial to tune that to take a list:
Simply because they're different commands, written for different purposes by different people. Why don't
less
andrm
take the same arguments? They're different things.Adding a bunch of repos is really an edge case. It's not like wanting to install more than one package at a time. It also complicates the syntax. add-apt-repository takes a few different formats already, some that include spaces. Parsing that sanely is hard work to get right.
Sure. You either write a wrapper for
add-apt-repository
and prioritise it or edit the original... Is that a sane thing to do? No, not at all. You'll be breaking the existingadd-apt-repository
(see above) in a non-standard way, for what? To save keystrokes on something you run once?There are multiple one-command methods of splitting this out, as multiple people are telling you. Don't fight the system, use it.
Try to put something like this:
or
if the ppa is trusted and needs to be installed any way then
-y
can be added as well to force installSo in this format:
or
It might work.