[SOLVED] Can't Revert to Repository Version of Python3
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I manually installed Python version 3.12.0 (the version that installed by default is 3.10.6), but it turns out I now need to manually install/update all plugins in addition to the main Python version. Preferring to let apt do that work, I tried to downgrade Python3 back to the repository version, but it says that it's still on version 3.10.6, even though when I actually run "python3" it says "3.12.0".
Code:
flexico@flexico-laptop-5590 ~ $ sudo apt install python3=3.10.6-1~22.04
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3 is already the newest version (3.10.6-1~22.04).
0 upgraded, 0 newly installed, 0 to remove and 11 not upgraded.
flexico@flexico-laptop-5590 ~ $ python3
Python 3.12.0 (main, Oct 24 2023, 11:47:45) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
Apparently you installed it not as a deb package but as a bunch of files, so naturally apt which works with metadata provided by packages, not with actaual files, knows nothing about it. Try apt-get reinstall.
flexico@flexico-laptop-5590 ~ $ sudo apt-get reinstall python3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 11 not upgraded.
Need to get 0 B/22.8 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 764194 files and directories currently installed.)
Preparing to unpack .../python3_3.10.6-1~22.04_amd64.deb ...
running python pre-rtupdate hooks for python3.10...
Unpacking python3 (3.10.6-1~22.04) over (3.10.6-1~22.04) ...
Setting up python3 (3.10.6-1~22.04) ...
running python rtupdate hooks for python3.10...
running python post-rtupdate hooks for python3.10...
Processing triggers for man-db (2.10.2-1) ...
flexico@flexico-laptop-5590 ~ $ python3 --version
Python 3.12.0
So maybe now you have two versions installed? To see a list of files installed from a package use 'dpkg-query -L python3', but only you know where you installed the newer version, although 'which python3' will point you in the right direction.
Aha! "python3" pointed to "/usr/local/bin/python3" which was 3.12.0; I deleted those files and it reset back to "/user/bin/python3" (3.10.12). Thanks for the help!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.