Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
listing number of packages installed as non-root user
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
v_arnold
n00b
n00b


Joined: 15 Apr 2003
Posts: 52
Location: London

PostPosted: Fri Jan 23, 2004 9:21 pm    Post subject: listing number of packages installed as non-root user Reply with quote

What command line can I run as a normal user to list the packages that the gentoo sysyem has installed.

Tried
Code:

qpkg --installed


but this only works as root.

Thanks.
Back to top
View user's profile Send private message
ToddWest
n00b
n00b


Joined: 11 Nov 2003
Posts: 59
Location: Oregon

PostPosted: Fri Jan 23, 2004 9:29 pm    Post subject: Reply with quote

I am not sure if this is the correct thing to do as I am still fairly new to gentoo, but if you join the portage group you can list the packages with that command as a normal user. If this is totally the wrong way to go about it someone please correct me.
Back to top
View user's profile Send private message
v_arnold
n00b
n00b


Joined: 15 Apr 2003
Posts: 52
Location: London

PostPosted: Fri Jan 23, 2004 11:55 pm    Post subject: Reply with quote

The trouble is that i'm trying to gather information about a linux box by asking the user to run a script. The script should not have to be run as root, or having the user do any configuration. Just run the shell script and get the list of packages installed.

Many thanks again.
Back to top
View user's profile Send private message
v_arnold
n00b
n00b


Joined: 15 Apr 2003
Posts: 52
Location: London

PostPosted: Mon Jan 26, 2004 11:13 am    Post subject: Reply with quote

Worked it out.

Just cat /var/cache/edb/world -- is edb the emerge database?

Cheers.
Back to top
View user's profile Send private message
ecatmur
Advocate
Advocate


Joined: 20 Oct 2003
Posts: 3595
Location: Edinburgh

PostPosted: Mon Jan 26, 2004 2:44 pm    Post subject: Reply with quote

Nah, the world file only lists explicitly installed packages, not packages installed as deps.

It's not difficult to make someone a member of portage - in any case, what they doing answering questions about their box if they don't have root on it?
Back to top
View user's profile Send private message
v_arnold
n00b
n00b


Joined: 15 Apr 2003
Posts: 52
Location: London

PostPosted: Mon Jan 26, 2004 3:45 pm    Post subject: Reply with quote

The university wants to keep a log of the computer's specs(MAC Address, IP address, hostname, etc) and packages installed on it. For RH and Suse all one has to do is:

Code:
rpm -q -a


I feel uncomfortable doing it but it's policy.
Back to top
View user's profile Send private message
Carlo
Developer
Developer


Joined: 12 Aug 2002
Posts: 3356

PostPosted: Mon Jan 26, 2004 4:24 pm    Post subject: Re: listing number of packages installed as non-root user Reply with quote

v_arnold wrote:
What command line can I run as a normal user to list the packages that the gentoo sysyem has installed.

Are you searching for emerge -ep world?


Carlo
_________________
Please make sure that you have searched for an answer to a question after reading all the relevant docs.
Back to top
View user's profile Send private message
dgt84
Guru
Guru


Joined: 27 May 2003
Posts: 355
Location: Germany => USA

PostPosted: Mon Jan 26, 2004 4:46 pm    Post subject: Reply with quote

You could put this into listinstalled.py
Code:

#!/usr/bin/env python
import portage

installed = portage.db['/']['vartree'].getallnodes()
installed.sort()

print "These packages are installed on this system:"

for package in installed:
    print package

Then make the file executable and run the script :)

It can of course be enhanced to strip out the category and do other things, but I just wanted to give a very simple example.
_________________
Lila themes | The Porthole Portage Frontend | SVG-Utils
Back to top
View user's profile Send private message
v_arnold
n00b
n00b


Joined: 15 Apr 2003
Posts: 52
Location: London

PostPosted: Mon Jan 26, 2004 5:46 pm    Post subject: Reply with quote

Thanks dgt84 but there is already a bash script that's been written to get the info from other types of distros (RHE/Suse/Debian/SunSPACR etc) and I just needed to add a little to the script to retreive the information from a Gentoo Box.

Carlo's suggestion (thanks!) was the one I was looking for.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum