[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pacakges installation report



On Tue, Aug 14, 2007 at 08:52 +0200, pol wrote:
> i would like to log installation and uninstallation of the deb packages: i
> mean a time ordered list of the admin operations.  Any ideas?

Have a look at:

    If you use aptitude:

        /var/log/aptitude
        

    As apt-get does not provide logging by default, you have to either 
    
        * switch to aptitude
          
          I should note that this is not as easy as just substituting 
          "aptitude" for "apt-get" as aptitude provides much deeper 
          dependency checking. Aptitude will automatically deinstall a 
          lot of packages, because it does not know that you 
          intentionally installed these packages. So report back, if you 
          plan to do this.

        * hack the desired behaviour into apt-get

         Put a file into /etc/apt/apt.conf.d/ with the following 
         content:

            "DPkg::Pre-Install-Pkgs {"/usr/local/bin/log-apt-get ";};"

        This will cause apt-get to call log-apt-get before a package is 
        installed. 

        log-apt-get has to be something like this:

            #!/bin/bash
            while read paket;
              do echo $(date +'%b %e %R:%S') ${paket#/var/cache/apt/archives/} >> /var/log/apt-get.log;
            done

        Note that this will just log package installations. I am not 
        aware of a way to log package removals as well, but that does 
        not mean that it is not possible.

        I guess it is also possible to adapt the outline script to personal preferences.
        
---
Wolodja Wentland

Attachment: signature.asc
Description: Digital signature


Reply to: