You are not logged in.

#1 2009-08-18 19:07:58

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

need to redownload all installed packages [SOLVED]

I found the redownloading all installed packages wiki page, but when I attempt either of the suggested commands on the page, pacman chokes on the first package that I installed out of the AUR.  Can someone recommend how I can simply download all of my currently installed packages to my local db?

Thanks!

# pacman -Sdw --noconfirm `pacman -Q | awk '{ print $1 }'`
# wget $(pacman -Sdp `pacman -Q | awk '{ print $1 }'`)

Last edited by graysky (2009-08-18 19:26:57)

Offline

#2 2009-08-18 19:16:49

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: need to redownload all installed packages [SOLVED]

Hmm... any problems with doing the following:

$ pacman -Q | awk '{ print $1 }' > pkglist
# pacman -Sw `cat pkglist`

(credit to timtux in this post).

Last edited by graysky (2009-08-18 19:18:44)

Offline

#3 2009-08-18 19:17:54

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

Re: need to redownload all installed packages [SOLVED]

first,

pacman -Q | awk '{ print $1 }' == pacman -Qq

second,

pacman -Qq | grep -vx "$(pacman -Qqm)" will filter out the foreign (aur) packages

/edit:

personally, i would:

pacman -Qqe | grep -vx "$(pacman -Qqm)" | xargs pacman -Sdw --noconfirm && cp /var/cache/pacman/pkg/* ~/pkg_backups/

Last edited by brisbin33 (2009-08-18 19:48:45)

Offline

#4 2009-08-18 19:20:24

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: need to redownload all installed packages [SOLVED]

My method chokes on AUR packages and also on groups of packages.  I'll give your suggestion a shot.

EDIT: I added your suggestion to the wiki page.  Thank you!

Last edited by graysky (2009-08-18 19:26:40)

Offline

#5 2009-08-18 19:47:23

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

Re: need to redownload all installed packages [SOLVED]

graysky wrote:

EDIT: I added your suggestion to the wiki page.  Thank you!

thanks! please test it and let me know if it works.  don't really want to do all that downloading to test it myself big_smile.

/edit: added the -d and --noconfirm flags here and in the wiki.

/edit2: just tested (without --noconfirm) and it set up the targets just fine, looks good to me.

Last edited by brisbin33 (2009-08-18 19:50:43)

Offline

#6 2009-08-18 19:50:44

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: need to redownload all installed packages [SOLVED]

Cool, it needed the noconfirm switch for sure, otherwise it lists all the packages to d/l but drops to a shell prompt.  Now I'll just need to modify my backup script for /var to keep my backup set from becoming too large smile

tar zcvfp var-arch_backup.tar.gz /var --exclude "/var/cache/pacman/pkg"

Last edited by graysky (2009-08-18 19:56:34)

Offline

#7 2009-08-18 19:58:34

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: need to redownload all installed packages [SOLVED]

One question... will that command check the md5sums of the packages in /var/cache/pacman/pkg as well?

Offline

#8 2009-08-18 20:08:37

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

Re: need to redownload all installed packages [SOLVED]

i know nothing of that.  my command just downloads fresh *.pkg.tar.gz's of any non-foreign packages you have explicitly installed (as reported by -Qqe).  i'm not sure if pacman does integrity checks post-download or pre-install.  maybe a pacman dev can answer.

Offline

#9 2009-08-18 21:11:56

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,731
Website

Re: need to redownload all installed packages [SOLVED]

I actually think it does... when I use your shell command after all my packages are populated, I get a line that reads, "checking package integrity..." then a fresh shell.

VERIFIED: it does indeed.  I removed /var/cache/pacman/pkg/zvbi-0.2.33-1-x86_64.pkg.tar.gz then touched an empty file of the same name.  After re-running your command, pacman detected the problem, removed the offending package and re-downloaded when I ran it a second time.  Smart smile

checking package integrity...
:: File zvbi-0.2.33-1-x86_64.pkg.tar.gz is corrupted. Do you want to delete it? [Y/n] 
error: failed to commit transaction (invalid or corrupted package)
zvbi-0.2.33-1-x86_64.pkg.tar.gz is invalid or corrupted
Errors occurred, no packages were upgraded.

Last edited by graysky (2009-08-18 21:14:48)

Offline

#10 2009-08-18 21:14:24

Xyne
Forum Fellow
Registered: 2008-08-03
Posts: 6,965
Website

Re: need to redownload all installed packages [SOLVED]

powerpill -Sdw --noconfirm $(pacpal --list-repo-pkgs)

You can also use metapax to rebuild installed packages not available in the repos, e.g. packages from the AUR.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB