View previous topic :: View next topic |
Author |
Message |
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Sat Nov 23, 2002 4:18 am Post subject: [FAQF] GF3: How do I get a list of installed packages? |
|
|
This is the feedback thread for GF3: How do I get a list of installed packages?. _________________ Quis separabit? Quo animo?
Last edited by pjp on Thu Jan 16, 2003 10:19 pm; edited 1 time in total |
|
Back to top |
|
|
rojaro l33t
Joined: 06 May 2002 Posts: 732
|
Posted: Sat Nov 23, 2002 10:59 am Post subject: |
|
|
what about /usr/lib/portage/bin/pkglist ...? _________________ A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970) |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Mon Nov 25, 2002 3:20 pm Post subject: |
|
|
Didn't know about that. Interesting, that by default, /usr/lib/portage/bin/ is not in the PATH. I wonder why. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
securiteaze Tux's lil' helper
Joined: 24 Oct 2002 Posts: 77 Location: Tulsa,Oklahoma
|
Posted: Tue Dec 03, 2002 10:13 pm Post subject: |
|
|
You could also use 'epm' an rpm workalike for Gentoo Linux
Install it : Code: | emerge sync && emerge epm |
List all installed packages :
Determine what package provides a file : Code: | epm -qf /usr/bin/host
bind-tools-9.2.1 |
_________________ Blah.. |
|
Back to top |
|
|
janneand n00b
Joined: 13 Sep 2002 Posts: 48 Location: Stockholm, Sweden
|
Posted: Wed Dec 04, 2002 4:13 pm Post subject: |
|
|
You think the solutions above are too slow? Try this -
Code: | find /var/db/pkg/ -mindepth 2 -maxdepth 2 -printf "%P\n" |
If you prefer them wihtout the leading group, use %f instead of %P.
TIPS: Add this to you ~/.bashrc
Code: | alias listinstalled='find /var/db/pkg/ -mindepth 2 -maxdepth 2 -printf "%P\n"' |
Save it and...
-J |
|
Back to top |
|
|
S_aIN_t Guru
Joined: 11 May 2002 Posts: 488 Location: Ottawa
|
Posted: Thu Dec 05, 2002 10:27 am Post subject: |
|
|
thanks for the find alias. that works much faster than qpkg.. |
|
Back to top |
|
|
janneand n00b
Joined: 13 Sep 2002 Posts: 48 Location: Stockholm, Sweden
|
Posted: Thu Dec 05, 2002 11:01 am Post subject: |
|
|
I continued to hack a little bit on that command and came up with this, called qportage. The idea is to be faster than qpkg.
To get this to work - paste it into a file, watch so you don't get a space after the EOF-line and append all lines separated by \.
EDIT:
New version has been added as an ebuild to Bugzilla, Bug#: 11637. Now support for listing files in installed ebuilds, colors and extra information (homepage and ebuild description).
-J
Code: | #!/bin/bash
# Copyright 2002 Jan Andersson
# Distributed under the terms of the GNU General Public License v2
usage() {
cat <<EOF
Tool to quickly list ebuilds in Gentoo.
qportage [options...] [filters...]
Parameters without option specifiers are filtering the output.
Options:
-h Show this help
-i List installed packages only
-v List and print all versions
-g Hide group name
Examples:
# qportage
List all available ebuilds.
# qportage -i dev
List everything installed that is dev-related.
# qportage -vig ^glib-
List available versions of glib.
# qportage quake doom
List available quake and doom packages.
EOF
}
TEMP=`getopt -o igvh --long help -n 'qportage' -- "$@"`
if [ $? != 0 ]
then
exit 1
fi
eval set -- "$TEMP"
group=1
while true
do
case "$1" in
-h|--help)
usage; exit;;
-g)
unset group; shift;;
-v)
version=1; shift;;
-i)
installed=1; shift;;
--) shift; break;;
*) echo "Internal error."; exit 1;;
esac
done
if [ -z $1 ]
then
filter=".?"
else
for f in $@
do
filter="$filter --regexp=$f"
done
fi
if [ $group ]
then
field=P
else
field=f
fi
if [ $installed ]
then
if [ $version ]
then
find /var/db/pkg -mindepth 2 -maxdepth 2 -printf \
"%$field\n"|grep $filter|sort
else
find /var/db/pkg -mindepth 2 -maxdepth 2 -printf \
"%$field\n"|awk -F- '
{
# Remove version
for (i=1; i <= NF; i++) {
if ($i ~ /^[0-9]/)
break;
if (i>1)
printf "-";
printf $i;
}
printf "\n";
next;
} '|grep $filter|sort|uniq
fi
else
if [ $version ]
then
find /var/cache/edb/dep -mindepth 2 -maxdepth 2 -printf \
"%$field\n"|grep $filter|sort
else
if [ $group ]
then
find /usr/portage -type d -mindepth 2 -maxdepth 2 \
-printf "%P\n"|awk -F/ '
{
# Print only real ebuilds (and not packages etc)
if ($1 ~ /-/)
printf $1 "/" $2 "\n"
}'|grep $filter|sort|uniq
else
find /usr/portage -type d -mindepth 2 -maxdepth 2 \
-printf "%P\n"|awk -F/ '
{
# Print only real ebuilds (and not packages etc)
if ($1 ~ /-/)
printf $2 "\n"
} '|grep $filter|sort|uniq
fi
fi
fi
|
|
|
Back to top |
|
|
Beefrum Apprentice
Joined: 23 May 2006 Posts: 234
|
Posted: Thu Jun 29, 2006 1:35 am Post subject: |
|
|
Code: | # Build Gentoo version file
equery l > version
# Build Gentoo world file
equery -C -q list | cut -d ' ' -f 5 | sed -n 's/-[0-9]\{1,\}.*$//p' > world |
_________________ Give adaptive answers to unknown problems! |
|
Back to top |
|
|
beatryder Veteran
Joined: 08 Apr 2005 Posts: 1138
|
Posted: Thu Jun 29, 2006 3:58 am Post subject: |
|
|
pjp wrote: | Didn't know about that. Interesting, that by default, /usr/lib/portage/bin/ is not in the PATH. I wonder why. |
That file does not exist on my compy... running portage 2.1 _________________ Dont make it idiot proof, make it work.
Neucode.org
<suppressed key> |
|
Back to top |
|
|
kallamej Administrator
Joined: 27 Jun 2003 Posts: 4975 Location: Gothenburg, Sweden
|
Posted: Thu Jun 29, 2006 8:37 am Post subject: |
|
|
beatryder wrote: | pjp wrote: | Didn't know about that. Interesting, that by default, /usr/lib/portage/bin/ is not in the PATH. I wonder why. |
That file does not exist on my compy... running portage 2.1 |
Well, the post you quoted is over 3½ years old. IIRC, it was gone also in the later 2.0.x versions. _________________ Please read our FAQ Forum, it answers many of your questions.
irc: #gentoo-forums on irc.libera.chat |
|
Back to top |
|
|
beatryder Veteran
Joined: 08 Apr 2005 Posts: 1138
|
Posted: Thu Jun 29, 2006 2:57 pm Post subject: |
|
|
kallamej wrote: | beatryder wrote: | pjp wrote: | Didn't know about that. Interesting, that by default, /usr/lib/portage/bin/ is not in the PATH. I wonder why. |
That file does not exist on my compy... running portage 2.1 |
Well, the post you quoted is over 3½ years old. IIRC, it was gone also in the later 2.0.x versions. |
hehe, that'll learn me to read post dates I guess :p _________________ Dont make it idiot proof, make it work.
Neucode.org
<suppressed key> |
|
Back to top |
|
|
geophotog n00b
Joined: 10 Aug 2006 Posts: 2
|
Posted: Thu Aug 10, 2006 10:02 pm Post subject: list installeld packages |
|
|
qpkg has been deprecated and replaced with "equery" in current gentoolkit |
|
Back to top |
|
|
Dralnu Veteran
Joined: 24 May 2006 Posts: 1919
|
Posted: Thu Aug 10, 2006 10:29 pm Post subject: |
|
|
To get a quick list of installed packages:
eix -I >> installed_apps
If you keep your database updated (daily cronjob of update-eix), that will list everything REAL fast.
Also, you could also cat the file, and if you want,
eix -vI >> installed_apps
to give you a good listing of all your installed files with nice little descriptions of which you can then cat && grep through for a refrence from then on.
Enjoy.
P.S. You could run update_eix && eix -vI >> /path/to/file to keep an updated list handy. Personally, I drop those files in my /home/user dir, and then I can just cat from there. Makes things rahter quick _________________ The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner. |
|
Back to top |
|
|
PLum Tux's lil' helper
Joined: 20 May 2004 Posts: 108 Location: /dev/world/poland/gliwice
|
Posted: Sun Mar 16, 2008 1:31 am Post subject: |
|
|
im really happy that i find that post here
i need to make almost same gentoo server but on really difrent machine and i use
Code: |
update-eix
eix -I|grep "\[I\]"| cut -d\ -f2
|
and that make me a list of packages to emerge on the new machine. |
|
Back to top |
|
|
mv Watchman
Joined: 20 Apr 2005 Posts: 6749
|
Posted: Sun Mar 16, 2008 10:45 am Post subject: |
|
|
Awakening dead threads again?
Meanwhile there is "qlist -I". And since quite a while also eix doesn't need posprocessing for what you want:
Code: | eix -I --only-names |
|
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Thu Jun 21, 2012 12:48 pm Post subject: |
|
|
More necromancy!
If eix is installed (current version 0.23.10) then the following can be used:
The resulting list is practically instantanious, but obviously this due the fact that eix uses a cache and therefore 'eix-update' will need to be run to keep this cache up-to-date.
best ... khay |
|
Back to top |
|
|
|