You are not logged in.

#1 2010-09-11 19:57:23

AcId
Member
Registered: 2009-07-11
Posts: 25

[SOLVED] Installing list of packages contained in file

Is it possible to install a list of packages contained in i file eg. a list created with "pacman -Qq"?

Last edited by AcId (2010-09-11 20:45:12)

Offline

#2 2010-09-11 20:11:26

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: [SOLVED] Installing list of packages contained in file

Installs by pacman of all possible types are outlined in .....man pacman...


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#3 2010-09-11 20:19:09

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: [SOLVED] Installing list of packages contained in file

Hmm,

for pkg in `cat list.txt`;do pacman S --asdeps $pkg;done

?

Offline

#4 2010-09-11 20:27:27

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Installing list of packages contained in file

AcId wrote:

Is it possible to install a list of packages contained in i file eg. a list created with "pacman -Qq"?

Yes.

I think the wiki has some examples.

Offline

#5 2010-09-11 20:29:14

AcId
Member
Registered: 2009-07-11
Posts: 25

Re: [SOLVED] Installing list of packages contained in file

lilsirecho wrote:

Installs by pacman of all possible types are outlined in .....man pacman...

Pacman man-pages shows no options for installing a list of packages contained in a file, so i guess there's no built-in function for it in pacman.

But i thought that maybe you could pipe the output of "cat /path/to/file" to a "pacman -S", maybe trough a bash script or somerhing.

I tried running:

cat /path/to/file | pacman -S 

But it didn't dó the trick.

Offline

#6 2010-09-11 20:30:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Installing list of packages contained in file

AcId wrote:
lilsirecho wrote:

Installs by pacman of all possible types are outlined in .....man pacman...

Pacman man-pages shows no options for installing a list of packages contained in a file, so i guess there's no built-in function for it in pacman.

But i thought that maybe you could pipe the output of "cat /path/to/file" to a "pacman -S", maybe trough a bash script or somerhing.

I tried running:

cat /path/to/file | pacman -S 

But it didn't dó the trick.

Please, read again flamelab's post.

Offline

#7 2010-09-11 20:31:27

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Installing list of packages contained in file

pacman -S `cat /path/to/file` works for me.

Last edited by anonymous_user (2010-09-11 20:32:00)

Offline

#8 2010-09-11 20:34:58

AcId
Member
Registered: 2009-07-11
Posts: 25

Re: [SOLVED] Installing list of packages contained in file

flamelab wrote:

Hmm,

for pkg in `cat list.txt`;do pacman S --asdeps $pkg;done

?

Returns:

error: 'cat': could not be found or read package

So i guess 'cat' isn't being run, but used as an argument.

Offline

#9 2010-09-11 20:37:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Installing list of packages contained in file

AcId wrote:
flamelab wrote:

Hmm,

for pkg in `cat list.txt`;do pacman S --asdeps $pkg;done

?

Returns:

error: 'cat': could not be found or read package

So i guess 'cat' isn't being run, but used as an argument.

Are you sure you've used backticks? It seems to work for me.
`- backtick
' - single quote

Try this:

for pkg in $(cat list.txt);do pacman -S --asdeps $pkg; done

Last edited by karol (2010-09-11 20:39:20)

Offline

#10 2010-09-11 20:38:32

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Installing list of packages contained in file

Make sure you are using backquotes ` not single quotes '

Offline

#11 2010-09-11 20:40:59

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED] Installing list of packages contained in file

i found this method of install packaging kinda useless. All packages will be install as explicit and you can't really get rid of bloat smile


Give what you have. To someone, it may be better than you dare to think.

Offline

#12 2010-09-11 20:43:17

AcId
Member
Registered: 2009-07-11
Posts: 25

Re: [SOLVED] Installing list of packages contained in file

anonymous_user wrote:

Make sure you are using backquotes ` not single quotes '

My bad; It works wondures now smile
Thanks y'all.

Offline

#13 2010-09-11 20:45:18

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Installing list of packages contained in file

@wonder - But the end effect would be the same as if you manually typed out the package names, wouldn't it?

Offline

#14 2010-09-11 20:54:52

AcId
Member
Registered: 2009-07-11
Posts: 25

Re: [SOLVED] Installing list of packages contained in file

anonymous_user wrote:

@wonder - But the end effect would be the same as if you manually typed out the package names, wouldn't it?

Yes.

pacman -S 'cat /path/to/file'

(With backsticks instead of ' - my iPhone doesn't have backsticks)
Worked for me as if i types the package names manually.

Offline

#15 2010-09-11 23:31:49

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED] Installing list of packages contained in file

anonymous_user wrote:

@wonder - But the end effect would be the same as if you manually typed out the package names, wouldn't it?

no. if i use pacman -S $(cat somelist) and i decide to remove some package, pacman -Rs package would not remove the dependencies and neither pacman -Qdtq because all packages are installed explicit


Give what you have. To someone, it may be better than you dare to think.

Offline

#16 2010-09-11 23:34:42

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED] Installing list of packages contained in file

So pacman -S package1 package2 doesn't install packages explictly but pacman -S $(cat somelist) does?

Offline

#17 2010-09-11 23:38:14

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Installing list of packages contained in file

anonymous_user wrote:

So pacman -S package1 package2 doesn't install packages explictly but pacman -S $(cat somelist) does?

'pacman -S pkg1' does install pkg1 explicitly.
I think wonder was talking about the dependencies.

Offline

#18 2010-09-11 23:57:38

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: [SOLVED] Installing list of packages contained in file

what i'm saying is that the list was done with pacman -Qq -> all packages installed, explicit and as depends. ALL of them will be install explicit with pacman -S $(cat list)

if you still want to install in the same way, the list should be generated with pacman -Qqe

Last edited by wonder (2010-09-11 23:58:53)


Give what you have. To someone, it may be better than you dare to think.

Offline

#19 2010-09-12 00:44:07

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,799
Website

Re: [SOLVED] Installing list of packages contained in file

This backup/restore listing of packages has been covered a couple of times. To recap the general consensus:

# backup a list of only explicitly installed packages omitting any foreign (AUR) packages:
pacman -Qqe | grep -Fvx "$(pacman -Qqm)" > ./paclog.list

# reinstall those packages (and let them pull in their own deps):
pacman -S --noconfirm --needed $(cat ./paclog.list)

# an alternate way without the subshell or [useless use of] cat
xargs pacman -S --noconfirm --needed < ./paclog.list

Offline

Board footer

Powered by FluxBB