Steve Litt <slitt@???> writes:
> Rainer Weikusat via Dng said on Tue, 10 Jun 2025 09:26:35 +0100
>
>>Steve Litt <slitt@???> writes:
>>> Rainer Weikusat via Dng said on Mon, 09 Jun 2025 11:06:53 +0100
>>>
>>>>Marc Shapiro via Dng <dng@???> writes:
>>>>> Is there anything in the OS supplied applications that requires
>>>>> Python2.7?
>>>>>
>>>>> I have both Python2.7 and Python3.13 installed. The link
>>>>> /usr/bin/python points to /usr/bin/python3, which points to
>>>>> user/bin/python3.13. So the only time that Python2.7 would be used
>>>>> is if it is specifically called for in a script. I am not calling
>>>>> 2.7, so, unless there are OS supplied files that require it, I
>>>>> could delete 2.7, keeping only 3.13.
>>>>>
>>>>> Is there any reason to keep Python2.7?
>>>>
>>>>Try deinstalling (dpkg --purge) it. This will tell what - if
>>>>anything - depends on it. This should enable you to assess whether
>>>>you need/ actually use this anything. If nothing comes up, just
>>>>deinstall it. Should you in future want to use something which needs
>>>>Python2, it'll just be reinstalled automatically.
>>>
>>> Unless he has self compiled or self created stuff needing Python 2.7.
>>> I'd recommend backing up the Python 2.7 executable to another name,
>>> replace the current python2.7 executable with a zenity popup stating
>>> that the former Python 2.7 has been called.
>>
>>That's nothing but a waste of time and effort and source of possible
>>future breakage as it changes a part of the filesystem supposed to be
>>under control of the package manager behind its back. If nothing
>>important depends on Python2, it can just be deinstalled, alongside all
>>the unimportant things which may depend on it. Should it ever be needed
>>for something, reinstalling it is going to be easy.
>
> Oh, cmon Rainer. Time and effort? It's a rename, a tiny shellscript,
> and a chattr command.
That's a finite effort taking a finite amount of time.
> Changes a part of the filesystem? True. But it changes exactly one
> file.
That's a part of the filesystem supposed to be controlled by the package
manager.
> Future breakage? The package manager will probably just ignore it
> or issue a warning. If more severe, it will error out, you can back out
> your chattr, and everything reverts, but I doubt it will come to that.
This the kind of ever accumulating cruft which ultimatively leads to
such splendid pieces of advice as "never update, always reinstall". I've
been using Debian since 1998 and never had to do that during all this
time. And that's because - after a couple of bad experiences with
earlier installations - I religiously avoid stepping onto the toes of
the package manager to ensure that the actual state of the filesystem
and the databases recording its putative state remain consistent.
> About "If nothing important depends on Python2": Unless you've never
> installed anything any way except the package manager, you don't have
> the necessary info to make that determination.
Even assuming I had installed so much stuff manually that I'd long since
forgotten that SuperImportantApplication depends on Python2, deinstall
and see what (if anything) breaks is a good way to determine if anything
will break.
> Which is exactly why you make the Zenity script and run with it for a
> couple months before de-installing Python 2.7.
Assuming someone were afraid that Python2 cannot be 'safely'
deinstalled, the procedure outlined above, with all its vagueness (how
many months are "a couple"?) doesn't provide any such
safety. Ultimatively, one will end up with
1) Keep it forever "just in case".
2) Deinstall it and see what (if anything) breaks.
It's easier just deinstall it right away and avoid the psychological
band-aid.