Enable AUR using command-line

hello.
i know there is a way to enable AUR from GUI pamac, but i dont want to do that.
i was searching and i didnt find anything related.
how do i enable AUR from command-line using pamac-cli?

something similar to:

pamac enable AUR

i am in the middle of a automated installation process and i want to do that from a script.

any ideas? thanks in advance.

1 Like

Hello,
With pamac cli you can build an AUR package even if AUR is not enabled in Pamac UI.
Because some AUR packages require to have base-devel then you fist install those and with pamac cli just run:
pamac build <package-name>

Because Pamac UI settings are stored in /etc/pamac.conf then you just have to uncomment the line:

#EnableAUR

to be

EnableAUR

You can do that via terminal with:

sudo sed -Ei '/EnableAUR/s/^#//' /etc/pamac.conf

To comment it back

sudo sed -Ei '/EnableAUR/s/^/#/' /etc/pamac.conf

And you can do the same with all the lines that enable or disable something in /etc/pamac.conf

6 Likes

really? i remember that i tried pamac install bootiso (some package from aur) and it didnt work. but i didnt try with build. so i guess you can build from AUR even if its not enabled and you cannot install from AUR if its not enabled. correct?

anyway. thank you so much for your answer.

I think all aur packages need to be built rather that installed don’t they?

Why are you not searching for the answer, first? :woozy_face: It’s so easy to find:

https://wiki.manjaro.org/index.php?title=Pamac

Can you please explain this expression? Trying to decipher it unsuccessfully :slight_smile:

install = install from Manjaro Repo

build = build from AUR

You can build from AUR via command line without enabling AUR in the config file.

1 Like

Not in full, as i just learned it from @nikgnomic - but i think it simply seeds out when using ‘s/^#//’ the comment sign in front of EnableAUR and adds it if is not there when using s/^/#/

2 Likes

It’s quite easy. / is a parameter delimiter character (any other can be used but usually it’s /). So we have 4 parameters in the first case
EnableAUR, s, ^# and ‘’ (empty).

  1. sed first finds lines that contain EnableAUR
  2. then it executes substitute command: finds a position of ^# (^ means start of line, # means itself) in previously found lines and replaces it with emptiness (i.e deletes it).

The second case is similar, just replaces start of line with #

6 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.