How to uninstall/purge packages which were installed in a certain period of time?

Asked by Jay Strict

Sometimes I want to compile some upstream package of my own. Then this package has lots of dependencies, which I have to fullfil before compiling. So I start synaptic and install them all (sometimes this is 20 or so packages). I then compile my package and don't need all the lib-*-dev packages anymore.

So I want synaptic to uninstall all packages which were installed in the time from, say 12th of February until now.
How can I do that?

In Synaptic, choosing File -> History, one can see all these packages, but not choose to remove them.
Perhaps there is even a solution with apt-get instead of synaptic?

Thank you for any ideas
Jörg

Question information

Language:
English Edit question
Status:
Solved
For:
synaptic Edit question
Assignee:
No assignee Edit question
Solved by:
Bhavani Shankar
Solved:
Last query:
Last reply:
Revision history for this message
Best Bhavani Shankar (bhavi) said :
#1

Hello

I use debfoster to uninstall or purge packages..

   3. debfoster is a front end for both apt-get and apt-cache that unifies their separate capabilities for a very specific set of operations. It maintains a database of installed software that is managed by APT on the system, and allows for easy viewing and management of installed software.
      Though it is a very useful tool, it is not part of the core APT set of utilities, so it must in many cases be installed separately on your system by use of the apt-get install command. When debfoster is entered at the command line, it goes through major software packages managed by APT and asks what you want to do with them. In addition, a listing of other installed packages on which it depends will also be shown. In each case, you can give one of several responses, some of the more common of which are described here:
          * n removes the package as though the apt-get --purge remove command had been issued for that package.
          * qis the fail-safe option, "quit". If you have accidentally given an unintended response to a debfoster prompt, you can use q to exit the debfoster program without finalizing any of the decisions you've made.
          * s causes debfoster to skip the current package. This neither uninstalls the software nor causes it to be removed from the debfoster list of packages that are in question. This can be useful as a reminder if you think you might later want to remove the package, or want to research it in more depth before giving a final answer.
          * y will cause the package to be kept, along with all its dependencies. Until something changes to alter the state of the package on the system, you will not be asked again about this package, even if you run debfoster again. It is possible to start debfoster so that it shows all packages it manages -- even those you have previously told it to keep with the y command -- by using the -n command line option, as in debfoster -n. You can also choose to keep a package by simply pressing the Enter key, because y is the default answer.
          * ?, the question mark, produces the same output as apt-cache show without kicking you out of the debfoster program. This allows for at least some limited research on a given package while using debfoster in case you are not certain whether you want to remove a given package from the system.
          * h shows help information to give guidance in usage of the debfoster program.

For Example It will ask you things like this:
ubuntu-desktop depends on the following packages:[list of maybe 200 packages]
Keep ubuntu-desktop? [Yes/No/Purge etc]

It can be installed by giving the following command in a terminal:

sudo apt-get install debfoster (as said above)

Hope it Helps

Bhavani Shankar.

Revision history for this message
Jay Strict (jay-strict) said :
#2

I just installed debfoster and tried ist. It is very useful when you have time to go through all your installed packages.
This that's not what I want.
Anyways, thank you for your idea Bhavani Shankar.

I just want to remove _precisely_ the packages that were installed during the last 10 days.
But without selecting each package manually.

Revision history for this message
Bhavani Shankar (bhavi) said :
#3

Unfortunately that cant be done I think...

Revision history for this message
Jay Strict (jay-strict) said :
#4

Thanks Bhavani Shankar, that solved my question.

Revision history for this message
Jay Strict (jay-strict) said :
#5

Ok then.
I think I will use debfoster to uninstall unnecessary packages then.

Thanks for your help.

Jörg

Revision history for this message
Bhavani Shankar (bhavi) said :
#6

My pleasure... :)