00:15.22 | Digit | is there a way to get "apt search" output only 1 line per result? or a way to get "apt-cache search" to show version numbers (still 1 line per result)? |
00:15.38 | Digit | i mean, without elaborate awking/sedditing/etc |
00:17.45 | gnarface | just pipe the output to less |
00:17.51 | gnarface | apt-cache search . |less |
00:18.32 | gnarface | then you can use the basic keyboard navigation at least |
00:18.51 | Digit | uhh, nope. doesnt do what i'm looking for at all. worsens. |
00:19.14 | gnarface | i know it doesn't do what you asked for, but it was the closest you're gonna get without learning anything |
00:19.41 | gnarface | fyi "apt-cache search" does support some regexp syntax though, more than just basic wildcards |
00:20.05 | Digit | e.g. search result would show "packagename packageversion" |
00:20.21 | gnarface | you want "apt-cache show [package name]" |
00:20.28 | gnarface | the version will be in the output |
00:21.05 | Digit | i'll probably just end up sedditing my way to 1 line output. |
00:21.20 | gnarface | combining search and show in the way you suggest, would as far as i know require "elaborate awking/sedditing/etc" |
00:21.44 | gnarface | maybe try aptitude? some people like it more |
00:22.14 | gnarface | it might include versions in the output, i'm not sure |
00:22.39 | Digit | yeah, gnarface that's again far from what i want. XD your suggestions are adding lines, not removing them. seems a simple requirement i would have thought would be more popularly sought. search output with just "packagename packageversion" |
00:22.57 | gnarface | oh you can search with the package version |
00:23.07 | gnarface | it just isn't shown in the output of search |
00:23.17 | Digit | needed for inclusion in scripts. idk aptitude well... it's all tui, no? |
00:23.22 | gnarface | but the search regexp itself does actually search against the whole output of all the package headers and such too |
00:23.42 | gnarface | so you can definitely search by package and version if you know the package header format and regexp |
00:24.29 | gnarface | for most packages, typically they don't store more than one version in the repos for an extended period of time though, so there's a limit to the usefulness of that |
00:29.21 | gnarface | "dpkg -l" will list versions of packages too, but only if they're already installed |
00:29.42 | Digit | nods |
00:30.54 | gnarface | hmmm. ack, i may be wrong that the Version tag is even searched by apt-cache search.... |
00:32.06 | Jjp137 | Digit, try: dpkg-query --show package |
00:32.27 | Jjp137 | you can use --showformat to control the output; refer to the man page, as always :) |
00:32.51 | gnarface | as for aptitude, i don't know if there's a way to call it non-interactively. i just assumed there would be but it would not be the default. |
00:34.18 | Digit | hrm. dpkg-query --show teeworlds (the package i'm testing on) gives: dpkg-query: no packages found matching teeworlds. that another case of only installed packages? |
00:34.55 | gnarface | i don't actually know for sure but i assume so |
00:35.01 | gnarface | dpkg is typically for direct package manipulation |
00:35.14 | gnarface | apt* is what adds repository support |
00:35.28 | Digit | coulda also been complications from the complexity of my system. |
00:35.49 | Jjp137 | oh nah I didn't consider that part, oops |
00:37.28 | gnarface | i'm guessing there will have to be two calls here, one to "apt-cache search" to get a list of package names, and another to "apt-cache show", "apt-cache showpkg", or "apt-cache showsrc" |
00:37.45 | gnarface | (to grep for versions) |
00:38.55 | gnarface | more fields than just the package name are searched by "apt-cache search" but "Version: " doesn't appear to be one of them. i'm having trouble isolating exactly which by testing |
00:40.44 | gnarface | maybe "Provides: " is searched |
00:40.51 | gnarface | in addition to package name and description |
00:41.18 | gnarface | at some point i must have caught a version number in there and thought "Version: " was included, sorry |
00:42.06 | gnarface | i'm not even sure Description is searched actually now with amprolla |
00:42.20 | gnarface | i recall someone complaining about that before and now i'm seeing it |
00:42.30 | Jjp137 | the short description (the one-liner) would be |
00:42.45 | Jjp137 | the long description...uh yea it disappears if the package came from Debian |
00:43.16 | Digit | elaborated: apt-cache show bc | cut -d" " -f2 | head -n 2 | paste -d " " - - |
00:43.18 | Digit | :D |
00:43.56 | Digit | tho, that still needs work for more elaborate multi result output. |
00:44.41 | gnarface | apt-cache show bc|grep ^Version |
00:44.42 | gnarface | ? |
00:45.24 | gnarface | (grep has similar regexp syntax to apt-cache search) |
00:45.27 | Digit | mm, yeah, i should grep wiser |
00:46.16 | gnarface | i think you can trust the field names to all be labeled like "Fieldname: " |
00:46.25 | gnarface | i don't know if you can trust them to always be in the same order |
00:46.40 | gnarface | or even to all be present every time |
00:47.24 | gnarface | but they should always start on their own line |
00:47.36 | gnarface | so you should be able to grep for "^Fieldname: " |
00:53.27 | *** join/#devuan xcm (~xcm@ipa210.225.tellas.gr) |
00:55.14 | Xenguy | Digit: Reading quickly, but this sounds like a grep exercise, and I'm still not clear on what your actual requirement is, besides '1 line', of 'something' |
00:56.04 | Xenguy | Oh, gnarface has it sorted, so ignore my comment |
00:56.46 | Digit | package search output of "packagename package version". yeah. well, had hoped i could skip the text manipulation exersize i'm going through. now i'm going through it, it doesnt hurt so much. n_n |
00:57.05 | *** join/#devuan Ryushin (chris@2001:470:4b:38f:777::8642) |
00:58.28 | Xenguy | apt-cache show grep |grep version |
00:58.41 | Xenguy | = ) |
00:59.30 | Digit | s/package version/packageversion/ meh, whatever. u get what i mean. like "bc 1.06.95-9+b3" or "teeworlds 0.6.5+dfsg-1~deb9u1", but want it (and am working on) getting it so it works for multiple results n partial package names in the search. |
00:59.46 | Xenguy | Should be: apt-cache show grep |grep -i version |
01:00.04 | Digit | Xenguy: that doesnt have the package name. we're past that. |
01:00.16 | Xenguy | picky picky |
01:00.20 | Digit | hehe |
01:00.29 | Xenguy | ; -) |
01:01.29 | Digit | apt-cache show bc | cut -d" " -f2 | head -n 2 | paste -d " " - - ...&... apt-cache show teeworlds | egrep '^Version|^Package' | paste -d " " - - | sed 's/Package: //g' | sed 's/Version: //g' ... are two early versions inadequate for multiple results. gonna make one from "apt search" output that should do the job. ... might take a break first. |
01:01.43 | Xenguy | weeeeeeee, pipe city! |
01:01.46 | Digit | n_n |
01:02.03 | Xenguy | Time to play some golf |
01:02.23 | Xenguy | But whatever works, right? |
01:06.04 | Digit | or from "apt-cache search -f" output |
01:06.17 | Jjp137 | do note that apt, as opposed to related commands like apt-get or apt-cache, is more of an end-user tool and can change behavior between versions (see the bottom of apt(8) for details) |
01:06.29 | Jjp137 | so I would just use apt-cache for this probably |
01:06.56 | Digit | yep yep yep. *nods* :) |
01:07.30 | Xenguy | Jjp137: I've been trying apt out here and there, and it seems to work quite nicely... |
01:07.47 | Jjp137 | yea for interactive use it's fine |
01:07.56 | Xenguy | I also read that it is more or less compatible/interchangeable with apt-get, so that is a bonus IMHO |
01:08.01 | Jjp137 | but for scripts, prefer apt-get, apt-cache, etc. |
01:08.05 | Xenguy | Jjp137: Yeah, they say don't script it |
01:08.09 | Xenguy | Exactly |
01:09.45 | Digit | ooh! my prior version, all i need to do to make it work is s/apt-cache show/apt-cache search -f/. :D pleasant. |
01:10.40 | Xenguy | Golf! |
01:10.42 | Xenguy | Well done |
01:12.10 | Digit | n_n thnx for putting up with me. thnx for the suggestions n help, all. :) |
01:12.23 | Xenguy | I'm tempted to engage the exercise myself, but, on 2nd thought, nah ; -) |
01:12.30 | Xenguy | Glad to have you here |
01:16.50 | Digit | well, in my script, apt-cache search -f "$argv" | egrep '^Version|^Package' | paste -d " " - - | sed 's/Package: //g' | sed 's/Version: //g' is not as simple&pretty as just apt-cache search "$argv", but it's nice to get consistent output with name and version, without bloating output to multi-line per package. :) nnnnnice. :) |
01:17.34 | Digit | (that $argv's fish, change to whatever that is for your bash, i forget... $1 or something?) |
01:18.18 | Xenguy | cheats: apt-cache show grep |grep Package && apt-cache show grep |grep Version |
01:20.02 | Digit | tries that with teeworlds package, and tries it with s/show/search -f/, sticks to what he has |
01:24.25 | Xenguy | $ apt-cache show teeworlds |grep Package && apt-cache show grep |grep Version |
01:24.26 | Xenguy | Package: teeworlds |
01:24.42 | Xenguy | ^^ Scratch that |
01:24.50 | Xenguy | $ apt-cache show teeworlds |grep Package && apt-cache show grep |grep Version |
01:24.50 | Xenguy | Package: teeworlds |
01:24.50 | Xenguy | Version: 2.27-2 |
01:25.20 | Xenguy | Then I'd just use a text editor macro to massage the output |
01:25.32 | Xenguy | But that's a quick and dirty approach |
01:25.55 | Xenguy | If you've got a better solution, then go for it of course |
01:31.02 | Digit | yeah, already pasted it in here a couple times. ;D |
01:34.22 | Xenguy | Well that's what I meant of course |
01:34.49 | Xenguy | "There's more than one way to skin a..." Er, n/m |
01:35.09 | Digit | more than one way to egrep ;D |
01:39.16 | Xenguy | As the Perl Mongers used to say (and perhaps still do): TMTOWTDI (There's More Than One Way To Do It!) |
01:39.50 | Xenguy | (And with Perl, that was most certainly true) |
01:45.19 | *** join/#devuan fleeky (~fleeky@75-101-60-65.dsl.static.fusionbroadband.com) |
01:51.03 | Xenguy | (tim-toady) |
02:09.48 | *** join/#devuan tallship (~tallship@2600:1010:b125:b543:ad8d:b03d:a5b5:f0c1) |
02:14.33 | *** join/#devuan gnarface (~gnarface@108-227-52-42.lightspeed.irvnca.sbcglobal.net) |
02:14.48 | *** join/#devuan fsmithred (~fsmithred@devuan/developer/fsmithred) |
02:14.51 | *** join/#devuan kassle (~kassle@london.serv.krybrig.org) |
02:17.41 | *** join/#devuan nighty (~nighty@b157153.ppp.asahi-net.or.jp) |
02:19.38 | *** join/#devuan tierce_ (~raoulzeca@ip-83-134-33-142.dsl.scarlet.be) |
02:20.55 | *** join/#devuan va7lnx (~donovan@69.172.174.181) |
02:21.16 | *** join/#devuan debdog (~debdog@2a00:79c0:621:6800:7a24:afff:fe8a:d04d) |
03:00.15 | *** join/#devuan va7lnx (~donovan@69.172.174.181) |
03:04.20 | *** join/#devuan va7lnx (~donovan@69.172.174.181) |
03:34.36 | *** join/#devuan rdav__ (~rd@245.184-26-211.sta.nsw.iprimus.net.au) |
04:15.36 | *** join/#devuan puria (~puria@static.112.14.99.88.clients.your-server.de) |
04:18.03 | *** join/#devuan Kizano (markizano@2600:3c00::f03c:91ff:fec8:382d) |
04:53.38 | *** join/#devuan LtWorf_ (~LtWorf@h-191-254.A890.priv.bahnhof.se) |
05:00.39 | *** join/#devuan LtWorf (~LtWorf@mail.cryptzone.com) |
05:04.10 | *** join/#devuan fsmithred (~fsmithred@devuan/developer/fsmithred) |
05:54.09 | *** join/#devuan puria (~puria@static.112.14.99.88.clients.your-server.de) |
06:15.44 | *** join/#devuan targz (~Thunderbi@unaffiliated/targz) |
06:28.54 | *** join/#devuan Pali (~pali@Maemo/community/contributor/Pali) |
06:32.13 | *** join/#devuan engidea (~damiano@ip-46-141-11-154.rev.wolnext.com) |
06:34.46 | *** join/#devuan Marko122 (2e87690d@gateway/web/cgi-irc/kiwiirc.com/ip.46.135.105.13) |
06:42.46 | *** join/#devuan LtWorf_ (~LtWorf@2001:9b1:4041:e000:a634:d9ff:fec6:343c) |
07:14.08 | *** join/#devuan puria (~puria@static.112.14.99.88.clients.your-server.de) |
07:16.16 | *** join/#devuan Madda (~Madda@net-31-27-55-17.cust.vodafonedsl.it) |
07:38.38 | *** join/#devuan Venker (~unknown@wbifi08.bifi.unizar.es) |
07:38.43 | Venker | hi people |
07:39.16 | *** join/#devuan rsx (~rsx@ppp-188-174-152-78.dynamic.mnet-online.de) |
07:39.44 | gnarface | yo |
07:45.48 | *** join/#devuan puria (~puria@static.112.14.99.88.clients.your-server.de) |
08:08.33 | *** join/#devuan poeinklum (~quassel@5.29.148.254) |
08:40.25 | *** join/#devuan puria (~puria@static.112.14.99.88.clients.your-server.de) |
09:07.36 | *** join/#devuan xcm (~xcm@ipa210.225.tellas.gr) |
09:09.08 | *** join/#devuan engidea (~damiano@ip-46-141-11-154.rev.wolnext.com) |
09:20.09 | *** join/#devuan sardonico (~ale@94.247.40.146) |
09:37.20 | *** join/#devuan xcm (~xcm@ipa210.225.tellas.gr) |
09:45.30 | *** join/#devuan puria (~puria@static.112.14.99.88.clients.your-server.de) |
09:50.34 | *** join/#devuan unixman_home_ (~unixman2@unaffiliated/eracc) |
09:53.00 | *** join/#devuan xcm (~xcm@ipa210.225.tellas.gr) |
10:14.29 | *** join/#devuan puria (~puria@static.112.14.99.88.clients.your-server.de) |
10:34.33 | *** join/#devuan proteusguy (~proteusgu@cm-58-10-155-156.revip7.asianet.co.th) |
10:36.12 | *** join/#devuan tierce_ (~raoulzeca@2a02:a03f:440a:2000:247d:38fd:58f1:c9f0) |
11:04.19 | *** join/#devuan rdav__ (~rd@61.181.148.122.sta.dodo.net.au) |
11:12.39 | *** join/#devuan tallship_ (~tallship@2600:1010:b10c:5b38:a56a:ee44:8c65:fcdd) |
11:15.32 | *** join/#devuan tallship_ (~tallship@2600:1010:b10c:5b38:a56a:ee44:8c65:fcdd) |
11:21.27 | *** join/#devuan cocoadaemon (~foo@x53.octopuce.fr) |
11:42.45 | *** join/#devuan fsmithred (~fsmithred@devuan/developer/fsmithred) |
12:08.24 | *** join/#devuan Centurion_Dan (~Thunderbi@devuan/developer/centuriondan) |
12:11.00 | *** join/#devuan fsmithred (~fsmithred@devuan/developer/fsmithred) |
12:19.17 | *** join/#devuan tradar (~tradar@gateway/tor-sasl/tradar) |
12:23.27 | *** join/#devuan Centurion_Dan (~Thunderbi@devuan/developer/centuriondan) |
12:23.31 | *** join/#devuan TigerbotHesh_ (~tbhesh@bishibosh.stronk.com.au) |
12:23.40 | *** join/#devuan rann_ (sid175221@gateway/web/irccloud.com/x-nfiqygeuazsyytdl) |
12:23.54 | *** join/#devuan timeless_ (sid4015@firefox/developer/timeless) |
12:24.55 | *** join/#devuan Kohlrabi_ (~kohlrabi@kohlio.de) |
12:25.30 | *** join/#devuan Syllin (~Syllin@li890-17.members.linode.com) |
12:25.36 | *** join/#devuan petris (~quassel@li-docker.host.petris.net) |
12:25.39 | *** join/#devuan erhandsome (~erhandsom@fsf/member/erhandsome) |
12:26.45 | *** join/#devuan thomascovenant (thomascove@2a01:7e00::f03c:91ff:fe2b:2634) |
12:26.45 | *** join/#devuan thomascovenant (thomascove@fsfe/thomascovenant) |
12:27.01 | *** join/#devuan zeden (~user@unaffiliated/zeden) |
12:27.01 | *** join/#devuan ffernand (ffernand@devworker.com) |
12:27.12 | *** join/#devuan trfl (~ed@static.59.110.40.188.clients.your-server.de) |
12:27.14 | *** join/#devuan jxyzn (quassel@2600:3c01::f03c:91ff:fe73:445a) |
12:27.27 | *** join/#devuan Xenguy (~Xenguy@devuan/community/Xenguy) |
12:27.41 | *** join/#devuan unixman_home (~unixman2@87-225-137-216.mtaonline.net) |
12:27.41 | *** join/#devuan unixman_home (~unixman2@unaffiliated/eracc) |
12:28.02 | *** join/#devuan jobregon[m] (jobregonma@gateway/shell/matrix.org/x-eqgfqoffirosxyxc) |
12:28.49 | *** join/#devuan sirix (Elite16648@gateway/shell/elitebnc/x-tucdtgpwstxlithn) |
12:38.08 | *** join/#devuan Pali (~pali@Maemo/community/contributor/Pali) |
12:38.57 | *** join/#devuan g4570n (~g4570n@unaffiliated/g4570n) |
12:52.26 | *** join/#devuan Oldmoss (~oldmoss@46.19.140.18) |
13:01.30 | *** join/#devuan puria (~puria@static.112.14.99.88.clients.your-server.de) |
13:13.03 | *** join/#devuan amarsh04 (~amarsh04@124-171-187-9.dyn.iinet.net.au) |
13:24.56 | *** join/#devuan zeden (~user@unaffiliated/zeden) |
13:34.05 | *** join/#devuan EHeM (~ehem@mailhost.m5p.com) |
13:45.42 | *** join/#devuan engidea (~damiano@ip-46-141-11-154.rev.wolnext.com) |
13:46.20 | *** join/#devuan tallship (~tallship@77.sub-174-222-4.myvzw.com) |
14:22.41 | Hund | Hey |
14:22.42 | *** join/#devuan tallship (~tallship@2600:1010:b10c:5b38:a56a:ee44:8c65:fcdd) |
14:26.11 | *** join/#devuan freemangordon (~ivo@46.249.74.23) |
14:33.20 | *** join/#devuan engidea (~damiano@ip-46-141-11-154.rev.wolnext.com) |
14:57.05 | *** join/#devuan jelly-home (jelly@pdpc/supporter/active/jelly) |
15:11.31 | *** join/#devuan engidea (~damiano@ip-46-141-11-154.rev.wolnext.com) |
15:13.34 | *** join/#devuan jelly (jelly@pdpc/supporter/active/jelly) |
15:22.47 | *** join/#devuan knidos (~knidos@85.97.169.201) |
15:46.48 | *** join/#devuan Uberius (~Uberius@gateway/tor-sasl/uberius) |
15:47.46 | *** join/#devuan demo (~demo@104.221.71.112) |
15:55.35 | *** join/#devuan jathan (~jathan@200.76.195.248) |
15:57.52 | *** join/#devuan Mithrandir__ (~Mithrandi@212.117.188.4) |
16:00.15 | *** join/#devuan demo (~demo@104.221.71.112) |
16:39.07 | *** join/#devuan fsmithred (~fsmithred@devuan/developer/fsmithred) |
16:53.07 | *** join/#devuan Acacia (~Acacia@unaffiliated/acacia) |
17:02.43 | *** join/#devuan obeardly (~obeardly@2603:3011:1661:0:9657:a5ff:feae:1552) |
17:06.51 | *** join/#devuan Ltem (~ltem@h081217191110.dyn.cm.kabsi.at) |
17:13.34 | *** join/#devuan va7lnx (~donovan@69.172.174.181) |
17:43.29 | *** join/#devuan tallship (~tallship@2600:1010:b10c:5b38:a56a:ee44:8c65:fcdd) |
17:54.47 | *** join/#devuan Mithrandir__ (~Mithrandi@212.117.188.4) |
18:17.42 | *** join/#devuan kelsoo1 (~kelsoo@dragora/developer/kelsoo) |
18:44.53 | *** join/#devuan zeden (~user@unaffiliated/zeden) |
19:08.03 | *** join/#devuan shibboleth (~shibbolet@gateway/tor-sasl/shibboleth) |
19:14.34 | *** join/#devuan markizano (markizano@2600:3c00::f03c:91ff:fec8:382d) |
19:16.13 | *** join/#devuan cd (~none@gateway/tor-sasl/cd) |
19:20.52 | *** join/#devuan Besnik_b (~Besnik@athedsl-99508.home.otenet.gr) |
19:36.29 | *** join/#devuan engidea (~damiano@ip-46-141-11-154.rev.wolnext.com) |
20:19.19 | *** join/#devuan sicelo (~sicelo@Maemo/community/ex-council/sicelo) |
20:39.30 | *** join/#devuan va7lnx (~donovan@69.172.174.181) |
20:44.53 | *** join/#devuan plasma41 (~plasma41@72.34.178.54) |
20:46.13 | *** join/#devuan Ltem (~ltem@h081217191110.dyn.cm.kabsi.at) |
20:53.22 | *** join/#devuan jathan (~jathan@200.76.195.248) |
21:00.44 | *** join/#devuan fsmithred (~fsmithred@devuan/developer/fsmithred) |
21:45.34 | *** join/#devuan obovo (~obovo@50.38.43.128) |
21:48.41 | *** join/#devuan obovo (~obovo@50.38.43.128) |
21:50.08 | *** join/#devuan kimotori (~kimotori@148.251.3.246) |
22:05.17 | *** join/#devuan va7lnx (~donovan@69.172.174.181) |
22:05.39 | *** join/#devuan obovo (~obovo@50.38.43.128) |
22:40.29 | *** join/#devuan targz (~Thunderbi@unaffiliated/targz) |
22:46.00 | *** join/#devuan bpmedley (~bpm@2600:1700:eb20:6050:1ddd:1994:8a2a:64ba) |
23:30.57 | *** join/#devuan xcm (~xcm@ipa210.225.tellas.gr) |
23:52.23 | *** join/#devuan rdav__ (~rd@245.184-26-211.sta.nsw.iprimus.net.au) |