Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8374

Raspberry Pi OS • Re: Refresh my memory: What is the command to list all installed packages?

$
0
0
I do not think you are supposed to need the logfiles; there is a database.
Well, the advantage of parsing the log files over using any of the "list" options is that the log files will show you explicitly what YOU installed - basically, tell you what you did. Using that makes it more likely that you will get it right in terms of re-creating history. The problem (which I have hit in past go-arounds of this) with the naive approach (see below at *) is that you end up installing megatons more stuff than what you actually did and (Yes, I know this isn't supposed to be the case, but it is) often bad things happen as a result of this "over-doing it". For example, we've all seen situations where, for no good reason, apt starts to delete a whole bunch of critical packages (for no good reason) and then you end up with a trashed system.

*) What I am calling "the naive approach" - which it looks like I am stuck with - is to install the new system, diff the list from the new system with the list from the old system and than "apt install" everything in the diff output. As I say, this is over-kill and can cause problems.

Anyway, it looks like "dpkg -l" will work, but my memory tells me that's not what I used in the past. I think it was an "apt" command, but just can't quite remember. Note that "dpkg -l" generates more lines that you need (things that don't start with "ii" are things that are not really installed), so some hand-editing will be needed.

So, I will look into fixing this in logrotate for the future.
You're welcome.

Statistics: Posted by ame — Sun Sep 28, 2025 7:36 pm



Viewing all articles
Browse latest Browse all 8374

Trending Articles