Can anybody help with script making

Hi I'm trying to do script for mate mate-extra its on antergos repos list but not going so well if anybody could help me please.

This is what i have so far. But it doesn't work i get command s not found on some line 17 stuff

#!/bin/bash

#mate
#mate-extras

pacman -S caja marco mate-backgrounds mate-control-center mate-desktop mate-icon-theme mate-menus mate-notification-daemon mate-panel mate-polkit mate-session-manager mate-settings-daemon mate-themes mate-user-guide atril caja-gksu caja-image-converter caja-open-terminal caja-sendto caja-share caja-wallpaper engrampa eom galculator mate-applets mate-icon-theme-faenza mate-media mate-netbook mate-power-manager mate-screensaver mate-sensors-applet mate-system-monitor mate-terminal mate-user-share mate-utils mozo pluma

Is that the entire script? And is it on putpose that the pacman line is split up?

Post it in [code] tags.

1 Like

If all you doing is install mate and mate-extras and no display manager. This is what I'll do.

sudo pacman -S --noconfirm mate mate-extra && echo "exec mate-session" > ~/.xintirc && startx

1 Like

@LinuxTechy i just tried to format your script code. if i made some mistake, please edit it again.

Must be a mistake in there, since the script does not even contain more than 10 lines of code, så error on line 17, must be because of hard line changes.

i do not really know what he wants to achieve.

this would probably be simpler:

#!/bin/bash
sudo pacman -S mate mate-extra --noconfirm

if he wants a script to automate installation of packages, i can recommend to read early source code of pacli-simple and copy and paste the code he wants: https://github.com/excalibur1234/pacli-simple/blob/a82ffd997ce674a9a88c33336f3d022504a1fdbe/pacli

1 Like

rather than a script, why not just make an alias in your bashrc?

1 Like

[quote="LinuxTechy, post:1, topic:12439"]
if anybody could help me please.
[/quote]The script must be executable and run with root privileges. Are you doing that?

Or, command should be
sudo pacman -S <files>
which requires sudo password but you make no provision for entering the password. I doubt that bash is capable of parsing and interpreting what you appear to want to do with the script. I sure as heck do not, ;).

it appears, from the cryptic and incomplete error message you posted, that Bash does not know what pacman -S ... is when the file is parsed. As far as bash is concerned the S is some 'command' ...

There are probably a hundred different ways to accomplish the task, ... whatever that is. Using substitution and exec are probably the easiest way to get the pacman command to run properly.
I won't even touch WITH you are trying to install antergos MATE files on Arch/Manjaro .... :confounded: or the multiple software management issues that could cause ... beyond saying just that, if that indeed is the goal.

[...]
Please read bash manual before writing scripts. Scripts, as innocuous as they sound, can completely destroy the system if not written properly. ...

The manual is easily found on every Linux system where Bash is installed with
man bash
but there are many programs that will display it in a more pleasing and easier to search and read format or just read it online at various locations.

There are many advantages for any Linux user to read the bash manual that go far beyond just bash scripting. ...

GL@U

Thank you ALL the other people that are helping me with reasonable comments that are helpful :smile:

Thanks but that didn't work. I'm using antergos also incase you didn't know. I put the command in but get this

$ sudo pacman -S mate mate-extras --noconfirm
[sudo] password for tj:
:: There are 15 members in group mate:
:: Repository antergos

  1. caja 2) libmatekbd 3) marco 4) mate-backgrounds 5) mate-control-center 6) mate-desktop 7) mate-icon-theme 8) mate-menus
  2. mate-notification-daemon 10) mate-panel 11) mate-session-manager 12) mate-settings-daemon 13) mate-themes 14) mate-user-guide
    :: Repository community
  3. mate-polkit

Enter a selection (default=all):
error: target not found: mate-extras
$

That's why i did it how i did it so it gets pulled from the antergos repo first those commands wont work i has to be done singlee how i had it. I put in the exac name of them. Any ideas?

I was trying to follow (Dan) midfingr's in github here https://github.com/midfingr/pre_arch/blob/master/base

in case all of you are wondering

What do you mean? i copied all the dependencies from here https://www.archlinux.org/groups/x86_64/mate/ https://www.archlinux.org/groups/x86_64/mate-extra/ .But most of them come from antergos repo. I did it manully adding them with pamac but i want something more simpler like a script. instead of installing each one at time with pamac

coz it is mate-extra no S

ya i got that when i looked at it. haha. Thanks. still has problems i can't do it like that.. It will try and pull them from the community arch and i don't want that just want it to pull from antergos repo. thats why i individually put them in

ya thats the entrie scrpit did i do it wrong how should it have been if so

i couldn't find the [code] button

As @neognomic mentioned, you shouldn't mix antergos, arch and Manjaro packages. There is absolutely no reason for it.

What I see the script is doing, is that it's downloading specific packages and installing them with Pacman -S.
So what @excalibur1234 suggested, was using the groups that contain all these packages instead of just listing each package:

sudo pacman -S mate mate-extra

And no, your original post does not have sudo in front of the pacman command, which means it will be run as the logged in user:

First of all I'm not mixing anything. That's how the install antergos comes its fresh install. I can not do it like that sudo pacman -S mate mate-extra I get this antergos repo and then the community repo and it doesn't work i get an error becuase its tring to pull some from the others too. Thats why i singled them out so they just come from the antergos repo. YES i did have sudo @Strit which means i was in root. I have done that. Don't tell me what i dont have or didn't do please because i did.

Posting about Antergos struff on Manjaro forum is mixing things. Manjaro installs do not have an Antergos repo.

Hows about actually posting the error messages?

LOL never said anything about mixing anything. Its about getting Help Arch is Arch. Manjaro, Antergos, Straight Arch, etc. Same commands!!! wasn't the point of my question. was putting it in a script. Help or don't help i really don't care

Forum kindly sponsored by