Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-07-2014, 11:01 AM
|
#1
|
Member
Registered: Jul 2014
Posts: 70
Rep:
|
List of installed packages
Hello!
I want to get a list of installed packages on my system but only with the name of the package not its the version.
Anybody knows how?
Last edited by JKostaRibeiro; 07-07-2014 at 11:09 AM.
|
|
|
07-07-2014, 11:09 AM
|
#2
|
Senior Member
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Rep:
|
cd /var/log/packages; ls | rev | cut -f4- -d- | rev
(by the way, welcome to LQ, or as we say in Yorkshire, bienvenue à LQ )
Last edited by 55020; 07-07-2014 at 11:11 AM.
|
|
6 members found this post helpful.
|
07-07-2014, 11:11 AM
|
#3
|
Member
Registered: Jul 2014
Posts: 70
Original Poster
Rep:
|
Excellent, 55020!
Thank you! )
|
|
|
07-07-2014, 11:48 AM
|
#4
|
Member
Registered: Sep 2003
Location: The Netherlands
Distribution: Slackware
Posts: 124
Rep:
|
cd /var/log/packages
ls | sed 's/-[^-]*-[^-]*-[^-]*$//'
|
|
1 members found this post helpful.
|
07-07-2014, 12:51 PM
|
#5
|
Member
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138
Rep:
|
Try install QTGZManager, can be found at slackbuilds.org, it has snapshots option that creates files lists of installed packages, then: sed -i 's/-[^-]*-[^-]*-[^-]*$//' <your_file_name>
Last edited by neymac; 07-07-2014 at 02:08 PM.
|
|
|
07-07-2014, 01:34 PM
|
#6
|
LQ Newbie
Registered: Aug 2013
Location: US
Distribution: Slackware 14.1
Posts: 28
Rep:
|
Quote:
Originally Posted by Speek
cd /var/log/packages
ls | sed 's/-[^-]*-[^-]*-[^-]*$//'
|
Works great for a versionless listing of Slackbuilds too:
# sbopkg -p | sed 's/-[^-]*-[^-]*-[^-]*$//'
Edit and caveat:
The first command with sbopkg only lists SBo's, packages from alienbob and elsewhere won't show. Using sed with find
on a directory of the saved packages should do nicely.
$ find YOUR_SLACKBUILDS/ -iname "*.t?z" -exec basename {} \; | sed 's/-[^-]*-[^-]*-[^-]*$//'
Last edited by mister_b; 07-07-2014 at 10:56 PM.
|
|
|
07-07-2014, 01:56 PM
|
#7
|
Member
Registered: Jul 2014
Posts: 70
Original Poster
Rep:
|
Speek, neymac and mister_b
Thank you!
|
|
|
07-11-2014, 02:54 AM
|
#8
|
Senior Member
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,158
|
I would also point out vbatts's slack-utils:
https://github.com/vbatts/slack-utils
The "slp" command will list you all the packages (and there are many other handy tools). Of course, you need to do some "sed" or "cut" trickery as suggested above to get the base names only.
|
|
|
07-11-2014, 03:10 AM
|
#9
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557
|
Quote:
Originally Posted by 55020
Code:
cd /var/log/packages; ls | rev | cut -f4- -d- | rev
|
Quote:
Originally Posted by Speek
Code:
cd /var/log/packages
ls | sed 's/-[^-]*-[^-]*-[^-]*$//'
|
No need for the 'cd', you could make those simply:
Code:
ls /var/log/packages | rev | cut -f4- -d- | rev
Code:
ls /var/log/packages | sed 's/-[^-]*-[^-]*-[^-]*$//'
Here are some more sed alternatives (which may or may not be more readable depending on your background):
Code:
ls /var/log/packages | sed 's/\(-[^-]\+\)\{3\}$//'
Code:
ls /var/log/packages | sed -r 's/(-[^-]+){3}$//'
Code:
ls /var/log/packages | sed -r 's/(-[[:alnum:]\.\+_]+){3}$//'
Last edited by ruario; 07-11-2014 at 04:26 AM.
Reason: more examples
|
|
2 members found this post helpful.
|
07-23-2014, 07:59 AM
|
#10
|
Member
Registered: Jul 2014
Posts: 70
Original Poster
Rep:
|
Ilgar and ruario,
Thank you.
|
|
|
All times are GMT -5. The time now is 06:00 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|