Welcome!
Important information
-- Spectre and Meltdown vulnerabilities
-- Change in MX sources

News
-- MX Linux on social media: here
-- Mepis support still here

Current releases
-- MX-17.1 Final release info here
-- antiX-17 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

Knowing your APT history

Post Reply
Message
Author
User avatar
dreamer
Forum Regular
Forum Regular
Posts: 201
Joined: Sun Oct 15, 2017 11:34 am

Knowing your APT history

#1 Post by dreamer » Wed May 30, 2018 7:47 pm

I create this thread as a proper continuation of the off topic discussion that happened in this thread:

viewtopic.php?f=104&t=45307

My understanding is this: Synaptic history is preserved (by Synaptic) and carries over to created snapshots. The APT history found in Apt Notifier (maybe even APT itself) is not carried over to snapshots. That's why I had a January log in Synaptic but not in Apt Notifier (the date for the snapshot seems to match nicely with missing APT history).

I just verified this. /var/log/apt doesn't export history to new snapshots. It also compresses files after just one month (can that period be extended?).

Apt Notifier is good but the data needs to be copied to a text editor to be searchable.

This topic isn't a huge problem. I'm a little surprised that APT which is at the heart of many distros doesn't come with a Synaptic-style searchable history (I would have expected at least a command line version). Maybe this is one reason for the lasting popularity of Synaptic?

User avatar
richb
Administrator
Posts: 17104
Joined: Wed Jul 12, 2006 2:17 pm

Re: Knowing your APT history

#2 Post by richb » Wed May 30, 2018 7:52 pm

CTRL-S in Notifier history does a search.
var/cache/apt can be edited out of the exclusion file.
Forum Rules
Guide - How to Ask for Help

Rich
SSD Production: MX 17.1
AMD A8 7600 FM2+ CPU R7 Graphics, 16 GIG Mem. Three Samsung EVO SSD's 250 GB, 350 GB HD

skidoo
Forum Regular
Forum Regular
Posts: 867
Joined: Tue Sep 22, 2015 6:56 pm

Re: Knowing your APT history

#3 Post by skidoo » Wed May 30, 2018 11:20 pm

It also compresses files after just one month
To customize the logfile handling (this is general linux stuff, not specific to MX nor debian) refer to the logrotate manpage
(and probably will be helpful to skim some online examples/tutorials).
/etc/logrotate.conf

User avatar
dreamer
Forum Regular
Forum Regular
Posts: 201
Joined: Sun Oct 15, 2017 11:34 am

Re: Knowing your APT history

#4 Post by dreamer » Thu May 31, 2018 2:23 pm

Ok, thanks. The combined knowledge of the MX Linux forum can probably solve any Linux/Debian/MX Linux related problem. :popcorn:
richb wrote:
Wed May 30, 2018 7:52 pm
CTRL-S in Notifier history does a search.
Is there a way to go to the next matching entry? I tried a few keys, but couldn't really make this search functionality usable.
skidoo wrote:
Wed May 30, 2018 11:20 pm
To customize the logfile handling (this is general linux stuff, not specific to MX nor debian) refer to the logrotate manpage
(and probably will be helpful to skim some online examples/tutorials).
/etc/logrotate.conf
I have looked at this. I think I have the info I need. Editing that file shouldn't be hard. What confused me is that "compress" was commented out (#) and it still compresses log (history) files. So I was thinking; maybe it's a bug, but probably not. This logrotate functionality feels like pure server or sysadmin stuff, which it probably is. It's possible to experiment with other commands given by the manpage like "nocompress".

My original logrotate.conf

Code: Select all

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
#compress

# packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp {
    missingok
    monthly
    create 0664 root utmp
    rotate 1
}

/var/log/btmp {
    missingok
    monthly
    create 0660 root utmp
    rotate 1
}

# system-specific logs may be configured here

skidoo
Forum Regular
Forum Regular
Posts: 867
Joined: Tue Sep 22, 2015 6:56 pm

Re: Knowing your APT history

#5 Post by skidoo » Thu May 31, 2018 4:46 pm

"compress" was commented out (#) and it still compresses log (history) files.
Okay, logrotate.conf just sets the default directives. Files present within the /etc/logrotate.d/ directory may contain overriding directives. Probably need to outcomment a compress directive within one of those (or change any found, and specify "nocompress" instead).

User avatar
dreamer
Forum Regular
Forum Regular
Posts: 201
Joined: Sun Oct 15, 2017 11:34 am

Re: Knowing your APT history

#6 Post by dreamer » Thu May 31, 2018 6:01 pm

skidoo wrote:
Thu May 31, 2018 4:46 pm
"compress" was commented out (#) and it still compresses log (history) files.
Okay, logrotate.conf just sets the default directives. Files present within the /etc/logrotate.d/ directory may contain overriding directives. Probably need to outcomment a compress directive within one of those (or change any found, and specify "nocompress" instead).
I think the file in question is this one: /etc/logrotate.d/apt
It looks like this and maybe a little # sign in front of "compress" in the second paragraph might do the trick. We'll see... next month maybe... if this little logrotate program can keep its hands away from my logs. :crossfingers: Thank you for pointing me in the right direction. If I change "monthly" to "yearly" I can probably keep the history from an entire year in one file, which can be convenient.

Code: Select all

/var/log/apt/term.log {
  rotate 12
  monthly
  compress
  missingok
  notifempty
}

/var/log/apt/history.log {
  rotate 12
  monthly
  compress
  missingok
  notifempty
}


User avatar
kmathern
Forum Veteran
Forum Veteran
Posts: 9333
Joined: Wed Jul 12, 2006 2:26 pm

Re: Knowing your APT history

#7 Post by kmathern » Sun Jun 03, 2018 10:36 am

dreamer wrote:
Wed May 30, 2018 7:47 pm
My understanding is this: Synaptic history is preserved (by Synaptic) and carries over to created snapshots. The APT history found in Apt Notifier (maybe even APT itself) is not carried over to snapshots. That's why I had a January log in Synaptic but not in Apt Notifier (the date for the snapshot seems to match nicely with missing APT history).

I just verified this. /var/log/apt doesn't export history to new snapshots. It also compresses files after just one month (can that period be extended?).

Apt Notifier is good but the data needs to be copied to a text editor to be searchable.

This topic isn't a huge problem. I'm a little surprised that APT which is at the heart of many distros doesn't come with a Synaptic-style searchable history (I would have expected at least a command line version). Maybe this is one reason for the lasting popularity of Synaptic?
For the APT history in MX Updater/apt-notifier, it actually greps the /var/log/dpkg* log files (/var/log/dpkg.log, /var/log/dpkg.log.1, /var/log/dpkg.log.2.gz, /var/log/dpkg.log.3.gz ...), not the /var/log/apt* logs.

If you're missing some of the APT history in snapshots you created, it might be that you excluded the /var/log/dpkg* logs from the snapshot, though it doesn't look to me like they're excluded by default https://github.com/MX-Linux/mx-snapshot ... clude.list.

User avatar
dreamer
Forum Regular
Forum Regular
Posts: 201
Joined: Sun Oct 15, 2017 11:34 am

Re: Knowing your APT history

#8 Post by dreamer » Sun Jun 03, 2018 4:49 pm

kmathern wrote:
Sun Jun 03, 2018 10:36 am
For the APT history in MX Updater/apt-notifier, it actually greps the /var/log/dpkg* log files (/var/log/dpkg.log, /var/log/dpkg.log.1, /var/log/dpkg.log.2.gz, /var/log/dpkg.log.3.gz ...), not the /var/log/apt* logs.
I was thinking about that, but I don't think it makes any difference. The logrotate program makes sure that these logs are just as hard to work with as the apt logs. I have changed my logrotate preferences. I guess uninstalling logrotate is also an option.
kmathern wrote:
Sun Jun 03, 2018 10:36 am
If you're missing some of the APT history in snapshots you created, it might be that you excluded the /var/log/dpkg* logs from the snapshot, though it doesn't look to me like they're excluded by default https://github.com/MX-Linux/mx-snapshot ... clude.list.
No, I use MX Snapshot with default settings for user accounts. My experience so far is that MX Updater history is missing from snapshots. This can probably be remedied by including that directory in the MX Snapshot configuration.

Post Reply

Return to “Software / Configuration”