Having to parse the text seems like a less-than-ideal solution if that's what you suggest, please argue why there isn't a better way. ![]() Bonus points if it can be a proper regexp rather than just a shell glob.So, bottom line: What's the right way to get the list of installed packages matching a pattern? I could use dpkg-query -list "linux-image-*" | grep "ii"īut then I'd need to do a bunch of text processing, and who can trust those spaces, right? You can install recent stable versions of Redis from the official packages. I can run dpkg-query like so: dpkg-query -showformat='$\n' -show "linux-image*"īut that's not limited to installed packages. Most major Linux distributions provide packages for Redis. I can do that by, running, say, apt list -installed "linux-image-*" | cut -d/ -f1īut I get lines I don't care for, e.g.: WARNING: apt does not have a stable CLI interface. Use the apt-cache when you need to search packages on your Debian or Ubuntu or apt-get based Linux distros apt-cache search 'search-term' apt-cache search 'database' apt-cache search. I'd like to generate a plain list of all installed packages matching a certain pattern. I'm on system running a (fairly recent-)Debian-based distribution.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |