View previous topic :: View next topic |
Author |
Message |
v_arnold n00b
Joined: 15 Apr 2003 Posts: 52 Location: London
|
Posted: Fri Jan 23, 2004 9:21 pm Post subject: listing number of packages installed as non-root user |
|
|
What command line can I run as a normal user to list the packages that the gentoo sysyem has installed.
Tried
but this only works as root.
Thanks. |
|
Back to top |
|
|
ToddWest n00b
Joined: 11 Nov 2003 Posts: 59 Location: Oregon
|
Posted: Fri Jan 23, 2004 9:29 pm Post subject: |
|
|
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 |
|
|
v_arnold n00b
Joined: 15 Apr 2003 Posts: 52 Location: London
|
Posted: Fri Jan 23, 2004 11:55 pm Post subject: |
|
|
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 |
|
|
v_arnold n00b
Joined: 15 Apr 2003 Posts: 52 Location: London
|
Posted: Mon Jan 26, 2004 11:13 am Post subject: |
|
|
Worked it out.
Just cat /var/cache/edb/world -- is edb the emerge database?
Cheers. |
|
Back to top |
|
|
ecatmur Advocate
Joined: 20 Oct 2003 Posts: 3595 Location: Edinburgh
|
Posted: Mon Jan 26, 2004 2:44 pm Post subject: |
|
|
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 |
|
|
v_arnold n00b
Joined: 15 Apr 2003 Posts: 52 Location: London
|
Posted: Mon Jan 26, 2004 3:45 pm Post subject: |
|
|
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:
I feel uncomfortable doing it but it's policy. |
|
Back to top |
|
|
Carlo Developer
Joined: 12 Aug 2002 Posts: 3356
|
Posted: Mon Jan 26, 2004 4:24 pm Post subject: Re: listing number of packages installed as non-root user |
|
|
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 |
|
|
dgt84 Guru
Joined: 27 May 2003 Posts: 355 Location: Germany => USA
|
Posted: Mon Jan 26, 2004 4:46 pm Post subject: |
|
|
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 |
|
|
v_arnold n00b
Joined: 15 Apr 2003 Posts: 52 Location: London
|
Posted: Mon Jan 26, 2004 5:46 pm Post subject: |
|
|
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 |
|
|
|