LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-07-2014, 11:01 AM   #1
JKostaRibeiro
Member
 
Registered: Jul 2014
Posts: 70

Rep: Reputation: 2
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.
 
Old 07-07-2014, 11:09 AM   #2
55020
Senior Member
 
Registered: Sep 2009
Location: Yorks. W.R. 167397
Distribution: Slackware
Posts: 1,307
Blog Entries: 4

Rep: Reputation: Disabled
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.
Old 07-07-2014, 11:11 AM   #3
JKostaRibeiro
Member
 
Registered: Jul 2014
Posts: 70

Original Poster
Rep: Reputation: 2
Excellent, 55020!

Thank you! )
 
Old 07-07-2014, 11:48 AM   #4
Speek
Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Slackware
Posts: 124

Rep: Reputation: 41
cd /var/log/packages
ls | sed 's/-[^-]*-[^-]*-[^-]*$//'
 
1 members found this post helpful.
Old 07-07-2014, 12:51 PM   #5
neymac
Member
 
Registered: May 2009
Distribution: Slackware64-14.1
Posts: 138

Rep: Reputation: 19
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.
 
Old 07-07-2014, 01:34 PM   #6
mister_b
LQ Newbie
 
Registered: Aug 2013
Location: US
Distribution: Slackware 14.1
Posts: 28

Rep: Reputation: Disabled
Quote:
Originally Posted by Speek View Post
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.
 
Old 07-07-2014, 01:56 PM   #7
JKostaRibeiro
Member
 
Registered: Jul 2014
Posts: 70

Original Poster
Rep: Reputation: 2
Speek, neymac and mister_b

Thank you!
 
Old 07-11-2014, 02:54 AM   #8
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,158

Rep: Reputation: 237Reputation: 237Reputation: 237
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.
 
Old 07-11-2014, 03:10 AM   #9
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763Reputation: 1763
Quote:
Originally Posted by 55020 View Post
Code:
cd /var/log/packages; ls | rev | cut -f4- -d- | rev
Quote:
Originally Posted by Speek View Post
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.
Old 07-23-2014, 07:59 AM   #10
JKostaRibeiro
Member
 
Registered: Jul 2014
Posts: 70

Original Poster
Rep: Reputation: 2
Ilgar and ruario,

Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to save a list of installed packages and install these packages later mandavi Ubuntu 5 09-07-2009 12:36 PM
how to list packages installed? scuzzo84 Debian 8 01-17-2006 06:17 PM
How to list all installed packages? bp12345 Debian 2 08-15-2005 09:06 AM
list of installed packages jeff1500 Slackware 3 03-22-2004 05:52 PM
List all installed Packages? mikeshn Linux - General 1 12-02-2003 11:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration