0

During an upgrade of my archlinux system. I saw that python 2.7 is still installed. I think that it's time to delete it and move on from this version of python.

That's why I'm looking for a way to list all the packages of my system which use python 2-x. And check if I can replace them. In order to simply delete python2. Is it possible ? If yes, is it a good idea ?

Thanks

1

1 Answer 1

0

If you have the pacman-contrib package installed, you can use the pactree command to get the tree of dependencies for a package. In this case you don't want all the packages it depends on, but rather all the packages that depend on it, so you can use the -r or --reverse flag, along with the package name, in this case python2 most likely:

pactree -r python2

I don't have python2 installed myself right now so I'll show an example for another package:

$ pactree -r mpg123
mpg123
├─libopenmpt
│ └─mpd
├─mp3gain
├─mpd
└─normalize

Whether or not it's a good idea to uninstall it depends of course on what this reveals when you run it on python2. Since Arch recently "purged" everything that depends on python2 from its official repos, there's certainly a chance that there's nothing crucial you have installed that still requires it. However, there are many projects that do still use python2 this many years later, and a lot of them are available in the AUR, and it's certainly possibly you rely on those.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .