How to find and delete packages still using python2?
I was updating my system, and yay tried (and failed) to upgrade the latest version of python2. That's when I saw in the home page news that it is no longer supported anyway. I have python3 for most things so I can just uninstall python2 from the aur with yay (right?). But how can I find out if I have any older packages that still run python2, so I can remove them as well?
About this post
- Posted
- Archived
- Score
- 100 · 96% up
- Kind
- Text
- ID
- xpvc19
25 comments
pacman -Qi python2
will show "required by"
You can also do:
pactree -r python2Note that
pactreeis in thepacman-contribrepository these days.Yep this is what I did. Realized I needed none of them so followed with
pacman -Rnsc python2this is my favorite way
Great. I missed that one when speed-reading the pacman wiki page. That should do it. Thank you. And just to confirm, removing python2 is just a straightforward yay -R python2 command, yes?
pacman -Rcs python2will also remove packages that depend onpython2; carefully reviewing what will be removed is recommended. Will probably also work usingyay.I don't use yay, but probably yes
I get a "bash: pactree: command not found" any idea why?
Quoting u/Sigma-Alpha_2 :
So you need to install it first.
pacman -Rscn python2
Thanks for that one. Big help.
In addition to the other recommendations, consider using
pactreefrom the packagepacman-contrib.Thank you, I'll check that one out.
As everyone else already mentioned
pacman -Qi, I'll give a different answer. I really like using pacfinder for this kind of stuff.It's important to be familiar with pacman arguments, and I am for the most part, but I think pacfinder is a lot easier to read. It also provides a description and a link to the source in case you aren't sure what a specific package does.
Good to know this one - thanks.
Comments on the python2 AUR shows a yay command that should let it update (mine failed as well, waiting to see if it works). But also good to move away from it, it's depreciated for a reason.
I saw the python update fail, noted the version change use really small, and simply ignored it a few days.
Upon seeing this, I discovered my only important dependency was FAHcontrol, for which there's a python3 fork also available. Fixed.
Nice! Definitely if you can do without it then do without it.
Deleted before we saved it.
I got the same error and it also took a long time to finally finish building, but after that I just
yay -Rcns python2.And that was the end of that. No more python2 on my system! Yay!
pacman -Q | grep python2 | cut -d" " -f1