:: Re: [DNG] assistance sought to repa…
Top Page
Delete this message
Reply to this message
Author: Bob Proulx
Date:  
To: dng
Subject: Re: [DNG] assistance sought to repair install - - re:python
Antony Stone wrote:
> o1bigtenor wrote:
> > I was trying to clean up my /usr/bin directory so was discarding older
> > versions of software.
>
> You should never manually delete binaries or library files which have been
> installed by a package management system. If you want to get rid of them use
> something like "aptitude purge python3.9" so that:


Agreed. If it is in /usr/bin:/bin then leave it to the package
management tools. /usr/local/bin is available for local admin hacking
if that is desired.

> > Had python3.10 available so thought (foolishly - - now clear) that
> > python3.9 was a great candidate for discard.
> > Nope nix and no way.
> >
> > Now I have myself more than a bit of a mess with my installed python
> > systems.
> >
> > Suggestions as to how to repair my 'mess'?
>
> Have you tried simply "aptitude install python3.9" or possibly "aptitude
> reinstall python3.9" etc (for each of the versions of python which you seem to
> be having problems with)?


I would "install --reinstall" the list of things that were manually
removed. That should install the /usr/bin components again. For
example here is one command.

    apt-get install --reinstall python3.9 python3.9-minimal


I am pretty sure that would work. But for python2.7 I think the
better option might be to purge it from the package manager database.
Because python2 has been deprecated and has been removed from later
releases and is no longer available. Therefore when you try a
reinstall it will likely fail due to not being available. But go
ahead and see if it works.

    apt-get install --reinstall python2.7 python2.7-minimal


But if that fails as I expect then I would try to purge it.

    apt-get purge python2.7-minimal


Be careful with that purge action! Look carefully at any dependencies
it is going to purge along with it. If it is purging things you don't
want purged then say No and don't do it.

In the case that a manual remove of the binary created a problem then
a manual restoration of the binary would fix the problem. Either
restore the /usr/bin/python2.7 from backup or copy it from another
system. Since it is the same across all of the Devuan systems of the
same release and version level it means that if you don't have a local
backup that you could copy it from another system. Maybe from a local
friend's system? That would restore what was removed and things would
return to normal operation.

> > (Following is what the apt update upgrade process barfs up.
> > Errors were encountered while processing:
> > python2.7-minimal
> > python3.9-minimal
> > python3.9
> > python2.7
> > python3.9-dev


For each of those you could look to see if they are available using
apt-cache to query it for information about installed and available
versions.

    apt-cache policy python2.7-minimal
    apt-cache policy python3.9-minimal
    ... and so on ...


Good luck!
Bob