LinuxQuestions.org
Help answer threads with 0 replies.
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, 10:01 AM   #1
JKostaRibeiro
Member
 
Registered: Jul 2014
Distribution: Slackware
Posts: 33

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

Rep: Reputation: 563Reputation: 563Reputation: 563Reputation: 563Reputation: 563Reputation: 563
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 10:11 AM.
 
6 members found this post helpful.
Old 07-07-2014, 10:11 AM   #3
JKostaRibeiro
Member
 
Registered: Jul 2014
Distribution: Slackware
Posts: 33

Original Poster
Rep: Reputation: 1
Excellent, 55020!

Thank you! )
 
Old 07-07-2014, 10:48 AM   #4
Speek
Member
 
Registered: Sep 2003
Distribution: Slackware
Posts: 113

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

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

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 09:56 PM.
 
Old 07-07-2014, 12:56 PM   #7
JKostaRibeiro
Member
 
Registered: Jul 2014
Distribution: Slackware
Posts: 33

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

Thank you!
 
Old 07-11-2014, 01:54 AM   #8
Ilgar
Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware 14.1, Slackware64 14.1
Posts: 936

Rep: Reputation: 98
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, 02:10 AM   #9
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,033

Rep: Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054Reputation: 1054
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 03:26 AM. Reason: more examples
 
2 members found this post helpful.
Old 07-23-2014, 06:59 AM   #10
JKostaRibeiro
Member
 
Registered: Jul 2014
Distribution: Slackware
Posts: 33

Original Poster
Rep: Reputation: 1
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 11:36 AM
how to list packages installed? scuzzo84 Debian 8 01-17-2006 05:17 PM
How to list all installed packages? bp12345 Debian 2 08-15-2005 08:06 AM
list of installed packages jeff1500 Slackware 3 03-22-2004 04:52 PM
List all installed Packages? mikeshn Linux - General 1 12-02-2003 10:31 PM


All times are GMT -5. The time now is 09:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration