37

Not packages and not all applications. Just the applications user installed by himself from whatever source (Software Center, manually added PPA, etc.).

If the above is not possible - a list of all installed applications or at least a GUI which lists the applications so I can take screenshots of it.

I've read a dozen of similar questions and people posting answers usually don't even get close to OP question merit. Please note that my question includes 'user installed'.

Answer: It is not currently possible in Ubuntu Linux. (choosing tijybba's answer as the closest one though)

4 Answers 4

34

You can actually use the Ubuntu Software Centre, as shown in the screenshot here:

Ubuntu Software Center: "Installed"-menu

Also you can see it in Synaptic Bottom left list selections.

By cd /etc/apt/sources.list.d/ && cat *.list you will get list of all repositories in your system.

You can also you Y PPA manager to backup and update your repositories.


Second Method

[Since this method involves installing all the packages , but if we think that newly Installed OS will already have those 90 % packages , so it will ignore the present ones and install the new manually added ones , which will be only your manually installed applications]

This method from here.

sudo dpkg --get-selections > installed-applications.txt

it will generate a list of installed applications in txt file in home folder.

To use this file to install the same applications you will have to do ( But before this please also add all the Third party Repositories as was present in older one)

sudo dpkg --set-selections < installed-applications.txt
sudo apt-get -y update
sudo apt-get dselect-upgrade

This is also possible through Gui way

sudo add-apt-repository ppa:webupd8team/mintbackup && sudo apt-get update
sudo apt-get install mintbackup

enter image description here

I guess image almost speaks itself, backup your selection, then in New installation restore it.

2
  • Cannot add PPA: 'ppa:~webupd8team/ubuntu/mintbackup'. The team named '~webupd8team' has no PPA named 'ubuntu/mintbackup'
    – alhelal
    Oct 9, 2018 at 12:52
  • dpkg: warning: package not in status nor available database at line 1574: wireshark and so on for all applications.
    – alhelal
    Oct 10, 2018 at 1:23
20

apt-mark showmanual will give you a list of "manually installed" packages. This includes packages installed by the installer, which is most of them. But if you run this after installation and compare the output again later, you'll get a list of packages which the user has specifically requested, excluding automatically installed dependencies.

For example:

$ # Save the current list of manually installed packages
$ apt-mark showmanual | sort > original-package-list

# ...time passes...

$ # Compare the old list with the current list
$ # (this will output a list of packages that have been installed by the user since the last command)
$ apt-mark showmanual | sort | comm -13 - original-package-list

Note that applications are packages as far as Software Center and manually added PPAs are concerned. Differentiating between packages specifically requested and packages brought in to satisfy dependencies is I think the best you can do.

Or to just see a list of all packages installed, run dpkg-query -W -f'${PackageSpec}\n'.

3

only root can install packages under Ubuntu, the user that can do that is just only 1, the sudoers are just user with equivalent rights.

However you can get a lot of information looking at the logs, you can look at

the apt log under /var/log/apt/ the dpkg log under /var/log/

and you can get the list of the installed packages with just a command:

dpkg -l | grep ii
2
  • You can rephrase my question anyway you want unless the original meaning remains. If it's called 'sudoers installed applications' then so be it :) Naturaly I could rephrase my question to 'How to list applications installed after system installation'. "and you can get the list of the installed packages" - for what purpose?
    – Bucic
    Jul 4, 2012 at 19:09
  • +1 for /var/log/apt. If you've installed everything with apt-get, searching for 'Command line:' in this log gives you a nice list of stuff you installed manually.
    – drevicko
    Oct 14, 2012 at 11:58
1

Actually, per your question I see that this following command does what you need dpkg -l | grep ii. This listed every installed package as it should for me. Now it does not say user A or user B but again this is a limitation not of sudo but of software center logs. EVEN using sudo the user who called sudo is passed so you could still have any app log who called sudo to run a command. Now of course you can get around this rather easily because part of sudo is the ability to login as any user [who has access to sudo] if you know their password, hack it, or change it if you have those rights on the system.

If you are concerned about what a user has installed in that it may put you or your system at risk you may want to review why you gave them sudo access and along with that the ability to install packages, but that's just a side note.

I have a feeling you are asking for yourself which packages you have installed since system install so you can either clean up or mirror the setup to a new machine. Answers here already cover the backup/restore so we'll skip that.

Since there is no easy straight forward way to find which user called the install of a package a better approach may be to use the command as listed both above and by another user to list all installed packages and have a browser window open to Google and run Google searched to figure out which packages are required to keep your system operational and which ones are not.

Skip to here to skip most of the fluff and get to the answer more directly...

You could also review your sudoers logs to see who called for the install of what let me give an example line

May 15 11:26:30 <COMPUTERNAME> sudo:   <user who called sudo> : TTY=unknown ; PWD=/home/pariah (pwd file or auth method used to verify user) ; USER=root (User they were running as) ; COMMAND=/usr/bin/thunar (the command they ran)

So this tells me at this time and date this user called for a sudo [actually in this case gksu was used btw], what user sudo let them have permissions as and the big one the command they ran!

Now if you were to grep for apt-get or similar within the sudo log [/var/log/auth.log] and older ones will have .0 .1 etc appended to the end.

You could piece together which installs the user called for on the command line itself. If they used software-center I am not sure if the relevant terminal command would get an auth line here, but you get to use the software center logs found at:

/var/log/apt/history.log and older logs are in .gz compressed archives

Now the software center log does not provide the user who authed the installs as far as I have ever seen within that log, but it lists EVERY add, modify, or remove software center performs. Again this log also has time and date stamps as well so easy enough to find ackages after base system install go to oldest log go to top or if you remember the time and date of when the base install completed and you are good to go.

Both of those log files mentioned are in plaintext and you can use any gedit, mousepad, leafpad whatever text editor your Ubuntu flavor uses for it's default to view and or print them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .