0

I like to test kmymoney. When trying to install there are a lot of kde packages that are needed by this program. That's ok, I'm using Unity and there are no kde packages installed at this moment. So, when I like to remove all this packages after testing kmymoney, how can I do that?

sudo apt-get install kmymoney >> /some/folder/kmymoney.txt

gives me the output of apt-get, but that's not what I'm looking for. Is there a way to remove this packages properly?

Thanx in advance

W.

5 Answers 5

1

You can use dpkg -l before and after installing your package. This command lists the packages installed on your machine.

Saving the output in two files, you can afterwards compare both using a combination of diff and awk in order to extract the list of packages that have been installed when installing your new package.

1

I'm using

I'm using the logsave to keep own logs.

man logsave

NAME
       logsave - save the output of a command in a logfile

SYNOPSIS
       logsave [ -asv ] logfile cmd_prog [ ... ]

DESCRIPTION
       The  logsave  program  will execute cmd_prog with the specified argument(s),
       and save a copy of its output to logfile. If the containing directory for 
       logfile does not exist, logsave will accumulate the output in memory until 
       it  can  be written out.  A copy of the output will also be written to 
       standard output.

Example

When installing the Planner:

logsave 2011110800_Install_planner.txt sudo apt-get install planner

The 2011110800_Install_planner.txt has:

Log of sudo apt-get install planner 
Tue Nov  8 17:51:19 2011

Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  gconf2 gconf2-common libart-2.0-2 libgconf2-4 libglade2-0 libgnomecanvas2-0
  libgnomecanvas2-common libgtk-3-0 libgtk-3-bin libgtk-3-common librarian0
  rarian-compat scrollkeeper
Suggested packages:
  gconf-defaults-service librsvg2-common gvfs
The following NEW packages will be installed:
  gconf2 gconf2-common libart-2.0-2 libgconf2-4 libglade2-0 libgnomecanvas2-0
  libgnomecanvas2-common libgtk-3-0 libgtk-3-bin libgtk-3-common librarian0
  planner rarian-compat scrollkeeper
0 upgraded, 14 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,385 kB of archives.
After this operation, 18.2 MB of additional disk space will be used.
Do you want to continue [Y/n]?

Removing (copy&pasting the installed packages from the 2011110800_Install_planner.txt)

logsave 2011110800_Remove_planner.txt sudo apt-get purge gconf2 gconf2-common libart-2.0-2 libgconf2-4 libglade2-0 libgnomecanvas2-0 libgnomecanvas2-common libgtk-3-0 libgtk-3-bin libgtk-3-common librarian0 planner rarian-compat scrollkeeper

2011110800_Remove_planner.txt has:

Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
  gconf2* gconf2-common* libart-2.0-2* libgconf2-4* libglade2-0*
  libgnomecanvas2-0* libgnomecanvas2-common* libgtk-3-0* libgtk-3-bin*
  libgtk-3-common* librarian0* planner* rarian-compat* scrollkeeper*
0 upgraded, 0 newly installed, 14 to remove and 0 not upgraded.
After this operation, 18.2 MB disk space will be freed.
Do you want to continue [Y/n]? 

With gui

The Synaptic and the Muon package managers are keeping history logs or parsing the apt/dpkg log.

Logs

Checking installed/updated/removed packages from the dpkg log (command line):

Recent status log:

grep "status installed" /var/log/dpkg.log

grep upgrade /var/log/dpkg.log

grep remove /var/log/dpkg.log

Earlier/more: How to completely remove desktop?

1

Why don't you just uninstall kymymoney directly? I don't know what do you mean saying "properly" but as other answers explained, you can use both aptitude or apt-get for that.

sudo apt-get remove kymymoney
sudo apt-get autoremove

or

sudo aptitude remove kymymoney

will both properly remove the package and its unused dependencies.

2
  • sudo apt-get autoremove doesn't remove all the installed packages coming with kmymoney.
    – Wolf F.
    Nov 12, 2011 at 12:09
  • 1
    This is interesting since as far as I know, autoremove should work. But, I can't check it right now. Nov 12, 2011 at 12:33
0

You can remove all packages that start with kde by typing into a terminal sudo apt-get remove kde-*

0

Using aptitude for removal will remove all related packages that are not anymore needed.

  1. Install sudo apt-get intall aptitude
  2. Use command for updates couse it uses seperate database for itself sudo aptitude update
  3. When removing u remove just programm or also all config files for that programm sudo aptitude purge programmmane and all not needed will be deleted

Using Apt-get

  1. When u want to completley remove programm and its all related dependencies then use sudo apt-get autoremove packagename
  2. If just to remove all unneeded dependecies left by previously removed packages then `sudo apt-get autoremove

Difference

Apt-get is longer to write what you want

Aptitude allways uses autoremove so its better timesaving`

3
  • You shouldn't mix apt-get and aptitude! I was using apt-get til now, so aptitude is not an option.
    – Wolf F.
    Nov 12, 2011 at 12:10
  • 1
    Sure i wont mix them and You cant mix them couse they have different names but does the same as other but better. Aptitude is a wrapper one-stop-shop for apt-get it only helps more and of course by default everyone uses apt-get but now you can try aptitude and see for yourself that its easyr apt-get and all commands are the same and u can check them using sudo aptitude [TAB] psychocats.net/ubuntu/aptitude
    – Kangarooo
    Nov 12, 2011 at 13:01
  • 1
    You can definitely mix apt-get and aptitude. They both perform the same kinds of operations, and they use the same files to store information about what software is installed, what software is available, and the relationships (such as dependencies) between different packages. The notion that you cannot use apt-get and aptitude on the same system is an urban legend, and baseless. Nov 13, 2011 at 3:04

You must log in to answer this question.

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