Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #222928

Re: Return a Debian system to a pristine state

From Marco Möller <talby@debianlists.mobilxpress.net>
Newsgroups linux.debian.user
Subject Re: Return a Debian system to a pristine state
Date 2020-05-30 20:00 +0200
Message-ID <AcdW1-e5-1@gated-at.bofh.it> (permalink)
References (5 earlier) <Abskp-5s5-11@gated-at.bofh.it> <AbOEh-1LJ-3@gated-at.bofh.it> <AbTaW-4yY-11@gated-at.bofh.it> <AbTND-52o-1@gated-at.bofh.it> <Ac02J-vw-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 30.05.20 05:00, David Wright wrote:
> On Fri 29 May 2020 at 22:23:23 (+0200), Marco Möller wrote:
>> On 29.05.20 21:48, David Wright wrote:
>>> On Fri 29 May 2020 at 21:57:06 (+0700), Victor Sudakov wrote:
>> (...)
>>>>> "apt has a bug, cannot believe it!"
>>>>> https://lists.debian.org/debian-user/2020/05/msg00567.html
>>>>
>>>> Well, I must admit, I can sympathize with this person's frustration. He
>>>> just got confused among those AutoRemove* advanced options.
>>>
>>> I think it's much more than that. The OP appeared to regard the
>>> --no-install-recommends option as a *property* that is applied to each
>>> package installed under that recommendation regime, and that
>>> that property would be preserved for all time. But as the "-install-"
>>> in --no-install-recommends shows, it's just an option for the install
>>> command itself.
>> (...)
>>
>> Here the OP of that thread. Exactly this, David.
>> I would really wish that the "--no-install-recommends" option would
>> act as a "--no-recommends-wished" option!

(...)

>> Yes, a bigger work load on apt itself, but I really think it
>> would be worth it. Just consider how many of us are forced to set up
>> sophisticated backup strategies, or applying for this file system
>> snapshot tools to act as a "time machine", while an enhanced apt could
>> target this need in an easy an elegant fashion for the user (not
>> speaking about the user's data and about the configuration of the
>> packages, but speaking about the installation state of software
>> packages)!
> 
> You seem to be suggesting a one-dimensional install/undo facility,
> but an installation is a multi-dimensional graph of packages and
> dependencies. It's rare that one would want to just backtrack through
> a de-installation in the exact reverse order of installation.
> I also think it would be difficult to support, as it would give
> people unrealistic expectations of what's possible.

In the sense of my wish, any removal or purge of a package would do the 
following (illustrating the idea and being aware that for sure some more 
in depth thoughts will have to be spent on it):


(0) allow the user to store in some config file a list of time stamps 
which then could be respected as an option in the below outlined 
algorithm; the config file could look like this and for instance a 
leading integer number could later on be used for addressing a certain 
time stamp:
   1; timestamp; essential OS after the initial installation
   2; timestamp; added all my packages for a personalized CLI experience
   3; timestamp; my minimum graphical DE is installed
   4; timestamp; my full workstation, pristine, nice fall back state
   5; timestamp; enhancements, quite good achievements
   6; timestamp; testing
   7; timestamp; arbitrary user comment
   default=4
The first entry "1" could be stored automatically by the Debian 
installer after the OS install and first reboot finished successfully;
the default could initially be set to 1; the user could edit this file 
(and then of course also change the default value to another integer 
value like 4 in the above example; invalid default values are always 
treated as if the youngest timestamp would have been defined, value 7 in 
my above example);
An enhanced apt-cache database would have to register for each installed 
package the installation date and if (not which) recommends and if (not 
which) suggests have been wished to install; for the drawn in recommends 
and suggest a list of the packages which explicitly wished their 
installation has to be maintained in the database by storing this 
information in the entry of each installed package;
With this information there would not arise a limitation for at any time 
defining time stamps in the config files, because the "wished" tree 
besides the "dependency" tree could be reconstructed for any time;

(1a) if 'apt remove' or 'apt purge' are called with a timestamp option 
and not specifying a specific package name, for instance 'apt remove 
--keeptimestamp 3' then remove or purge all packages installed AFTER the 
time stamp (for example, regarding my config file in (0), by the option 
value '3' in '--keeptimestap 3', the minimum graphical DE installation 
would remain but everything installed afterwards would be removed; the 
below mentioned steps (1b), (2) and (3) are not to be executed no more;

(1b) if a specific package name is mentioned, then read for this 
specific by 'apt remove' or 'apt purge' targeted package IF recommends 
and suggests have been wished by this package; IF NOT, then simply 
remove or purge the specific package, considering also the dependencies 
as usual, and continue at step (4); IF recommends or suggests have been 
wished then continue at step (2);

(2) if NO time stamp option was given then use the default timestamp; 
check if any of the recommended and suggested packages have themselves 
registered in their database entry in the "wished by" list that they 
would be wished by any other installed package, considering all packages 
which have been installed before the time stamp to be wished packages, 
and if for a package from the recommends and suggests list it now 
results that it is not wished any more, then besides removing or purging 
only the specified package do additionally also remove or purge the no 
more wished recommended and suggested package(s);
(3) iteratively follow the logic of step (2) for the additionally found 
packages which meanwhile became marked for removal or purge and work 
also on their list of recommends and suggests;

(4) in interactive mode show the list of for removal or purge marked 
packages and offer to the user the question, if ALL these found no more 
wished packages shall now be processed, or if for each package it should 
be asked individually once more;
(5) if in (4) the manual, step wise approval was requested, then ask by 
priority first for the packages found in the first iteration, then for 
the ones found in the next iteration, and so on.
(6) iterate steps (4) to (6) until a final selection is reached which 
should be processed


Any simple 'apt remove package' or 'apt purge package' would no more let 
unwished packages remain in the system, and any 'apt remove 
--keeptimestamp N' or 'apt purge --keeptimestamp N' would set the 
installation of packages back to a pristine state. At least the package 
state right after the initial, successful OS installation is always 
being defined as a pristine state, and alternative pristine stamps could 
any time be defined by the user for any time. Combination of the options 
would be possible, like in: 'apt remove --keeptimestamp 3 packagename'; 
The latter case would protect to remove the package "packagename" if 
this would break the state of time stamp 3.
Splendid!

 From the view of a user, it does not sound so complicated ;-) . I 
guess, and this will be fair, that I am now asked to program it, it's 
open source and I should contribute. But unfortunately I can only 
contribute ideas, I am not a programmer. :-(

Back to linux.debian.user | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-27 10:50 +0200
  Re: Return a Debian system to a pristine state Dan Ritter <dsr@randomstring.org> - 2020-05-27 15:50 +0200
    Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-28 07:20 +0200
      Re: Return a Debian system to a pristine state Greg Wooledge <wooledg@eeg.ccf.org> - 2020-05-28 13:50 +0200
        Re: Return a Debian system to a pristine state The Wanderer <wanderer@fastmail.fm> - 2020-05-28 14:10 +0200
          Re: Return a Debian system to a pristine state Greg Wooledge <wooledg@eeg.ccf.org> - 2020-05-28 15:00 +0200
            Re: Return a Debian system to a pristine state The Wanderer <wanderer@fastmail.fm> - 2020-05-28 15:10 +0200
          Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-28 16:20 +0200
        Re: Return a Debian system to a pristine state Kenneth Parker <sea7kenp@gmail.com> - 2020-05-28 14:50 +0200
        Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-28 16:00 +0200
          Re: Return a Debian system to a pristine state Greg Wooledge <wooledg@eeg.ccf.org> - 2020-05-28 16:10 +0200
            Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-28 16:40 +0200
              Re: Return a Debian system to a pristine state Greg Wooledge <wooledg@eeg.ccf.org> - 2020-05-28 16:50 +0200
                Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-29 17:20 +0200
              Re: Return a Debian system to a pristine state John Hasler <jhasler@newsguy.com> - 2020-05-28 18:00 +0200
                Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-05-29 09:50 +0200
                Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-29 16:40 +0200
                Re: Return a Debian system to a pristine state Miles Fidelman <mfidelman@meetinghouse.net> - 2020-05-29 16:50 +0200
                Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-29 17:20 +0200
                Re: Return a Debian system to a pristine state John Hasler <jhasler@newsguy.com> - 2020-05-29 17:40 +0200
                Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-30 06:00 +0200
                Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-05-30 07:10 +0200
                Re: Return a Debian system to a pristine state Tixy <tixy@yxit.co.uk> - 2020-05-30 11:30 +0200
                Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-05-30 14:40 +0200
                Re: Return a Debian system to a pristine state Tixy <tixy@yxit.co.uk> - 2020-05-30 19:40 +0200
              Re: Return a Debian system to a pristine state Miles Fidelman <mfidelman@meetinghouse.net> - 2020-05-28 18:00 +0200
          Re: Return a Debian system to a pristine state <tomas@tuxteam.de> - 2020-05-28 16:40 +0200
          Re: Return a Debian system to a pristine state Eduardo M KALINOWSKI <eduardo@kalinowski.com.br> - 2020-05-28 17:10 +0200
          Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-05-28 17:10 +0200
            Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-29 17:00 +0200
              Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-05-29 21:50 +0200
                Re: Return a Debian system to a pristine state Marco Möller <talby@debianlists.mobilxpress.net> - 2020-05-29 22:30 +0200
                Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-05-30 05:10 +0200
                Re: Return a Debian system to a pristine state Marco Möller <talby@debianlists.mobilxpress.net> - 2020-05-30 20:00 +0200
                Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-01 08:10 +0200
                Re: Return a Debian system to a pristine state Marco Möller <talby@debianlists.mobilxpress.net> - 2020-06-01 12:30 +0200
                Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-01 20:00 +0200
                Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-31 11:30 +0200
                Re: Return a Debian system to a pristine state Joe <joe@jretrading.com> - 2020-05-31 13:40 +0200
                Re: Return a Debian system to a pristine state rhkramer@gmail.com - 2020-05-31 14:40 +0200
                Re: Return a Debian system to a pristine state l0f4r0@tuta.io - 2020-05-31 15:00 +0200
                Re: Return a Debian system to a pristine state The Wanderer <wanderer@fastmail.fm> - 2020-05-31 15:00 +0200
                Re: Return a Debian system to a pristine state Michael Howard <mike@dewberryfields.co.uk> - 2020-05-31 15:10 +0200
                Re: Return a Debian system to a pristine state "Thomas Schmitt" <scdbackup@gmx.net> - 2020-05-31 17:00 +0200
                Re: Return a Debian system to a pristine state Dan Ritter <dsr@randomstring.org> - 2020-05-31 17:40 +0200
                Re: Return a Debian system to a pristine state "Thomas Schmitt" <scdbackup@gmx.net> - 2020-05-31 21:00 +0200
                Re: Return a Debian system to a pristine state Michael Howard <mike@dewberryfields.co.uk> - 2020-05-31 19:50 +0200
                Re: Return a Debian system to a pristine state rhkramer@gmail.com - 2020-05-31 22:00 +0200
                Re: Return a Debian system to a pristine state Michael Howard <mike@dewberryfields.co.uk> - 2020-05-31 23:40 +0200
                Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-06-04 16:40 +0200
                Re: Return a Debian system to a pristine state John Hasler <jhasler@newsguy.com> - 2020-06-04 22:50 +0200
                Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-06-05 17:40 +0200
                Re: Return a Debian system to a pristine state The Wanderer <wanderer@fastmail.fm> - 2020-06-05 18:10 +0200
                Re: Return a Debian system to a pristine state Brian <ad44@cityscape.co.uk> - 2020-06-06 12:30 +0200
                Re: Return a Debian system to a pristine state The Wanderer <wanderer@fastmail.fm> - 2020-06-06 13:00 +0200
                Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-06-07 14:00 +0200
                Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-06 11:30 +0200
                Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-06-08 21:40 +0200
                Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-09 08:10 +0200
                Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-07-02 03:10 +0200
                Re: Return a Debian system to a pristine state Tom Dial <tddial@comcast.net> - 2020-06-01 05:10 +0200
                Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-01 08:30 +0200
                Re: Return a Debian system to a pristine state Tom Dial <tddial@comcast.net> - 2020-06-02 00:40 +0200
                Re: Return a Debian system to a pristine state Marco Möller <talby@debianlists.mobilxpress.net> - 2020-06-01 11:50 +0200
                Re: Return a Debian system to a pristine state "Sijmen J. Mulder" <ik@sjmulder.nl> - 2020-06-04 10:50 +0200
                Re: Return a Debian system to a pristine state Tom Dial <tddial@comcast.net> - 2020-06-04 21:20 +0200
                Re: Return a Debian system to a pristine state songbird <songbird@anthive.com> - 2020-06-01 13:30 +0200
                Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-06-01 20:30 +0200
                Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-06-02 06:10 +0200
                Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-02 07:30 +0200
                Re: Return a Debian system to a pristine state Dan Ritter <dsr@randomstring.org> - 2020-06-02 14:40 +0200
                Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-06-02 17:10 +0200
                Re: Override default post-install starting of services [was Return  a Debian system to a pristine state] davidson <davidson@freevolt.org> - 2020-07-05 22:20 +0200
                Re: Override default post-install starting of services [was Return a  Debian system to a pristine state] David Wright <deblis@lionunicorn.co.uk> - 2020-07-05 23:40 +0200
      Re: Return a Debian system to a pristine state Dan Ritter <dsr@randomstring.org> - 2020-05-28 14:10 +0200
      Re: Return a Debian system to a pristine state Miles Fidelman <mfidelman@meetinghouse.net> - 2020-05-28 16:40 +0200
        Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-28 16:50 +0200
  Re: Return a Debian system to a pristine state songbird <songbird@anthive.com> - 2020-05-27 16:10 +0200
    Re: Return a Debian system to a pristine state Greg Wooledge <wooledg@eeg.ccf.org> - 2020-05-27 16:30 +0200
      Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-28 07:40 +0200
        Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-05-28 08:10 +0200
    Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-28 07:30 +0200
  Re: Return a Debian system to a pristine state Charles Curley <charlescurley@charlescurley.com> - 2020-05-27 20:10 +0200
    Re: Return a Debian system to a pristine state Victor Sudakov <vas@sibptus.ru> - 2020-05-28 07:40 +0200
  Re: Return a Debian system to a pristine state "Sijmen J. Mulder" <ik@sjmulder.nl> - 2020-05-28 11:20 +0200
    Re: Return a Debian system to a pristine state <tomas@tuxteam.de> - 2020-05-28 11:30 +0200
  Re: Return a Debian system to a pristine state emetib <chadbrabec@gmail.com> - 2020-06-01 05:10 +0200
    Re: Return a Debian system to a pristine state Marco Möller <talby@debianlists.mobilxpress.net> - 2020-06-01 12:20 +0200
      Re: Return a Debian system to a pristine state songbird <songbird@anthive.com> - 2020-06-01 13:30 +0200
      Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-06-04 16:40 +0200
        Re: Return a Debian system to a pristine state The Wanderer <wanderer@fastmail.fm> - 2020-06-04 21:50 +0200
          Re: Return a Debian system to a pristine state Marco Möller <talby@debianlists.mobilxpress.net> - 2020-06-05 13:10 +0200
            Re: Return a Debian system to a pristine state Andrei POPESCU <andreimpopescu@gmail.com> - 2020-06-06 11:40 +0200
              Re: Return a Debian system to a pristine state David Wright <deblis@lionunicorn.co.uk> - 2020-06-08 21:40 +0200

csiph-web