If you use apt command extensively, you would probably expect a command like apt list installed packages. You are not entirely wrong here. This will list all the packages that have been installed using apt.
It will also list the packages that were installed as a dependency. Since the list of installed packages is a huge one, it would be a better idea to use grep and filter the output for a certain package. Note that the above method also lists the applications installed with. If you have read my apt vs apt-get comparison article, you probably already know that both apt and apt-get basically use dpkg.
This means you can use dpkg command to list all the installed packages in Debian. What about Snap and Flatpak applications? How to list them because they are not accessible with apt and dpkg? To show all the Snap packages installed on your system, use this command:. To list all the Flatpak packages installed on your system, use this:.
To list packages using apt command:. To list packages using dpkg command:. So far you saw the list of installed packages in alphabetical order.
What if you want to see the packages that have been installed recently? Thankfully, a Linux system keeps a log of everything that happens in your system. You can refer to the logs to see the recently installed packages.
There are a couple of ways to do this. This will list all the packages including the dependencies that were installed recently on your system along with the time of installation. Pipe the command with less for easy navigation.
Once the system executes the command, the output will display all upgradable packages. Furthermore, it will display details, such as the installed version and the latest version available. If using less , press Q to return to the command line. The system will present all the available package versions in a repository. This is a repository-wide search. You will get results even for packages that have not been installed on your system. Installed indicates the version installed on the system.
Candidate indicates the latest version available. In our example, we can update the udev package to version ubuntu Version Table indicates which versions are available and in which repository. Systems running older versions of Ubuntu might not have the apt tool.
However, an alternative solution is to use dpkg commands. You do not need to run these commands as a superuser. Hence, there is no need to invoke sudo. Both apt and apt-get use dpkg commands so this is a viable method even on the latest versions of Ubuntu. The output should display details such as package name, version, architecture, and a short description. The image below represents the type of output you can expect.
As with apt, you can pipe the results with less to generate a smaller and more manageable output. I'm running Kubuntu I found the above answers to be inadequate as my history log was incomplete and I didn't want to do the work to separate built-in packages with manually installed packages. However, this solution did the trick of showing only manually initiated installed packages. This takes into account also packages installed with aptitude not only apt install or apt-get install , like Benny Hill's answer which I based on :.
The following Bash command works for me in Debian 10 buster. It prints all manually installed packages minus the ones that came from your Debian installation in other words, the packages that you installed with apt install :. You could also save this installer package list somewhere else if you don't want to use sudo every time.
It inspects Debian's apt-history log, and then combines the reports from the apt-mark program. Apt-mark includes packages which were manually installed via use of the 'dpkg' system directly by users, not just ones installed via users through their package manager utility Apt, Synaptic, Software Center, etc.
If you lack the apt-mark utility, you can tell it do just do the history inspection instead. See the GitHub page. I dont know if it's possible to distiguich between user installation and default package installation, because the only way to install package is to have ROOT privillages.
An older question but a solution I came up with after finding this and a couple of other questions for a slightly different task. Trying to keep up to date a list of installed packages for system rebuilds. I found the following works pretty well:.
This takes the list of all installed packages and compares to the history for packages being installed. I'm assuming that packages are not being installed by evil actors trying to hide their tracks. Also a slightly nasty command apt list in a script however it does seem to work for now. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more.
0コメント