You are not logged in.

#1 2005-05-14 03:17:05

miqorz
Member
Registered: 2004-12-31
Posts: 475

List all packages from a particular repository?

Alright, I've just ran through the pacman man page again, And I can seem to find a -Q switch that shows packages from a certain repo.

I want to delete all the packages I have from TURs and delete the sources from my pacman.conf and make said packages myself.


http://wiki2.archlinux.org/

Read it. Love it. Live it. Or die.

Offline

#2 2005-05-14 05:45:12

iBertus
Member
From: Greenville, NC
Registered: 2004-11-04
Posts: 2,228

Re: List all packages from a particular repository?

I don't remember seeing an option to list packages from a specific repo. Perhaps if this isn't a current feature, it would make a good one for future development.

Offline

#3 2005-05-14 06:12:00

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: List all packages from a particular repository?

er - it's scriptable to some extent using pacman -Sl reponame and some grepping of pacman -Qs ( i think, am in windows)

Offline

#4 2005-05-14 06:54:07

cactus
Taco Eater
From: t͈̫̹ͨa͖͕͎̱͈ͨ͆ć̥̖̝o̫̫̼s͈̭̱̞͍̃!̰
Registered: 2004-05-25
Posts: 4,622
Website

Re: List all packages from a particular repository?

pacman -Sl repo

but only if the repo is in your repo list

wget -q -O - http://path/to/repo.db.tar.gz | tar -tvz | grep -e "^d" | awk '{print $6}' 

if you know the db.tar.gz url and just want to see what packages are in there.

EDIT: *Sigh* nevermind. reread your original post and realized you were talking about something else entirely..
:oops:


"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍

Offline

#5 2005-05-18 03:17:18

dtw
Forum Fellow
From: UK
Registered: 2004-08-03
Posts: 4,439
Website

Re: List all packages from a particular repository?

Dunn oif you have done something similiar yourself, miqorz but i wrote a script for this

#!/bin/sh

pacman -Qi >./all_files

if [ -z "$1" ] ; then
    echo -e "33[0;37mNo repo given!"
    echo " usage: scriptname reponame"
fi

reponame=$1
list=$1_list
pacman -Sl $reponame >./$list
sed -i "s|$reponame |g|" ./$list
repo=`cat ./$list | cut --fields 2 --delim " "`

for pkg in $repo ; do
    if [[ $(cat ./all_files | grep -w "$pkg") ]] ; then
        echo -e "33[0;34m$pkg33[0;37m is installed"
        echo "$pkg" >>./installed_files
    elif [ "$2" == "all" ] ; then
        echo -e "33[0;31m$pkg33[0;37m is NOT installed"
    fi
done

echo
echo -n "Would you like to save the names of these pkgs to a file? (Y/n) "
read choice
if [ "$choice" == "Y" -o  "$choice" == "y" ] ; then
    echo "Currently in `pwd`"
    echo -n "    Save as: "
    read filename
    if [ -z $filename ] ; then
        echo "No name given saved as ./installed_files_$reponame"
        cp -u ./installed_files ./installed_files_$reponame
    else
        cp -u ./installed_files $filename
    fi
    rm ./installed_files
else
    rm ./installed_files
fi
rm ./$list ./all_files

like all my code it could probably be improved quite a bit but it does a good job!

give it a name and run it with:

script reponame

you can add 'all':

script reponame all - and it will tell you what isn't installed as well - i wouldn;t use it for extra and base tho but good for personal repos.

You can save the pkg names that are installed to a file and simply do:

pacman -R `cat file`

to remove all the stuff from that repo - obviously use such stuff with caution - that's why it's not and option in the script.

Offline

#6 2012-02-15 18:09:50

lpb612
Member
Registered: 2009-09-29
Posts: 16

Re: List all packages from a particular repository?

This is what I did based on the previous post.

#!/bin/bash

# List packages from a particular repository. Usage: command repo_name

comm -1 -2 <(pacman -Q|awk '{print $1}'|sort) \
   <(pacman -Sl $1 | awk '{print $2}'|sort)

Last edited by lpb612 (2012-02-15 18:13:14)

Offline

#7 2012-02-15 18:41:23

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

Re: List all packages from a particular repository?

This thread is kinda old, you know.


Use '-q' switch instead of awk:

comm -12 <(pacman -Qq|sort)  <(pacman -Slq $1|sort)

Offline

#8 2012-02-15 18:59:31

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: List all packages from a particular repository?

lpb612, you should know better than necroing a 7 year old thread.

Our forum rules: https://wiki.archlinux.org/index.php/Forum_Etiquette

Closing.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#9 2012-02-15 20:59:34

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,672
Website

Re: List all packages from a particular repository?

Abuse of mod powers....

pacman -S pacman-contrib
paclist <repo>

Offline

Board footer

Powered by FluxBB