Skip to content

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?

100 points25 comments
Open on Reddit
About this post
Posted
Archived
Score
100 · 96% up
Kind
Text
ID
xpvc19

Author

7
posts
96
comments
0
media
View profile

25 comments

pacman -Qi python2

will show "required by"

72 points

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?

13 points

pacman -Rcs python2 will also remove packages that depend on python2; carefully reviewing what will be removed is recommended. Will probably also work using yay.

30 points

In addition to the other recommendations, consider using pactree from the package pacman-contrib.

pactree -r python2
10 points

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.

2 points

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.

1 points

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.

2 points

Nice! Definitely if you can do without it then do without it.

1 points
unknown author

Deleted before we saved it.

1 points

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!

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.