List all installed packages?

Hi, I would like to see a lift of all packages that I have installed. I’d prefer to not include updates in the list, and I’d like to arrange them by date in descending order. Just in case I installed something I forgot about and no longer need.

This will show all installed packages with the latest ones at the top:

rpm -qa --last

For other options (f.e. how to manipulate the list output), see “man rpm”.

If you want the opposite order, you could pipe it through “tac” f.e.:

rpm -qa --last | tac

On 02/25/2014 07:26 AM, wolfi323 pecked at the keyboard and wrote:
> Astralogic;2627073 Wrote:
>> Hi, I would like to see a lift of all packages that I have installed.
>> I’d prefer to not include updates in the list, and I’d like to arrange
>> them by date in descending order. Just in case I installed something I
>> forgot about and no longer need.
> This will show all installed packages with the latest ones at the top:
>
> Code:
> --------------------
> rpm -qa --last
> --------------------
>
>
> For other options (f.e. how to manipulate the list output), see “man
> rpm”.
>
> If you want the opposite order, you could pipe it through “rev” f.e.:
>
> Code:
> --------------------
> rpm -qa --last | rev
> --------------------
>
>

Not sure who supplied this script but this is what I use:



rpm -q -a --queryformat "%{INSTALLTIME}	%{INSTALLTIME:day} \
%{BUILDTIME:day} %-30{NAME}	%15{VERSION}-%-7{RELEASE}	%{arch} \
%25{VENDOR}%25{PACKAGER} == %{DISTRIBUTION} %{DISTTAG}
" \
| sort | cut --fields="2-" | tee rpmlist | less -S


Ken

On 2014-02-25 15:09, Ken Schneider wrote:

> Not sure who supplied this script but this is what I use:
>
>


>
> rpm -q -a --queryformat "%{INSTALLTIME}	%{INSTALLTIME:day} \
>    %{BUILDTIME:day} %-30{NAME}	%15{VERSION}-%-7{RELEASE}	%{arch} \
>    %25{VENDOR}%25{PACKAGER} == %{DISTRIBUTION} %{DISTTAG}
" \
>   | sort | cut --fields="2-" | tee rpmlist | less -S
>
> 

Heh, that concoction is mine :slight_smile:

This other variant generates a CSV file that can then be imported on any
calc sheet, where you can then do filtering and sorting:


rpm -q -a --queryformat "%{INSTALLTIME};%{INSTALLTIME:day}; \
%{BUILDTIME:day}; %{NAME};%{VERSION}-%-7{RELEASE};%{arch}; \
%{VENDOR};%{PACKAGER};%{DISTRIBUTION};%{DISTTAG}
" \
| sort | cut --fields="2-" --delimiter=\; \
| tee rpmlist.csv | less -S


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

I usually pipe it through less:

rpm -qa -last|less

BTW, what would be the zypper equivalent?

Maybe this:

zypper se --installed-only

Or add “-s” as well to get more details like the version.
But I don’t know how you can let zypper sort the list by installation time (I don’t think that’s possible).

For all search options, see “zypper help se”.

On 02/25/2014 03:44 PM, Carlos E. R. pecked at the keyboard and wrote:
> On 2014-02-25 15:09, Ken Schneider wrote:
>
>> Not sure who supplied this script but this is what I use:
>>
>>


>>
>> rpm -q -a --queryformat "%{INSTALLTIME}	%{INSTALLTIME:day} \
>>     %{BUILDTIME:day} %-30{NAME}	%15{VERSION}-%-7{RELEASE}	%{arch} \
>>     %25{VENDOR}%25{PACKAGER} == %{DISTRIBUTION} %{DISTTAG}
" \
>>    | sort | cut --fields="2-" | tee rpmlist | less -S
>>
>> 

> Heh, that concoction is mine :slight_smile:

I thought so but can’t trust my memory much lately.
Thanks Carlos

Ken

On 02/25/2014 06:16 PM, wolfi323 pecked at the keyboard and wrote:
> F_Sauce;2627182 Wrote:
>> BTW, what would be the zypper equivalent?
> Maybe this:
>
> Code:
> --------------------
> zypper se --installed-only
> --------------------
>
> Or add “-s” as well to get more details like the version.
> But I don’t know how you can let zypper sort the list by installation
> time.
>
> For all search options, see “zypper help se”.
>
>



less /var/log/zypp/history


Shows install/remove history since (fresh) system install.

Ken

Is there a way to only show programs that I have manually installed? Can I omit updates and things that came with Suse? Yeah it’s gonna be a pretty small list, but I don’t want to forget about packages that I installed but no longer need.

You mean you want to see a list of packages where you downloaded an RPM and installed it manually?

You can do this in YaST->Software Management, click on “View” and select “Repositories”, select the “@System” repo (should be selected by default), and set the Secondary Filter to “Unmaintained Packages”. Then only installed packages that are not in any repo are shown.

Or this zypper line should give the same result:

zypper pa -o

(pa=“List all packages available in specified repositories”, -o=–orphaned=“Show packages which are orphaned (without repository).”)
You could also specify the “-n” option instead of (or in addition to) “-o”, that would “Show packages which are unneeded.”, where unneeded means they are not required by any other packages.

For all the “pa” options, see “zypper help pa”… :wink:

So, I’m trying to list all the packages on my system that were explicitly installed and are not required by other packages as dependencies.

I just tried “zypper pa -in” but it only produced


Loading repository data...
Reading installed packages...
S | Repository         | Name             | Version      | Arch
--+--------------------+------------------+--------------+-----
i | openSUSE-13.1-Oss  | clamz            | 0.5-8.1.3    | i586
i | openSUSE-13.1-1.10 | clamz            | 0.5-8.1.3    | i586
i | openSUSE-13.1-Oss  | kexec-tools      | 2.0.3-5.1.3  | i586
i | openSUSE-13.1-1.10 | kexec-tools      | 2.0.3-5.1.3  | i586
i | openSUSE-13.1-Oss  | liblastfm1       | 1.0.7-2.1.2  | i586
i | openSUSE-13.1-1.10 | liblastfm1       | 1.0.7-2.1.2  | i586
i | openSUSE-13.1-Oss  | libloudmouth-1-0 | 1.4.3-21.1.3 | i586
i | openSUSE-13.1-1.10 | libloudmouth-1-0 | 1.4.3-21.1.3 | i586
i | openSUSE-13.1-Oss  | libmygpo-qt1     | 1.0.7-2.1.2  | i586
i | openSUSE-13.1-1.10 | libmygpo-qt1     | 1.0.7-2.1.2  | i586
i | openSUSE-13.1-Oss  | libmysqld18      | 5.5.33-2.2   | i586
i | openSUSE-13.1-1.10 | libmysqld18      | 5.5.33-2.2   | i586
i | openSUSE-13.1-Oss  | libtag-extras1   | 1.0.1-19.1.1 | i586
i | openSUSE-13.1-1.10 | libtag-extras1   | 1.0.1-19.1.1 | i586
i | openSUSE-13.1-Oss  | moodbar          | 0.1.2-17.1.3 | i586
i | openSUSE-13.1-1.10 | moodbar          | 0.1.2-17.1.3 | i586
i | openSUSE-13.1-Oss  | qt4-qtscript     | 0.2.0-8.1.3  | i586
i | openSUSE-13.1-1.10 | qt4-qtscript     | 0.2.0-8.1.3  | i586
i | openSUSE-13.1-Oss  | taglib           | 1.8-11.1.4   | i586
i | openSUSE-13.1-1.10 | taglib           | 1.8-11.1.4   | i586

Surely this is wrong, right? I’m curious why everything is listed twice and why other packages are not being displayed at all (such as all the kde packages for example). When I perform the equivalent command on my Arch Linux machine (pacman -Qet) it displays 153 packages despite the fact that I have far less packages installed than my openSUSE installation.

EDIT:
I have found that I can do “zypper se -i” to list every installed package (brings up 1616 packages) but there doesn’t seem to be a way to filter out packages that are required as dependencies for other packages.

I would guess that you have your install medium active as a repo, hence the duplications (two repoes providing the same package).

zypper lr

The zypper pa -in command will only output installed (-i) and, from those, sort out the ‘unneeded’ packages (-n), (pa = available packages).

You might be better off if you explore the YaST Software Manager, as already suggested, you may sort and filter in many different ways; and you can open the zypper log from there giving you a date reference as well. This is how I prefer to do it in any case, in addition to the rpm command:

rpm -qa -last | less

Ah yes, that does appear to be the case. Thanks for the heads up on that.

That’s what I gathered from reading zypper help pa. Perhaps I don’t understand what “unneeded” means. I assumed that meant not needed as a dependency for another application. Is there no way to search for that from zypper? Even if it’s some really long string of commands piped to each other I don’t really care because I can just make an alias for it.

I’ll look into YaST, but I really would prefer to get the hang of doing this from the CLI. I’ve found that it tends to be easier and faster when you get used to it. At least, that was the case for me on Debian and Arch. Also, using it from the CLI allows me to pipe information to other applications or to files which has proven to be useful for me on occasion.

Yes that’s what I was looking for, but I also wanted to include in the list packages that I had manually installed in YasT, not just RPM’s I downloaded and installed.

Also, using the “zypper pa -n” command, does that mean I can remove the unneeded packages?

calvin@linux-kmee:~> zypper pa -n
Loading repository data...
Reading installed packages...
S | Repository           | Name             | Version       | Arch  
--+----------------------+------------------+---------------+-------
i | openSUSE-13.1-Oss    | kexec-tools      | 2.0.3-5.1.3   | x86_64
i | openSUSE-13.1-1.10   | kexec-tools      | 2.0.3-5.1.3   | x86_64
v | openSUSE-13.1-Oss    | kexec-tools      | 2.0.3-5.1.3   | i586  
i | home:petracvv        | ttmkfdir         | 3.0.9-32.1    | x86_64
v | home:petracvv        | ttmkfdir         | 3.0.9-32.1    | i586  
i | openSUSE-13.1-Oss    | wine             | 1.7.2-2.1     | x86_64
i | openSUSE-13.1-1.10   | wine             | 1.7.2-2.1     | x86_64
v | openSUSE-13.1-Oss    | wine             | 1.7.2-2.1     | i586  
i | openSUSE-13.1-Update | xf86-video-intel | 2.99.906-12.1 | x86_64
v | openSUSE-13.1-Update | xf86-video-intel | 2.99.906-8.1  | x86_64
v | openSUSE-13.1-Update | xf86-video-intel | 2.99.906-4.1  | x86_64
v | openSUSE-13.1-Oss    | xf86-video-intel | 2.99.905-1.1  | x86_64
v | openSUSE-13.1-1.10   | xf86-video-intel | 2.99.905-1.1  | x86_64
v | openSUSE-13.1-Update | xf86-video-intel | 2.99.906-12.1 | i586  
v | openSUSE-13.1-Update | xf86-video-intel | 2.99.906-8.1  | i586  
v | openSUSE-13.1-Update | xf86-video-intel | 2.99.906-4.1  | i586  
v | openSUSE-13.1-Oss    | xf86-video-intel | 2.99.905-1.1  | i586

To find out what you installed with YaST, there’s only the history.
Either look into the file(s) /var/log/zypp/zypp.history* (as already mentioned) or in YaST’s menu (Extras->Show History).

Also, using the “zypper pa -n” command, does that mean I can remove the unneeded packages?

Well, “unneeded” just means that no other package requires it.

zypper cannot know of course if you need it or not.
I.e. if you want to use wine f.e. you should NOT uninstall it of course. :wink:

I don’t know exactly what criterias libzypp uses to decide which packages are “unneeded” though.
But it looks like it also takes Suggests and Recommends into account and doesn’t consider recommended/suggested packages as “unneeded”.
F.e. on my system it lists most of the xf86-video-* packages as unneeded except xf86-video-ati (I use the radeon driver that’s contained in that package). This could be explained by the fact that the xf86-video-ati supplements my hardware via package dependencies. (the spec file contains “Supplements: modalias(xorg-x11-server:pci:v00001002dsvsdbc03sci*)” which means it is recommended to be installed on systems that contain hardware that matches that pci-vendor string and have xorg-x11-server installed, but it’s not exactly required since I could use modesetting, fbdev or vesa as well)

So I was right. It does not appear to me that this is really the case based on the output I posted above though.

I don’t know exactly what criterias libzypp uses to decide which packages are “unneeded” though.
But it looks like it also takes Suggests and Recommends into account and doesn’t consider recommended/suggested packages as “unneeded”.

Well that’s really unfortunate. Is there any way at all for me to list only explicitly installed packages (meaning it wasn’t installed as a dependency. It was installed explicitly through the package manager by the user) which are not required by other applications (for clarification, it’s important to note that an explicitly installed application can still be required by another application that the user installed later)? I’m not concerned with recommends/suggests. Is this really a limitation of zypper? I can’t even figure out a way to do this with Yast (although even if there is a way with Yast, I still would greatly prefer a CLI method since Yast is very slow to start up for me and just all around kind of bulky and gets in my way. Also I’d like to be able to handle all my package management over SSH if I need to).

I’m also struggling to do other basic tasks with Zypper that I perform regularly with Pacman, but those things aren’t as important to me as this. I’ve read the man page repeatedly and scoured through various pages found through Google…

As I said, the only way I could think of is look at the history.

But IIUYC, you could have a look at “rpmorphan” (included in the standard repo). That might just do what you want.
http://rpmorphan.sourceforge.net/

Finds “orphaned” packages on your system. It determines which packageshave no other packages depending on their installation, and shows you
a list of these packages. It intends to be clone of deborphan debian
tools for RPM packages.

This can even take into account when a package was last used, i.e. when a file from that package was accessed (f.e. a program started) the last time.

I’ll take a look at that, but I’m really not looking for orphans. Explicitly installed packages should not ever be treated as orphans since the user went out of their way to make sure it was installed.

I have a feeling that I’m not really being understood regarding what I’m trying to do with Zypper, so I’m going to try one last time to explain (with greater detail this time).

When I use pacman on Arch Linux to install software, packages can be flagged in one of two ways. “Explicitly Installed” and “Installed as Dependency”. Literally every single installed package is flagged in one of those two ways. An explicitly installed application can still be a dependency for another application, but at the time it was installed, it was not as a dependency (explicitly installed by the user).

http://pastebin.com/bBTnkcvE
I’ve created this pastebin to illustrate what I’m trying to do. This is what the output looks for me when I enter “pacman -Qetq” (Q=Query, e=explicitly installed, t=not required, q=only show package names) on my Arch Linux machine.

All those applications were installed explicitly by me. None of them were installed as dependencies, and furthermore none of them depend on each other (regardless of the initial install reason). If every single application in that pastebin (and ALL of their dependencies) were to be removed, I would have nothing installed.

It seems that you guys have gotten the impression that I want to remove orphans. This is not the case. To show how searching for orphans is distinctly different, consider the follow command “pacman -Qdt” (Q=Query, d=installed as dependency, t=not required). So, the searches are very similar, but produce nearly opposite output.

I hope this clarifies what I’m trying to accomplish a little bit better.

I did understand you, but I don’t think there is a way to do what you want with YaST or zypper.
Even the history only states whether a package got installed or removed, not why.

You could maybe parse the log file (/var/log/zypper.log) somehow to get that information, but I’m not aware of any existing application/script that would do that and present you a list like you want.

You might want to file a feature request at http://fate.opensuse.org/.