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.

Wolf F.
  • 2,323

5 Answers5

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.

uloBasEI
  • 248
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?

user26687
  • 15,174
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.

heartsmagic
  • 5,370
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`

Kangarooo
  • 5,223
0

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

Aaron Hill
  • 5,035