You are not logged in.

#1 2021-08-29 19:55:19

Automath
Member
Registered: 2016-05-16
Posts: 115

I'm trying to install some packages from the installation scripts

I'm not working hard on this but may be you can tell me the correct way so I do what I want without much testing and research.
My goal is to test if some packages from a list are already installed and if not then execute these commands:
* Search for a description of that package
* Ask if I want to intall it
* then install that package or agregate it to a list

Which should look more or less like this what I came:

curl https://gitlab.archlinux.org/archlinux/archiso/-/raw/master/configs/releng/packages.x86_64|
while read pack; do pacman -Q $pack 2> /dev/null||
( echo $pack&&
pacman -Ss $pack&& 
sudo pacman -Syu $pack ); done

The prioblem is that the last command terminates the loop before I can give a reply, I tried with read -p and I have a similar result but ignoring the last read execution and continuing with the loop till the end.

Can you tell me what I'm doing wrong?

Last edited by Automath (2021-08-29 20:24:21)

Offline

#2 2021-08-29 20:02:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,310

Re: I'm trying to install some packages from the installation scripts

You can just do

pacman -Syu $packagelist --needed

respectively: https://wiki.archlinux.org/title/Pacman … rom_a_list

Offline

#3 2021-08-29 20:11:45

Automath
Member
Registered: 2016-05-16
Posts: 115

Re: I'm trying to install some packages from the installation scripts

V1del wrote:

You can just do

pacman -Syu $packagelist --needed

respectively: https://wiki.archlinux.org/title/Pacman … rom_a_list

That's good, but the description of the package is still missing, is it there a verbose option?

is it there a verbose option?

yes, but that's not what I need.
I need to run search and sysupgrade at the same time but they are mutually excusive, btw why???

Last edited by Automath (2021-08-29 20:17:02)

Offline

#4 2021-08-29 21:25:34

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: I'm trying to install some packages from the installation scripts

Quick and dirty one-or-two-liner:

curl https://gitlab.archlinux.org/archlinux/archiso/-/raw/master/configs/releng/packages.x86_64 |
  pacman -T - | expac -S '%n\n    %d' - | vipe | awk 'NF == 1' | sudo pacman -Syu -

Requires expac and vipe from moreutils. The latter shows the list of package names and descriptions in your editor. Delete names of packages you don't want (descriptions don't matter -- unless they consist of a single word), exit editor and have pacman install the remaining ones.

Offline

Board footer

Powered by FluxBB