You are not logged in.

#1 2021-03-12 08:27:40

canic_nm
Member
Registered: 2021-03-12
Posts: 1

Can't install packages by a text file with listed names

arch-chroot /mnt
pacman -Sy
echo "most less" > "/root/.testlist.rs"
pacman -S $(cat "/root/.testlist.rs")
# [1] error: target not found: most less
pacman -S $(cat "/root/.testlist.rs" | tr -d '\n' | sed 's/\s$//')
# [2] error: target not found: most less
pacman -S $(eval echo $(cat "/root/.testlist.rs")
# [3] error: target not found: most less

Offline

#2 2021-03-12 09:33:22

Awebb
Member
Registered: 2010-05-06
Posts: 6,688

Re: Can't install packages by a text file with listed names

The problem is not your shell code. "error: target not found:" is a pacman error message. First of all, congratulations, you've found a lot of working versions of "command $(<file)".

Pacman hasn't run within the chroot. There are no remote databases yes (the -S stuff). Try "pacman -Ss most" and will throw an error. You need at least to -Sy once. Depending on how long your pacstrap command is in the past, consider running -Syu directly.

Offline

#3 2021-03-12 11:44:48

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,638
Website

Re: Can't install packages by a text file with listed names

The problem is that pacman is trying to install a single package literally called "most less". I can't reproduce this with the example given, so I suspect a copypaste error.

I would hazard a guess that you have double quotes around the subshell, e.g.

pacman -S "$(cat "/root/.testlist.rs")"

If so remove those.

See also: https://wiki.archlinux.org/index.php/Pa … rom_a_list


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB