detect all installed packages that require X

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

detect all installed packages that require X

#1 Post by sc0ttman »

How do I detect all installed packages that require X?
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
nosystemdthanks
Posts: 703
Joined: Thu 03 May 2018, 16:13
Contact:

Re: detect all installed packages that require X

#2 Post by nosystemdthanks »

a sloppy way would be to drop to the command line, try to run each program with & and note the ones that dont start. you could try this with the gui running too, and compare the two lists to avoid false positives. (or false negatives, depending how you phrase the problem.)

i havent tried it yet, but perhaps you could 2> log and look for something telling you it couldnt run without it.

some programs wont run backgrounded with & (ive had trouble with mplayer running an mp3 this way) and some wont run without proper options. you could also try running grep on the binary for the note that tells you it needs the gui to run. libraries are trickier perhaps.
[color=green]The freedom to NOT run the software, to be free to avoid vendor lock-in through appropriate modularization/encapsulation and minimized dependencies; meaning any free software can be replaced with a user’s preferred alternatives.[/color]

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#3 Post by goingnuts »

Reminded me of this post: http://www.murga-linux.com/puppy/viewto ... 475#656475

Modified approach: delete/rename libX11 and search for executebles that misses it.
After that you have to identify from which package the executable came...

User avatar
nosystemdthanks
Posts: 703
Joined: Thu 03 May 2018, 16:13
Contact:

#4 Post by nosystemdthanks »

goingnuts wrote:delete/rename libX11 and search for executebles that misses it.
nice. by the way, leafpad > log says "Cannot open display:" in the log, but renaming libX11 is even better.

i figured it would be 2> log that did that, but it is on plain stdout.
[color=green]The freedom to NOT run the software, to be free to avoid vendor lock-in through appropriate modularization/encapsulation and minimized dependencies; meaning any free software can be replaced with a user’s preferred alternatives.[/color]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#5 Post by rufwoof »

Subject description: (the starting point of building a no-X puppy)
... why not attack it from the other angle. Boot a basic busybox pup, and then add in the non-X things you prefer

mpv and/or cmus (music)
mc (file manager and text editor)
tmux
calcurse diary/calendar/todo
alpine (mail)
irssi (irc)
rtv (reddit)
htop
... etc.

tmux terminal multiplexer along with some sensible keybindings works really well. I've set F12 to step between windows (tabs), F11 to add a new tab ... as that sits well with mc's use of F1 to F10. Add in some console menus using tput/ansi/ascii art etc and my personal preference is to use one full screen terminal/tab for individual programs. cmus for instance is a great music player and I nearly always have that running in one tab. Prefer maximised windows over that of using tmux panes myself (division of a single window into separate programs/windows). You can zoom/unzoom panes so that everything is visible from a single terminal window and you maximise/restore whichever window you want to focus upon - but I tend to only use panes for when I'm comparing things side by side (vertical/central split). Another nice feature with tmux is that you can detach and later re-attach again, even from different locations/devices and everything is immediately back to how you left it.

Avoiding X altogether is a no-no IMO however. Its useful to still be able to X-forward from somewhere via ssh and run gui programs/browsers. Or even install a local browser ... I run chromium and the sole purpose of X being installed is to run that, so I set it up to be like a container/jail (restricted userid, no setuid's, no cron, no passwords entered ...etc.). I've added javascript for a calculator and text editor (local html files) for that and one tab is all my bookmarks - that shows the current date/time in the tab title, and along with google docs for collaboration/word/spreadsheets ..etc. a relatively light base system can still be highly functional if/when the need arises.

Console image attached is a actual picture taken using my phone as I run openbsd - that for security reasons prevents snapping the console via software (possible, but easier to just snap it using a phone).

I do run headless fatdog and a headless sacrificial openbsd server, and connect via vnc (fatdog) or just ssh/X-forward (Xvfb running) for other options to browse the web. Frame rates are ok, watching youtubes for instance are fine at normal size, but do stutter if made full screen. Both of those are local, looking to set yet another up at a remote location (another country) so that ssh'ing into that in effects eliminates nearly all my local end traffic visibility by my ISP. That's also more secure if out and about (pre-installed ssh keys, so eliminates any potential internet cafe man in middle attacks).
Attachments
s.png
(83.02 KiB) Downloaded 264 times
root.jpg
(34.53 KiB) Downloaded 271 times
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
nosystemdthanks
Posts: 703
Joined: Thu 03 May 2018, 16:13
Contact:

#6 Post by nosystemdthanks »

rufwoof wrote: Avoiding X altogether is a no-no IMO however.
i dont entirely agree with this, but everything else you said about it (minus this conclusion) is a good read.

playing devils advocate here, what about a program that just lets you input a list of files to delete from puppy? that way you could just say:

isodelete xenialnox.iso xenialnoxmod.iso /usr/bin/leafpad /usr/bin/mtpaint /usr/bin/ROX-filer

(i think ROX-filer is in /sbin but whatever)

and it would go about removing that from puppy? then whenever you find a file, its trivial to delete?

just a fun idea. very doable. rather than making it important to get everything "on the first try."

would have far more uses than just removing gui apps.
[color=green]The freedom to NOT run the software, to be free to avoid vendor lock-in through appropriate modularization/encapsulation and minimized dependencies; meaning any free software can be replaced with a user’s preferred alternatives.[/color]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#7 Post by rufwoof »

nosystemdthanks wrote:
rufwoof wrote: Avoiding X altogether is a no-no IMO however.
i dont entirely agree with this, but everything else you said about it (minus this conclusion) is a good read.
Thanks. And fair point. mtp/whatever mount a android phone and that could be used as your gui browser that needs a whole lot else to visit/use common web sites, and just transfer files/stuff between that and the X-less system. Personally for me however I have for instance a usage requirement of where I bash in text using mc -e text editor (focus on the content/words), I then spell check that and then add in some html inserts (top, bottom etc.) to format it as required, adding pictures if appropriate ... and then preview that in a gui browser and save to PDF for sending/sharing. Using my phones viewer/print to pdf isn't anywhere near as nice/comfortable as viewing it in a local gui browser (large screen).

For me X + gui browser pretty much are just a single 'program' that serves a useful purpose. And I treat them as a single thing, contained/restricted in being externally open/insecure. As bloated as that might be (gui browser has a dependency of X).

I'd rather see expansion of the original Unix philosophy ... everything is a (text) file. But the world has opted more for the Windows (bloat) philosophy. Given the abuse however, http pretty much commercial/ad owned/driven, and I suspect that forward time might see some reversion back to the core Unix philosophy and where the likes of talking out a document and a PDF output from that, together with 'ad-free' text type alternatives for vendors to publicise their products/services might become the expected/norm. Or even more direct links, such as (textual) ssh'ing directly into a vendors site. I guess fundamentally anything other than the pwning of http by (commercial) Google (dns, searches ..etc.). I suspect however that something like secure (ssh) gopher for searching followed up by direct ssh between you and vendors would be down trodden as hard as possible both by the likes of Google and governments (due to the greater privacy).
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
rufwoof
Posts: 3690
Joined: Mon 24 Feb 2014, 17:47

#8 Post by rufwoof »

nosystemdthanks wrote:playing devils advocate here, what about a program that just lets you input a list of files to delete from puppy? that way you could just say:

isodelete xenialnox.iso xenialnoxmod.iso /usr/bin/leafpad /usr/bin/mtpaint /usr/bin/ROX-filer

(i think ROX-filer is in /sbin but whatever)

and it would go about removing that from puppy?
Dependencies hell. ldd to find what libs might also be removed, but then having to recurse scan to ensure they're not being used elsewhere by something that isn't being removed. Many 'nix systems do package manage well for both adding and removing. Puppy however are generally a one way add-only - at least from PPM. There is IIRC a remove app choice already in Puppy, but fundamentally they're not removed just .wh flagged. Remain in the main sfs ... unless remastered to physically be remove (rebuild new sfs).
[size=75]( ͡° ͜ʖ ͡°) :wq[/size]
[url=http://murga-linux.com/puppy/viewtopic.php?p=1028256#1028256][size=75]Fatdog multi-session usb[/url][/size]
[size=75][url=https://hashbang.sh]echo url|sed -e 's/^/(c/' -e 's/$/ hashbang.sh)/'|sh[/url][/size]

User avatar
nosystemdthanks
Posts: 703
Joined: Thu 03 May 2018, 16:13
Contact:

#9 Post by nosystemdthanks »

rufwoof wrote:Dependencies hell. ldd to find what libs might also be removed, but then having to recurse scan to ensure they're not being used elsewhere by something that isn't being removed.
thats not so hard. except for where ldd lies. well, it tells you what it knows. so its not lying, but the apps do.
[color=green]The freedom to NOT run the software, to be free to avoid vendor lock-in through appropriate modularization/encapsulation and minimized dependencies; meaning any free software can be replaced with a user’s preferred alternatives.[/color]

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#10 Post by trapster »

Save this as /usr/local/bin/findlibs and make it executable.

Code: Select all

#!/bin/bash

ldd $1 | grep -q $2
exit $?

then use

Code: Select all

find /usr/bin -executable -type f -exec findlibs {} libX11 \; -print
This is on Debiandog Jessie

Code: Select all

root@debian:~# find /usr/bin -executable -type f -exec findlibs {} libX11 \; -print
/usr/bin/dillo
/usr/bin/xstdcmap
/usr/bin/galculator
/usr/bin/isomaster
/usr/bin/xcalc
/usr/bin/gkrellm
/usr/bin/gdmap
/usr/bin/xkbprint
/usr/bin/xedit
/usr/bin/hdspmixer
/usr/bin/xkbwatch
/usr/bin/xscanimage
/usr/bin/transmission-gtk
/usr/bin/jwm
/usr/bin/bmtoa
/usr/bin/oclock
/usr/bin/xlsfonts
/usr/bin/xman
/usr/bin/leafpad
/usr/bin/xkbbell
/usr/bin/appres
/usr/bin/transset
/usr/bin/xterm
/usr/bin/mplayer
/usr/bin/remmina
/usr/bin/xkbevd
/usr/bin/icewmbg
/usr/bin/openbox
/usr/bin/xfwrite
/usr/bin/xfe
/usr/bin/xeyes
/usr/bin/gdm-control
/usr/bin/ico
/usr/bin/pinentry-gtk-2
/usr/bin/roxterm-config
/usr/bin/mtpaint
/usr/bin/intel-virtual-output
/usr/bin/xcutsel
/usr/bin/pax11publish
/usr/bin/vmwarectrl
/usr/bin/icewmhint
/usr/bin/xrandr
/usr/bin/xfontsel
/usr/bin/xsane
/usr/bin/icehelp
/usr/bin/xsetpointer
/usr/bin/xfview
/usr/bin/parcellite
/usr/bin/pacmd
/usr/bin/xcmsdb
/usr/bin/xauth
/usr/bin/xvidtune
/usr/bin/roxterm
/usr/bin/xset
/usr/bin/gksu
/usr/bin/xcam
/usr/bin/pactl
/usr/bin/pasuspender
/usr/bin/viewres
/usr/bin/xinit
/usr/bin/xprop
/usr/bin/rmedigicontrol
/usr/bin/scrot
/usr/bin/gtkdialog3
/usr/bin/smtube
/usr/bin/pdftocairo
/usr/bin/guayadeque
/usr/bin/xvinfo
/usr/bin/xfimage
/usr/bin/xclipboard
/usr/bin/xditview
/usr/bin/xrefresh
/usr/bin/gftp-gtk
/usr/bin/pavucontrol
/usr/bin/gxine
/usr/bin/xcursorgen
/usr/bin/xsetmode
/usr/bin/xhost
/usr/bin/xmag
/usr/bin/Xdialog
/usr/bin/xkbcomp
/usr/bin/setxkbmap
/usr/bin/smplayer
/usr/bin/xmodmap
/usr/bin/xmessage
/usr/bin/icewmtray
/usr/bin/yad
/usr/bin/xfpack
/usr/bin/claws-mail
/usr/bin/xconsole
/usr/bin/xrdb
/usr/bin/envy24control
/usr/bin/syndaemon
/usr/bin/echomixer
/usr/bin/clementine
/usr/bin/rendercheck
/usr/bin/xxkb
/usr/bin/gbemol
/usr/bin/icesound
/usr/bin/pulseaudio
/usr/bin/xkbvleds
/usr/bin/rox
/usr/bin/gksu-properties
/usr/bin/xclock
/usr/bin/obxprop
/usr/bin/xmore
/usr/bin/gpicview
/usr/bin/xkill
/usr/bin/xgc
/usr/bin/xload
/usr/bin/hdajackretask
/usr/bin/xdpyinfo
/usr/bin/xwd
/usr/bin/xwud
/usr/bin/xgamma
/usr/bin/x11perf
/usr/bin/sakura
/usr/bin/bitmap
/usr/bin/xfd
/usr/bin/editres
/usr/bin/searchmonkey
/usr/bin/xlogo
/usr/bin/gtk-launch
/usr/bin/xdriinfo
/usr/bin/xarchiver
/usr/bin/epdfview
/usr/bin/dbus-launch
/usr/bin/xdm
/usr/bin/synclient
/usr/bin/volumeicon
/usr/bin/links2
/usr/bin/hdspconf
/usr/bin/xsetroot
/usr/bin/xev
/usr/bin/xinput
/usr/bin/pacat
/usr/bin/icesh
/usr/bin/xbiff
/usr/bin/broadwayd
/usr/bin/listres
/usr/bin/icewm
/usr/bin/gtkdialog
root@debian:~# 
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

User avatar
nosystemdthanks
Posts: 703
Joined: Thu 03 May 2018, 16:13
Contact:

#11 Post by nosystemdthanks »

trapster wrote:Save this as /usr/local/bin/findlibs and make it executable.

Code: Select all

#!/bin/bash

ldd $1 | grep -q $2
exit $?

Code: Select all

find /usr/bin -executable -type f -exec findlibs {} libX11 \; -print
elegant.
[color=green]The freedom to NOT run the software, to be free to avoid vendor lock-in through appropriate modularization/encapsulation and minimized dependencies; meaning any free software can be replaced with a user’s preferred alternatives.[/color]

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#12 Post by trapster »

Reverse LDD also works a treat
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#13 Post by sc0ttman »

Using trapsters nice little snippet (the findlibs script):

Code: Select all

libname="libX11.so.6.3.0"
PATHS="$(echo $PATH | sed "s/:/\n/g")"

echo "$PATHS" | while read path
do
  [ -d "$path" ] && find "$path" -executable -type f -exec findlibs {} "${libname//.*/}" \; -print | pkg w - | grep -v ^File | sort -u | uniq
done
.. uses the `pkg which` command to get the name of the package that the given file comes from .. prints the following (on Dpup Stretch RC3):

Code: Select all

abiword_3.0.2-2+deb9u2_i386
compton-0.1_stretch
dbus
dunst-1.1.0
easytag_2.4.3-1+deb9u1_i386
evince
evince-2.32.0-i686
feh_2.18-2_i386
ffmpeg
ffmpeg-3.2.9
ffmpegthumbnailer_2.1.1-0.1+b3_i386
flashplayer-32.0.0.101-i686
flsynclient-0.6-i486
fpm2-0.75-i686_stretch
freememapplet
galculator-2.1.5-i686-gtk2-stretch
gdmap_0.8.1-3+b1
geany_1.29-1
gexec-0.4
gftp-gtk_2.0.19-5
gifsicle
glade_3.20.0-2+deb9u1
gmeasures-0.7-i686_stretch
gmrun_0.9.2-2.2
gnome-alsamixer
gnome-mplayer-1.1w-i686_stretch
gnumeric
gnumeric-1.10.17
gphoto2_2.5.11-1
gpicview_0.2.5-2+b1
gtk+
gtkam_0.2.0-2+b2
gtk-chtheme_0.3.1-5+b3
gtklp
gtklp_1.3.1-0.1+b1
gxmessage-2.12.4-i686_stretch
hardinfo-0.6-alpha
hexchat_2.12.4-3
inkscapelite-0.36
isomaster_1.3.13-1+b1
joy2key_1.6.3-1_i386
joystick_1.6.0-1_i386.files
jstest-gtk_0.1.1~git20160825-2_i386
jwm_2.3.7-1
leafpad_0.8.18.1-5
librsvg
links2_2.14-2+b1_i386
lxde_apps
lxrandr_0.3.1-1
lxtask_0.1.8-1
lxterminal_0.3.0-2
mhwaveedit_1.4.23-1+b1
mlterm_3.5.0-1+b2_i386
mplayer_1.3.0-6
mpv_0.23.0-2+deb9u2
mtpaint-3.49.12-i686_s700
mtr_0.87-1
netmon_wce-3.3-i686_stretch
notecase-1.9.8
numlockx-1.2-i686_stretch
pcmanfm_1.2.5-3
pnmixer-0.7.2
poppler
powerapplet_tray-2.6.2
PupControl
redshift_1.11-1_i386
rofi_1.3.1-2_i386
sylpheed-3.5.1-i686_s700
transmission-gtk_2.92-2+deb9u1
uget
unclutter_8-20+b1
urxvt-9.22
vainfo_1.7.3-2
wmctrl_1.07-7+b1
wv
xarchive-0.2.8-6-i18n-i686_stretch
xboxdrv_0.8.8-1_i386
xclip_0.12+svn84-4+b1
xcur2png-0.7.0-i686_stretch
xdg_puppy
Xdialog-2015.08-i686_stretch
xdotool_3.20160805.1-3
xfdiff-cut
xinit_1.3.4-3+b1
xinput_1.6.2-1+b1
xlockmore
xorg_base_new
xorg_dri
xsane-0.999-i686_stretch
xsel_1.2.0-2+b1_i386
xserver_xorg
yad-0.40.0-i686-dpup-stretch
zarfy-0.1.0-i686-dpup-stretch
zz_w_apps
gadmin-rsync_0.1.7-1+b2
gparted
gtkdialog4-0.8.4
peasyscale
ssh_gui
gxmessage
rubix-1.03
scrox-0.8.17
freeciv-client-gtk_2.5.6-2_i386.files
gplanarity
mame_0.182-1_i386
mednafen_0.9.41+dfsg-2+b1_i386
xsoldier_1.8-4
Still not perfect... Cos sometimes Pkg reports the short version of the package name, sometime not... :/

But close enough.. Cleaning this list up and passing it to `pkg contents -` should list all the files in the packages :)

Thanks everyone.
Last edited by sc0ttman on Tue 29 Jan 2019, 16:22, edited 1 time in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#14 Post by sc0ttman »

The reason I'm doin this is I think it would be nice to have an Xdrive.sfs file,
containing only the stuff that needs X, and the X11 libs, that if not loaded,
leaves you with a working no-X pup..

But if the Xdrive.sfs is loaded at boot, you get the normal full X, desktop Puppy...

Or is that silly?
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

foxpup
Posts: 1132
Joined: Fri 29 Jul 2016, 21:08

#15 Post by foxpup »

sc0ttman wrote:The reason I'm doin this is I think it would be nice to have an Xdrive.sfs file,
containing only the stuff that needs X, and the X11 libs, that if not loaded,
leaves you with a working no-X pup..

But if the Xdrive.sfs is loaded at boot, you get the normal full X, desktop Puppy...

Or is that silly?
Not at all!
That is something I've been wondering about. Does it even (still) exist, a distro without X? And then on top, the choice to have a desktop anyway.
I love it!

User avatar
puppy_apprentice
Posts: 299
Joined: Tue 07 Feb 2012, 20:32

#16 Post by puppy_apprentice »

foxpup wrote:Does it even (still) exist, a distro without X?
Some distros have version called Core. It will be nice to have PuppyCore that will act only as eg. NAS, web server and etc. It could have even a web interface to launch some stuff or control firewall from other machine.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#17 Post by sc0ttman »

puppy_apprentice wrote:
foxpup wrote:Does it even (still) exist, a distro without X?
Some distros have version called Core. It will be nice to have PuppyCore that will act only as eg. NAS, web server and etc. It could have even a web interface to launch some stuff or control firewall from other machine.
One thing I keep meaning to do (off-topic for this thread) is to re-write some gtkdialog GUIs in plain dialog,
so that they also work without X.. It's quite easy to make programs that use dialog when no X, and
automatically switch to using Xdialog when X is running ... I did this with Pkgdialog (which is a frontend
to a CLI package manager).

I might start a thread about re-writing gtkdialog apps to separate CLI + dialog apps.. So they can be used without X.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

Post Reply