Hopefully this gets improved properly, but in the meantime here's an
alias that offers better convenience than 'apt search' for package name
search:
alias apts="apt list 2> /dev/null | sed 's/\// \//' | grep "
And a bulky, quick and dirty bash function for full description search:
aptse() { # temporary 'apt search' improvement
tput rmam; # no-wrap
apt search $1 2>/dev/null | # skip the interface warning
tail -n+3 | # skip unimportant sorting info
grep -v '^$' | # delete empty lines
sed 'N;s/\n//' | # append every second line
sed 's/\// \//' | # replace first '/' with space
awk '{$2="";$4="";print}' | # remove useless info
sed -r 's/(\[.*)installed(.*\])/\1i\2/' | # shorten
sed -r 's/(\[.*)automatic(.*\])/\1a\2/' | # shorten
sed -r 's/(\[.*),(.*\])/\1\2/' | # prettier shortened '[]'
egrep --color "$1|" # highlighting
tput smam; # wrap again
}
Since the search expression is always a pattern with grep, neither
suffers from the 'apt list' behaviour described in my previous comment
(https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1639815/comments/1).
--
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/1639815
Title:
apt list output format
Status in apt package in Ubuntu:
New
Bug description:
I'm trying to get used to the new 'apt' utility and have three
wishlist items (don't want to clutter the tracker with multiple
feature requests) in descending priority:
1. apt list firefox
In the output, can we please have a space after the package name, before the
slash?
A very convenient feature of apt-cache/aptitude is to search for a package,
then double click + middle click the name of a result to speedily select it and
paste it into the current prompt (which is prepared with e.g. an install, show
or depends command).
'apt list' appends '/repo,XXX' (where XXX is most often garbage... ehm, I
mean strings like 'now' or again 'other_repo,now') right after the package
name, which makes the double click select more than just a package name.
E.g. 'apt policy firefox/yakkety-updates' fails.
This would also be more convenient for awk scripts (despite the stable
interface warning).
2. apt list fox
Can we please have substring matching by default (or a storable user pref)
for 'apt list'?
'apt search' is _way_ too noisy (the three line output per package instead of
one line is just clutter).
But 'apt list' doesn't match like 'apt-cache search' (or aptitude). The
alternative is defaulting to 'apt l<tab> **' and then filling in between the
asterisks, or resorting to 'apt l<tab>|grep' as standard 'apt-cache search'
replacement.
I don't see the justification for the current exact searching in only the
package names. And there's still 'apt search' for searching the description.
3. apt sh<tab>
A minor complaint: all current apt commands complete once they are tabbed
when their string becomes unique, and append a space. Only 'apt show' in 16.10
(as opposed to 16.04) does not due to the undocumented showsrc command. This
often leads to 'apt showfirefox' after writing 'apt sh<tab>firefox', because
it's inconsistent with the other commands.
So, find another name for showsrc?
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1639815/+subscriptions
--
Mailing list: https://launchpad.net/~touch-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~touch-packages
More help : https://help.launchpad.net/ListHelp