You are not logged in.

#1 2010-10-22 21:39:53

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Pacman -- GUI Database Viewer [SOLVED]

I'm looking for the pacman command that would do the following:

show all the following in a single window
shows all packages with version #'s available in the repos you set up
shows if installed or not and what repo it's in
shows details on the package with a simple click
no typing, just scrolling and clicking
have copy and paste available

I used to use the following command for this but it stopped working:

gtkpacman

Would it be degrading (un-macho) for an Archlinux wannabe guru,  to admit that sometimes, a gui with mouse capacity really are superior to the cl?

If so, would it be less degrading to call it,..........a package manager database viewer............

Am I just not diving into pacman commands enough to find that command?

***Edit by Jeff:   Above is a joke (bad).......haha.......  I realize there is no pacman command for that. gtkpacman is abandoned / orphaned, last update nearly 3 years ago. Shaman, no longer workable as far as I know, abandoned, taken over by Chakra? The list goes on for abandoned pacman GUI's. A supported pacman **** GUI database viewer **** showing what I list above would be a nice addition to the pacman cl. Good or Bad idea and why?

I use pacman command line for ALL package manipulation....but....
I prefer to read the package database with a gui app.


Anyone else?

Last edited by jeff story (2011-04-27 00:34:11)


Check out my website for info on the Arch Linux Installer

Offline

#2 2010-10-22 21:47:22

hume's doona
Member
Registered: 2009-12-11
Posts: 206

Re: Pacman -- GUI Database Viewer [SOLVED]

I think there are front ends for pacman that have a gui... search the wiki, maybe change the topic title to "looking for pacman gui?" or something.

not un-manly, just un-archly

Offline

#3 2010-10-22 22:36:12

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

Re: Pacman -- GUI Database Viewer [SOLVED]

pacman -Sl core

will show all package from that repo and will tell you which ones you have installed.

pacman -Sp --print-format "%r/%n-%v" <appname>

will show you e.g.

extra/htop-0.8.3-1

You can also

[karol@black ~]$ pacman -Ss htop
extra/htop 0.8.3-1 [0,04 MB] [installed]
    Interactive process viewer

Copy & paste is not a problem :-)
Maybe you can create a hyperlinked database so that the details will be available by clicking the app's name or you can configure a custom mouse action.

Offline

#4 2010-10-22 22:40:35

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: Pacman -- GUI Database Viewer [SOLVED]

man pacman

What exactly is 'easier' with using a GUI than using the CLI for your package management. You'd still have to type in your search query anyhow. If you just want to browse all packages, go to the web interface.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#5 2010-10-22 22:41:10

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Pacman -- GUI Database Viewer [SOLVED]

Dump the contents of all the syncs into a text file with 'pacman -Ss' and open the file in your GUI text editor of your choosing.

I'm only half kidding.

Offline

#6 2010-10-22 22:53:47

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

Re: Pacman -- GUI Database Viewer [SOLVED]

@ ngoonee
The web interface doesn't show which packages you have installed.

@ falconindy
But how do you create a collapsible info structure where the details of a package are shown on mouseclick?

Offline

#7 2010-10-22 23:09:29

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: Pacman -- GUI Database Viewer [SOLVED]

karol wrote:

@ falconindy
But how do you create a collapsible info structure where the details of a package are shown on mouseclick?

Not a problem I have any desire to solve. I, like many archers, find pacman alone to be quite sufficient. Perhaps pactree could be retrofitted to work on the syncs and not necessarily your local DB only

Offline

#8 2010-10-22 23:19:56

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Pacman -- GUI Database Viewer [SOLVED]

If you want a gui, you want a gui - your choice. IMO the worst thing here is this:

jeff story wrote:

I used to use the following command for this but it stopped working:

gtkpacman

"it stopped working"?? Did you investigate why? Did you make any effort to make it "start working" again? Did you post bug reports? Contact the developer? Ask here? Why give up on it, if it's that important to you?


BTW, one more thing... I've just built and installed gtkpacman, and it's doing everything on your list. Removing it again now, 'cos I'm macho. smile

Offline

#9 2010-10-23 01:01:08

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Re: Pacman -- GUI Database Viewer [SOLVED]

tomk wrote:

Did you investigate why?

YES

tomk wrote:

Did you make any effort to make it "start working" again?

NO (see below)

tomk wrote:

Did you post bug reports?

  NO (see below)

tomk wrote:

  Contact the developer?

NO (see below)

tomk wrote:

  Ask here?

Why bother ask when I already know why it doesn't work. This is off topic to this thread isn't it?

tomk wrote:

Why give up on it, if it's that important to you?

Where to start........
It's an abandoned / orphaned project.
It's not an official Arch project. Why would I report an Arch bug?
I don't have the skills to take on the project or I just might.
I did read today in the AUR on it about a rebuild fix that was reported to have not worked.
I have not yet tried recompiling myself, as I consider myself at the bottom of the Arch Linux community skill level.
I wanted to see how the more skilled Archers were handling the things that I did with gtkpacman to see if I was ready to give up on the GUI......

Why the hostility towards me.......and anyone else who has ever proposed. dare I say, a GUI app relating to pacman?

So you see, I really did think about this before I posted, and have thought for quite some time about it.

I also thought that if anyone would "bite" on this usually taboo subject, and see my idea as useful with support, then perhaps I could try to (direct?) the community towards a permanent solution.

Sorry if I was out of line somehow though. Meant no harm to anyone,

I just thought that if someone(s) else has possibly come to the same conclusion, and would be brave enough say so, perhaps the time had come….

BTW my first post where I explained, "it stopped working" was my bad attempt at some humor.....
like pacman -gtkpacman was even a command!

Last edited by jeff story (2010-10-23 01:28:07)


Check out my website for info on the Arch Linux Installer

Offline

#10 2010-10-23 01:08:07

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

Re: Pacman -- GUI Database Viewer [SOLVED]

Quick'n'dirty:

#!/bin/bash

title=main
foo () {

echo "
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>$title</title>
</head>
<body>"

#for name in $(pacman -Slq core extra); do
for name in acl attr autoconf automake b43-fwcutter bash bison firefox opera; do
toc=$(pacman -Ss ^"$name"$ | grep /"$name")

echo "
<a href="$title#$name">
$toc
</a>
<br />"
done

echo "
<br />
<br />
<br />
<br />
<br />
<br />"
#for name in $(pacman -Slq core extra); do
for name in acl attr autoconf automake b43-fwcutter bash bison firefox opera; do
details=$(pacman -Si $name)

echo "
<a name="$name">$name details</a>
<pre>
$details
</pre>"
done

echo "
</body>
</html>"; }

foo > $title && $BROWSER $title

This script creates one big html page where you have things that look like this (yeah, the last line - opera - looks a bit weird, more on that later):

core/acl 2.2.49-1 [0,13 MB] [installed]
core/attr 2.4.44-1 [0,07 MB] (base) [installed]
core/autoconf 2.68-1 [0,56 MB] (base-devel) [installed]
core/automake 1.11.1-1 [0,58 MB] (base-devel) [installed]
core/b43-fwcutter 013-1 [0,01 MB]
core/bash 4.1.007-1 [0,67 MB] (base) [installed]
core/bison 2.4.3-1 [0,35 MB] (base-devel) [installed]
extra/firefox 3.6.11-1 [0,74 MB] [installed]
unarch/opera 10.61-1 [10,14 MB] archstuff/opera 10.63-1 [10,17 MB] archstuff/opera-devel 10.70_6396-1 [10,15 MB] dragonlord/opera 10.63-1 [10,19 MB] 

on the top (I called that part toc) and below you have the details:

acl details

Repository     : core
Name           : acl
Version        : 2.2.49-1
URL            : [url]http://savannah.nongnu.org/projects/acl[/url]
Licenses       : LGPL
Groups         : None
Provides       : xfsacl
Depends On     : attr>=2.4.41
Optional Deps  : None
Conflicts With : xfsacl
Replaces       : xfsacl
Download Size  : 132,25 K
Installed Size : 596,00 K
<blah blah blah>

attr details

Repository     : core
Name           : attr
<blah blah blah>

Some packages are a bit tricky, if they are present in multiple repos

opera details

Repository     : unarch
Name           : opera
Version        : 10.61-1
<cut>

Repository     : archstuff
Name           : opera
Version        : 10.63-1
<cut>

Repository     : dragonlord
Name           : opera
Version        : 10.63-1
<cut>

There are probably many things that need to be fixed in the script (set the proper html encoding, don't assume the user has $BROWSER set etc.), but you can give it a go, it won't eat your pet hamster ;P
If you don't know how to use that script, just ask.
It takes about 2 seconds per package to generate on my P4.

P.S. An easy way to distinguish the installed packages is to use the built-in search function you have in your browser. I use firefox and it nicely highlights the search terms, like this:

core/automake 1.11.1-1 [0,58 MB] (base-devel) [installed]
core/b43-fwcutter 013-1 [0,01 MB]
core/bash 4.1.007-1 [0,67 MB] (base) [installed]
core/bison 2.4.3-1 [0,35 MB] (base-devel) [installed]
extra/firefox 3.6.11-1 [0,74 MB] [installed]

Edit: I've edited the script, the encoding should be OK now.

Edit 2:
Another little change in the script:

@@ -13,6 +13,6 @@
 
 #for name in $(pacman -Slq core extra); do
 for name in acl attr autoconf automake b43-fwcutter bash bison firefox opera; do
-toc=$(pacman -Ss ^"$name"$ | grep /"$name")
+toc=$(pacman -Sl core | grep -w $name | grep -v "$name-" | grep -v -- "-$name")

Now it takes just 0.5 second per package.

Last edited by karol (2010-10-23 03:29:59)

Offline

#11 2010-10-23 05:16:07

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Re: Pacman -- GUI Database Viewer [SOLVED]

karol,

Very cool!!   I wasn't expecting anyone to jump in this deep at this point. I was just wondering if I was the only one who saw a need for such an app.  Guess not?

I'm still at work so can't try it now, but I'll definately be giving this a try over the weekend.


Check out my website for info on the Arch Linux Installer

Offline

#12 2010-10-23 08:18:26

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: Pacman -- GUI Database Viewer [SOLVED]

Apologies for not getting your "joke", and thanks for admitting it was a bad one. smile

I guess you missed this part of my post:

tomk wrote:

BTW, one more thing... I've just built and installed gtkpacman, and it's doing everything on your list.

I made one small change to the PKGBUILD i.e. changing 'python' to 'python2' in the build function. If you're not building in a clean chroot, however, you might need something a bit more kludgy, such as the fixes posted in the AUR.

Also, I think it's clear that my (non-hostile) comments are directed at your bald statement that "it stopped working" (now identified as attempted humour). and not at your desire to use a GUI to query your pacman database.

FInally, someone else did think a gui database viewer might be useful - it's here if you're still interested.

Offline

#13 2010-10-23 08:41:31

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

Re: Pacman -- GUI Database Viewer [SOLVED]

This is an ugly hack, use at your own risk.

Line 94 in pacman-3.4.1/src/pacman/package.c now looks like this:

  printf(_("Name           :<a name='%s'>%s</a>\n"), alpm_pkg_get_name(pkg), alpm_pkg_get_name(pkg));

The text output is fugly:

[karol@black ~]$ pacman -Qi htop
Name           : <a name='htop'>htop</a>
Version         : 0.8.3-1

but it generates a nice html file with the needed links. It quite fast: the script below takes about ten seconds.

#!/bin/bash

title=main
foo () {
echo "
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>$title</title>
</head>
<body>"

for name in $(pacman -Slq core); do
  toc=$(pacman -Sl core | grep -E "[^-a-z]$name[^-a-z]")
  echo "<a href="$title#$name">$toc</a><br />"
done

details=$(pacman -Si)
echo "<br /><br /><pre>$details</pre></body></html>"; }

foo > $title && elinks main

Offline

#14 2010-10-23 08:56:42

LeCrayonVert
Member
Registered: 2010-09-01
Posts: 134

Re: Pacman -- GUI Database Viewer [SOLVED]

Install gnome-packagekit and packagekit-pacman (from AUR). This is the best GUI I've found so far. Its look is consistent with other linux distribution that use packagekit as well wink
packagekit-pacman is just a gui frontend to alpm library
Here is a screenshot of gpk-application, a database viewer included in gnome-packagekit :
http://pix.toile-libre.org/?img=1287824090.png


I believe in a world I can and do understand. A rational universe, explained through rational means.

Offline

#15 2010-10-23 10:48:12

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

Re: Pacman -- GUI Database Viewer [SOLVED]

In pacman-3.4.1/src/pacman/sync.c change the line

printf("%s\n", alpm_pkg_get_name(pkg));

to

printf("<a href='main#%s'>%s</a><br />\n", alpm_pkg_get_name(pkg), alpm_pkg_get_name(pkg));

W/o this hack it took over half an hour to generate the toc (table of contents) - now it takes ten seconds. Unfortunately, loading a single page containing thousands of hyperlinks and weighting a couple MB (thanks to 'pacman -Si') is troublesome [1], but sort of works.

#!/bin/bash

foo () {
echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>main</title></head><body>"

pacman -Sql core extra community

details=$(pacman -Si)
echo "<br /><br /><pre>$details</pre></body></html>"; 
}

foo > main && elinks main

Edit: [1] IIRC the problems arise due to safe-browsing features etc. - firefox starts eating up RAM like crazy and eventually crashes when runs out or even worse - you kill it out of pity when the browser starts nibbling on your swap ... elinks has no problems :-D

Last edited by karol (2010-10-23 15:07:38)

Offline

#16 2010-10-23 17:00:21

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

Re: Pacman -- GUI Database Viewer [SOLVED]

Welcome to the next fascinating episode of me breaking pacman!


Small change, pacman-3.4.1/src/pacman/package.c:

printf(_("Name           : <a name='%s'>%s</a>\n"), alpm_pkg_get_name(pkg), alpm_pkg_get_name(pkg));

There's a space after the colon ^


Big change, pacman-3.4.1/src/pacman/sync.c:

if (!config->quiet) {
  printf("%s/<a href='main#%s'>%s</a> %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg),
    alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg));
  print_installed(pkg);
  printf("<br />\n");
}

instead of

if (!config->quiet) {
  printf("%s %s %s", alpm_db_get_name(db), alpm_pkg_get_name(pkg),
    alpm_pkg_get_version(pkg));
  print_installed(pkg);
  printf("\n");
}

'pacman -Slq' is nice to have in the original form so I left it alone and instead modified 'pacman -Sl'.


The next incarnation of the script:

#!/bin/bash

foo () {
  echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
  <title>main</title></head><body>"
  pacman -Sl
  echo "<br /><br /><pre>$(pacman -Si)</pre></body></html>";
}

foo > main && elinks main

In order to have a somewhat hyperlinked package db you need to make those two changes to the pacman source code, recompile and install it and run the script.
If you have the package db already cached in RAM, the script will take just a couple seconds to run.

Enjoy!

Offline

#17 2010-10-23 18:10:42

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Re: Pacman -- GUI Database Viewer [SOLVED]

Tomk,

Thanks for the info and sorry for the misinterpretation on my part. After rereading things again this morning, I see you're right on.
Apologies back to you!  In the real world, I have same "difficulties with humor"  usually due to lack of / dry on my part  :-(
Probably related to why I enjoy this stuff so much!

I just fired up my Arch in vbox to play around with some of the things posted here.  It's been a while so it's in the process of a long update at the moment.

Some interesting ideas here to try, and looking forward to playing with karol's work in progress!


Check out my website for info on the Arch Linux Installer

Offline

#18 2010-10-23 23:03:10

jeff story
Member
Registered: 2009-05-31
Posts: 237
Website

Re: Pacman -- GUI Database Viewer [SOLVED]

OK karol,

I got the first script to create the "main" file in a new directory.
Was it supposed to come up in a browser automatically?

I set my default web browser, based on your post.
(not sure this is correct)

Created a file:   ~/.htmlviewrc   
With these contents:   

 X11BROWSER=/usr/bin/firefox 

Still not coming up in Firefox.

Next I just changed "main to "main.html" and opened it with firefox.
It works as you described.

Getting this far involved a bit of guessing and trial and error for me!!
Going to proceed with the evolution of your work now.

Also, I get the following error when I run the script.

[jeff@<Arch2009p08x86_64> shtest]$ ./newfile
error: package 'opera' was not found
./newfile: line 47: main: command not found
 

Last edited by jeff story (2010-10-23 23:29:08)


Check out my website for info on the Arch Linux Installer

Offline

#19 2010-10-24 16:42:17

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: Pacman -- GUI Database Viewer [SOLVED]

Are you looking for a thing like this?
https://bbs.archlinux.org/viewtopic.php?id=103818

wink

edit: ops, it was linked some posts above, didn't saw , sorry.

Last edited by mangus (2010-10-24 16:53:20)

Offline

#20 2010-10-25 13:40:10

kachelaqa
Member
Registered: 2010-09-26
Posts: 216

Re: Pacman -- GUI Database Viewer [SOLVED]

jeff story wrote:

I was just wondering if I was the only one who saw a need for such an app.

i agree that a gui package browser would be a nice thing to have.

strictly speaking, it's not "needed" because all the functionality is available through the cli. but, by the same token, you could also argue that, say, firefox is not "needed" because all the functionality is available through terminal browsers like lynx.

personally, a package browser is the thing i miss the most from mandriva. i always preferred using the cli tools (urpmi) for making changes to my mandriva system, but only ever used the gui for browsing. a mouse-driven gui is just way more convenient than the cli - navigation is much faster and simpler, and the information is presented in a more accessible way.

mangus wrote:

Are you looking for a thing like this?
https://bbs.archlinux.org/viewtopic.php?id=103818

i had a look at that, but it seems to suffer from the same limitation that all the other existing gui apps have: it only works with pacman.

what is needed is a gui front-end for the package-query tool used by yaourt.

i think i may have a go at writing one.

Offline

#21 2010-10-25 13:44:13

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

Re: Pacman -- GUI Database Viewer [SOLVED]

kachelaqa wrote:

you could also argue that, say, firefox is not "needed" because all the functionality is available through terminal browsers like lynx.

You can watch flash videos in lynx?  big_smile

Offline

#22 2010-10-25 13:49:05

kachelaqa
Member
Registered: 2010-09-26
Posts: 216

Re: Pacman -- GUI Database Viewer [SOLVED]

Allan wrote:
kachelaqa wrote:

you could also argue that, say, firefox is not "needed" because all the functionality is available through terminal browsers like lynx.

You can watch flash videos in lynx?  big_smile

yeah - just use your imagination to fill in any gaps smile

Offline

#23 2010-10-25 14:02:32

mangus
Member
From: Bologna, Italy
Registered: 2007-04-07
Posts: 289

Re: Pacman -- GUI Database Viewer [SOLVED]

mangus wrote:

Are you looking for a thing like this?
https://bbs.archlinux.org/viewtopic.php?id=103818

i had a look at that, but it seems to suffer from the same limitation that all the other existing gui apps have: it only works with pacman.

what is needed is a gui front-end for the package-query tool used by yaourt.

i think i may have a go at writing one.

pdi is a frontend for pacman -Q and pacman-contrib tools. I don't know package-query capabilities but if they are useful I could
implement some , I'll take a look , thanks for pointing me

Offline

#24 2010-11-06 09:11:15

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: Pacman -- GUI Database Viewer [SOLVED]

Does not qualify as Arch discussion, moving to Pacman subforum.


ᶘ ᵒᴥᵒᶅ

Offline

#25 2010-11-06 12:16:27

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

Re: Pacman -- GUI Database Viewer [SOLVED]

@ jeff story
Sorry I haven't responded earlier, but I somehow missed your last post.

This work is just a proof of concept so it's definitely not polished - it's a hack (meaning things are not always explicit, it can be inconsistent across the "versions" I've posted here, it was hastily written without too much planning or testing etc.) and requires that you have a look at the script and change it to suit your needs. Just to be sure, is this the script you're referring to?

In my .bashrc I have

export BROWSER="/usr/bin/firefox"

and that's the variable I'm using in the script. Of course you can simply change

foo > $title && $BROWSER $title

to

foo > $title && /usr/bin/firefox $title

The Opera error: the packages I listed were just a way to quickly test the script. Opera is not in the official repos, but it's in the unofficial user repos like unarch, archstuff and dragonlord. If you have them enabled, the script can search them too. You can uncomment the first lines and comment the out the other, change this:

#for name in $(pacman -Slq core extra); do
for name in acl attr autoconf automake b43-fwcutter bash bison firefox opera; do

into this:

for name in $(pacman -Slq core extra); do
#for name in acl attr autoconf automake b43-fwcutter bash bison firefox opera; do

so that the script lists all the packages in the specified repos (here just core and extra) - it will take quite some time to run.


If you're still interested and don't want to hack your pacman you can try this (I've cleaned it up a bit):

#!/bin/bash

# The title of the generated html file
title="main.html"

# Where to save the file to
path="/home/karol"

foo () {

echo "
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>$title</title>
</head>
<body>"

# What repos to list
repos="core"
for pkgname in $(pacman -Slq $repos); do
toc=$(pacman -Sl $repos | grep -w $pkgname | grep -v "$pkgname-" | grep -v -- "-$pkgname")

echo "
<a href="$title#$pkgname">
$toc
</a>
<br />"
done

echo "
<br />
<br />
<br />
<br />
<br />
<br />"
for pkgname in $(pacman -Slq $repos); do
details=$(pacman -Si $pkgname)

echo "
<a name="$pkgname">$pkgname details</a>
<pre>
$details
</pre>"
done

echo "
</body>
</html>"; }


foo > $path/$title && /usr/bin/firefox $path/$title

I prefer using my hacked version of pacman as installing and uninstalling a package (my hacked version of pacman that is) takes 2-3 seconds (if the package db is already cached), running the script that makes use of that hack

#!/bin/bash

foo () {
echo "<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>main</title></head><body>"

/usr/bin/pacman -Sl
echo "<br /><br /><pre>$(/usr/bin/pacman -Si)</pre></body></html>";
}

foo > main && /usr/bin/elinks main

takes about 10 seconds so it's much much faster than using the unmodified version of pacman and that longer script you're using.

Offline

Board footer

Powered by FluxBB