Is it OK to remove python2 library?

yay tells me:

Fehlende AUR Pakete:   python2-apipkg  python2-atomicwrites  python2-backports  python2-backports.functools_lru_cache  python2-beautifulsoup4  python2-configparser  python2-contextlib2  python2-feedparser  python2-funcsigs  python2-html5lib  python2-importlib-metadata  python2-iniconfig  python2-more-itertools  python2-pathlib2  python2-pluggy  python2-py  python2-pytest  python2-scandir  python2-soupsieve  python2-wcwidth  python2-webencodings  python2-zipp 

This one should show me packages that depend on python2.7 ???

pacman -Qoq /usr/lib/python2.7

Result:

[manjaro john1]# pacman -Qoq /usr/lib/python2.7
cython2
gamin
python2
python2-apipkg
python2-appdirs
python2-apsw
python2-atomicwrites
python2-attrs
python2-backports
python2-backports.functools_lru_cache
python2-beautifulsoup4
python2-configparser
python2-contextlib2
python2-cssselect
python2-dateutil
python2-dnspython
python2-dulwich
python2-feedparser
python2-funcsigs
python2-html5lib
python2-importlib-metadata
python2-iniconfig
python2-iniparse
python2-ipaddress
python2-markdown
python2-mechanize
python2-more-itertools
python2-msgpack
python2-numpy
python2-ordered-set
python2-packaging
python2-pathlib2
python2-pillow
python2-pluggy
python2-psutil
python2-py
python2-pygments
python2-pyparsing
python2-pytest
python2-regex
python2-scandir
python2-setuptools
python2-setuptools-scm
python2-six
python2-soupsieve
python2-wcwidth
python2-webencodings
python2-xlib
python2-yaml
python2-zipp

Or is that the wrong command to find packages that depend on python2.7 ???

Directory size of python2.7 is just 120 MB, nowadays no big deal?!!

But good chance to learn …

Info:

Generated on 2022-04-18 20:28:1650306489

#################### inxi -Fxzc0 ########################

System:
  Kernel: 5.15.32-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 11.2.0 Desktop: Xfce v: 4.16.0
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: LENOVO product: 81RS v: Lenovo Yoga S740-14IIL serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0J40709 WIN serial: <superuser required> UEFI: LENOVO
    v: BYCN39WW date: 05/28/2021
Battery:
  ID-1: BAT0 charge: 62.0 Wh (94.9%) condition: 65.3/62.0 Wh (105.3%) volts: 17.0 min: 15.4
    model: LGC L19L4PD2 status: full
CPU:
  Info: quad core model: Intel Core i7-1065G7 bits: 64 type: MT MCP arch: Ice Lake rev: 5 cache:
    L1: 320 KiB L2: 2 MiB L3: 8 MiB
  Speed (MHz): avg: 1172 high: 1202 min/max: 400/3900 cores: 1: 1200 2: 1201 3: 1200 4: 1190
    5: 1100 6: 1140 7: 1202 8: 1150 bogomips: 23968
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel Iris Plus Graphics G7 vendor: Lenovo driver: i915 v: kernel bus-ID: 00:02.0
  Device-2: NVIDIA GP108M [GeForce MX250] vendor: Lenovo driver: nvidia v: 510.60.02
    bus-ID: 2b:00.0
  Device-3: Chicony Integrated Camera type: USB driver: uvcvideo bus-ID: 3-5:5
  Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: modesetting,nvidia unloaded: nouveau
    gpu: i915 resolution: 1: 1920x1080~60Hz 2: N/A
  Message: Unable to show GL data. Required tool glxinfo missing.
Audio:
  Device-1: Intel Ice Lake-LP Smart Sound Audio vendor: Lenovo driver: sof-audio-pci-intel-icl
    bus-ID: 00:1f.3
  Sound Server-1: ALSA v: k5.15.32-1-MANJARO running: yes
  Sound Server-2: sndio v: N/A running: no
  Sound Server-3: PulseAudio v: 15.0 running: no
  Sound Server-4: PipeWire v: 0.3.49 running: yes
Network:
  Device-1: Intel Ice Lake-LP PCH CNVi WiFi driver: iwlwifi v: kernel bus-ID: 00:14.3
  IF: wlp0s20f3 state: up mac: <filter>
  Device-2: Realtek RTL8153 Gigabit Ethernet Adapter type: USB driver: r8152 bus-ID: 2-1.4:4
  IF: enp0s13f0u1u4 state: up speed: 1000 Mbps duplex: full mac: <filter>
  IF-ID-1: pan1 state: down mac: <filter>
Bluetooth:
  Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 3-10:8
  Report: rfkill ID: hci0 rfk-id: 3 state: up address: see --recommends
Drives:
  Local Storage: total: 1.86 TiB used: 310.99 GiB (16.4%)
  ID-1: /dev/nvme0n1 vendor: Micron model: MTFDHBA1T0TCK size: 953.87 GiB temp: 54.9 C
  ID-2: /dev/sda type: USB vendor: Western Digital model: WD10EARX-00N0YB0 size: 931.51 GiB
  ID-3: /dev/sdb type: USB vendor: Kingston model: DataTraveler 2.0 size: 14.54 GiB
Partition:
  ID-1: / size: 57.9 GiB used: 32.84 GiB (56.7%) fs: ext4 dev: /dev/nvme0n1p8
  ID-2: /boot/efi size: 259.5 MiB used: 113.6 MiB (43.8%) fs: vfat dev: /dev/nvme0n1p1
Swap:
  ID-1: swap-1 type: partition size: 16.67 GiB used: 0 KiB (0.0%) dev: /dev/nvme0n1p9
Sensors:
  System Temperatures: cpu: 45.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 260 Uptime: 11m Memory: 15.2 GiB used: 1.91 GiB (12.6%) Init: systemd Compilers:
  gcc: 11.2.0 clang: 13.0.1 Packages: 1749 Client: Unknown Client: wrapper-2.0 inxi: 3.3.15



I got rid of it here a while ago as I have nothing that depends on it. I use

pactree -r python2

Ok, that shows me ONLY python2 itself!

[manjaro john1]# pactree -r python2
python2
├─cython2
├─python2-apipkg
│ └─python2-py
│   └─python2-pytest
├─python2-appdirs
│ └─python2-setuptools
│   ├─python2-markdown
│   ├─python2-pygments
│   ├─python2-pytest
│   └─python2-setuptools-scm
├─python2-apsw
├─python2-atomicwrites
│ └─python2-pytest
├─python2-attrs
│ └─python2-pytest
├─python2-backports
│ ├─python2-backports.functools_lru_cache
│ │ ├─python2-soupsieve
│ │ │ └─python2-beautifulsoup4
│ │ └─python2-wcwidth
│ │   └─python2-pytest
│ └─python2-configparser
│   └─python2-importlib-metadata
│     ├─python2-pluggy
│     │ └─python2-pytest
│     └─python2-pytest
├─python2-contextlib2
│ ├─python2-importlib-metadata
│ └─python2-zipp
│   └─python2-importlib-metadata
├─python2-cssselect
├─python2-dateutil
├─python2-dnspython
├─python2-dulwich
├─python2-feedparser
├─python2-funcsigs
│ └─python2-pytest
├─python2-iniconfig
│ └─python2-py
├─python2-iniparse
├─python2-ipaddress
├─python2-markdown
├─python2-more-itertools
│ └─python2-pytest
├─python2-msgpack
├─python2-numpy
├─python2-ordered-set
│ └─python2-setuptools
├─python2-pillow
├─python2-psutil
├─python2-pyparsing
│ └─python2-packaging
│   └─python2-setuptools
├─python2-regex
├─python2-scandir
│ └─python2-pathlib2
│   ├─python2-importlib-metadata
│   └─python2-pytest
├─python2-six
│ ├─python2-dateutil
│ ├─python2-html5lib
│ │ └─python2-mechanize
│ ├─python2-more-itertools
│ ├─python2-packaging
│ ├─python2-pathlib2
│ └─python2-xlib
├─python2-wcwidth
├─python2-webencodings
│ └─python2-html5lib
└─python2-yaml

But to avoid any trouble i think i’ll keep python2.7 because i’m not the one who knows how to query using pacman

Then you presumably don’t have any application using python2.

You could always try to remove it, and check the list of packages your package manager also wants to remove.

Ok, i removed 49 python packages with pamac . Saw no application affected … we’ll see …

Thanks for your tipps!

1 Like

How did you remove it from your system? I keep seeing it in my updates list and nothing I have running uses python 2, I have python 3.10 installed as well, but python 2 keeps showing up in trying to update and I have to exclude it. Would just to remove it at this point. Just not entirely sure how to remove it. I am guessing its sudo pacman -R python2? But I am just not too sure.

sudo pacman -Rcns python2
found this online and worked.

5 Likes

Well done :slight_smile: