You are not logged in.

#1 2020-06-06 13:45:32

lidlessey3
Member
Registered: 2020-06-06
Posts: 3

Pacman not finding any packges when summoned from a script

I recently installed arch on a new machine and pacman doesn't seem to work when I use it through a script, be it an aur helper or a mini script I wrote to reinstall packages I had on my old installation.
The error I get is error: the following package was not found: *pkg_name*.
But if I type sudo pacman -S *pkg_name* in a console it works fine.
I don't have this same problem on my old installation so I'm guessing I either miss configured something or am missing some optional dependancies, but I couldn't find anything on the topic by googling it.

edit:grammar

Last edited by lidlessey3 (2020-06-06 13:47:28)

Offline

#2 2020-06-06 14:03:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: Pacman not finding any packges when summoned from a script

If you want help understanding why your script doesn't work, you're going to have to show us the script and post actual output.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-06-06 14:19:30

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,701

Re: Pacman not finding any packges when summoned from a script

Welcome to the Arch Linux forums.

As Tribly pointed out, you have provided us with no usable information.    Moving to Newbe corner for now.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#4 2020-06-06 15:44:32

lidlessey3
Member
Registered: 2020-06-06
Posts: 3

Re: Pacman not finding any packges when summoned from a script

Trilby wrote:

If you want help understanding why your script doesn't work, you're going to have to show us the script and post actual output.

The script was a very simple:
for program in $(cat program_list)
do pacman -S $program
done

as for the output is just
error: the following package was not found: *program name*

repeted over and over with all the programs in the list.
I also get the same issue when I try to use yay and it needs to install depencies from the official repositories.

Offline

#5 2020-06-06 16:01:02

loqs
Member
Registered: 2014-03-06
Posts: 19,062

Re: Pacman not finding any packges when summoned from a script

Please post the contents of program_list,  the invocation of the script file and the full output it produced,  in code tags.
You were running the script as root?
Edit:

$ cat ./test.sh 
for program in $(cat program_list)
do pacman -S $program
done
$ cat program_list 
base
$ chmod +x test.sh
$ ./test.sh 
error: you cannot perform this operation unless you are root.
# ./test.sh
warning: base-2-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) base-2-2


:: Proceed with installation? [Y/n] 

Last edited by loqs (2020-06-06 16:10:05)

Offline

#6 2020-06-06 16:32:42

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: Pacman not finding any packges when summoned from a script

lidlessey3 wrote:

as for the output is just
error: the following package was not found: *program name*

Well that makes sense.  There is no such package "*program name*".

Of course I doubt that's actually the output.  But that's the only meaningful answer you can get until you post the information requested.

FWIW your script could just be a single pacman command with no loop, and definitely no cat is needed:

pacman -S - < program_list

Last edited by Trilby (2020-06-06 16:34:48)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB