알뜰살뜰 정보/Raspberry PI

[Raspberry Pi] 라즈베리파이에서 파이썬 삭제하기

쉬고싶은 거북이 2022. 7. 26. 01:26

리눅스에서 파이썬 삭제하기

 

[주의 ] 기존 라즈베리파이 쓰고 있는 3.7버전 삭제 할 경우

python-samba 등 일부 패키지 작동하지 않음으로 특정 버전만 지울것

sudo apt autoremove python3
sudo apt autoremove python

즉 python3으로 지우지말고 버전을 입력해서 지울것

 

 

pi@raspberry:~ $ python -V
Python 3.8.1

pi@raspberry:~ $ python3 -V
-bash: python3: command not found

pi@raspberry:~ $ sudo apt autoremove python
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libwbclient0
The following packages will be REMOVED:
  attr gir1.2-glib-2.0 libaio1 libdbus-glib-1-2 libfile-copy-recursive-perl libgirepository-1.0-1 libgpgme11 libldb1 libpython-all-dev libpython-dev libpython-stdlib libpython2.7 libpython2.7-dev
  libpython2.7-minimal libpython2.7-stdlib libtdb1 libtevent0 python python-all python-all-dev python-cffi-backend python-crypto python-cryptography python-dbus python-dev python-dnspython python-enum34
  python-gi python-idna python-ipaddress python-keyring python-keyrings.alt python-ldb python-minimal python-pip python-pip-whl python-pkg-resources python-pyasn1 python-rpi.gpio python-samba
  python-secretstorage python-setuptools python-six python-talloc python-tdb python-wheel python-xdg python2.7 python2.7-dev python2.7-minimal samba samba-common-bin samba-dsdb-modules samba-libs
  samba-vfs-modules tdb-tools update-inetd
The following packages will be upgraded:
  libwbclient0
1 upgraded, 0 newly installed, 57 to remove and 183 not upgraded.
Need to get 122 kB of archives.
After this operation, 111 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://ftp.kaist.ac.kr/raspbian/raspbian stretch/main armhf libwbclient0 armhf 2:4.5.16+dfsg-1+deb9u4 [122 kB]
Fetched 122 kB in 12s (10.1 kB/s)
(Reading database ... 51164 files and directories currently installed.)
Removing attr (1:2.4.47-2) ...
Removing python-gi (3.22.0-2) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-gi (--remove):
 subprocess installed pre-removal script returned error exit status 1
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 1
Removing samba-vfs-modules (2:4.5.12+dfsg-2+deb9u4) ...
Removing libaio1:armhf (0.3.110-3) ...
Removing python-keyring (10.1-1) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-keyring (--remove):
 subprocess installed pre-removal script returned error exit status 1
Removing samba (2:4.5.12+dfsg-2+deb9u4) ...
Removing update-inetd (4.44) ...
Removing libfile-copy-recursive-perl (0.38-1) ...
Removing samba-dsdb-modules (2:4.5.12+dfsg-2+deb9u4) ...
Removing libgpgme11:armhf (1.8.0-3) ...
Removing samba-common-bin (2:4.5.12+dfsg-2+deb9u4) ...
Removing python-samba (2:4.5.12+dfsg-2+deb9u4) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-samba (--remove):
 subprocess installed pre-removal script returned error exit status 1
Removing python-all-dev (2.7.13-2) ...
Removing libpython-all-dev:armhf (2.7.13-2) ...
Removing python-dev (2.7.13-2) ...
Removing libpython-dev:armhf (2.7.13-2) ...
Removing python-xdg (0.25-4) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-xdg (--remove):
 subprocess installed pre-removal script returned error exit status 1
Removing python-dnspython (1.15.0-1) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-dnspython (--remove):
 subprocess installed pre-removal script returned error exit status 1
Removing python2.7-dev (2.7.13-2+deb9u3) ...
Removing libpython2.7-dev:armhf (2.7.13-2+deb9u3) ...
Removing python-all (2.7.13-2) ...
Removing tdb-tools (1.3.11-2) ...
Removing python-keyrings.alt (1.3-1) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-keyrings.alt (--remove):
 subprocess installed pre-removal script returned error exit status 1
Removing python-pip (9.0.1-2+rpt2) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-pip (--remove):
 subprocess installed pre-removal script returned error exit status 1
Removing python-rpi.gpio (0.6.5~stretch-1) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-rpi.gpio (--remove):
 subprocess installed pre-removal script returned error exit status 1
Removing python-wheel (0.29.0-2) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-wheel (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: python-dbus: dependency problems, but removing anyway as you requested:
 python-keyring depends on python-dbus.
 python-secretstorage depends on python-dbus.

Removing python-dbus (1.2.4-1) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-dbus (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: libdbus-glib-1-2:armhf: dependency problems, but removing anyway as you requested:
 python-dbus depends on libdbus-glib-1-2 (>= 0.78).

Removing libdbus-glib-1-2:armhf (0.108-2) ...
dpkg: libgirepository-1.0-1:armhf: dependency problems, but removing anyway as you requested:
 gir1.2-glib-2.0:armhf depends on libgirepository-1.0-1 (>= 1.45.4).
 python-gi depends on libgirepository-1.0-1 (>= 1.44.0).

Removing libgirepository-1.0-1:armhf (1.50.0-1) ...
dpkg: python-ldb: dependency problems, but removing anyway as you requested:
 python-samba depends on python-ldb (>= 1.1.2~).

Removing python-ldb (2:1.1.27-1) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-ldb (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: samba-libs:armhf: dependency problems, but removing anyway as you requested:
 python-samba depends on samba-libs (= 2:4.5.12+dfsg-2+deb9u4); however:
  Package samba-libs:armhf is to be removed.

Removing samba-libs:armhf (2:4.5.12+dfsg-2+deb9u4) ...
dpkg: libldb1:armhf: dependency problems, but removing anyway as you requested:
 python-ldb depends on libldb1 (= 2:1.1.27-1).
 python-samba depends on libldb1 (>= 0.9.21); however:
  Package libldb1:armhf is to be removed.

Removing libldb1:armhf (2:1.1.27-1) ...
dpkg: python-cryptography: dependency problems, but removing anyway as you requested:
 python-secretstorage depends on python-cryptography; however:
  Package python-cryptography is to be removed.

Removing python-cryptography (1.7.1-3+b2) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-cryptography (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: python-six: dependency problems, but removing anyway as you requested:
 python-cryptography depends on python-six (>= 1.4.1); however:
  Package python-six is to be removed.

Removing python-six (1.10.0-3) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-six (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: python: dependency problems, but removing anyway as you requested:
 python-ldb depends on python (>= 2.7); however:
  Package python is to be removed.
 python-ldb depends on python (<< 2.8); however:
  Package python is to be removed.
 python-ldb depends on python:any (>= 2.6.6-7~); however:
  Package python is to be removed.
 python-ldb depends on python (>= 2.7); however:
  Package python is to be removed.
 python-ldb depends on python (<< 2.8); however:
  Package python is to be removed.
 python-ldb depends on python:any (>= 2.6.6-7~); however:
  Package python is to be removed.
 python-ldb depends on python (>= 2.7); however:
  Package python is to be removed.
 python-ldb depends on python (<< 2.8); however:
  Package python is to be removed.
 python-ldb depends on python:any (>= 2.6.6-7~); however:
  Package python is to be removed.
 python-talloc depends on python (<< 2.8).
 python-talloc depends on python (>= 2.7~).
 python-talloc depends on python:any (<< 2.8).
 python-talloc depends on python:any (>= 2.7~).
 python-talloc depends on python (<< 2.8).
 python-talloc depends on python (>= 2.7~).
 python-talloc depends on python:any (<< 2.8).
 python-talloc depends on python:any (>= 2.7~).
 python-talloc depends on python (<< 2.8).
 python-talloc depends on python (>= 2.7~).
 python-talloc depends on python:any (<< 2.8).
 python-talloc depends on python:any (>= 2.7~).
 python-talloc depends on python (<< 2.8).
 python-talloc depends on python (>= 2.7~).
 python-talloc depends on python:any (<< 2.8).
 python-talloc depends on python:any (>= 2.7~).
 python-rpi.gpio depends on python (<< 2.8).
 python-rpi.gpio depends on python (>= 2.7~).
 python-rpi.gpio depends on python:any (<< 2.8).
 python-rpi.gpio depends on python:any (>= 2.7.5-5~).
 python-rpi.gpio depends on python (<< 2.8).
 python-rpi.gpio depends on python (>= 2.7~).
 python-rpi.gpio depends on python:any (<< 2.8).
 python-rpi.gpio depends on python:any (>= 2.7.5-5~).
 python-rpi.gpio depends on python (<< 2.8).
 python-rpi.gpio depends on python (>= 2.7~).
 python-rpi.gpio depends on python:any (<< 2.8).
 python-rpi.gpio depends on python:any (>= 2.7.5-5~).
 python-rpi.gpio depends on python (<< 2.8).
 python-rpi.gpio depends on python (>= 2.7~).
 python-rpi.gpio depends on python:any (<< 2.8).
 python-rpi.gpio depends on python:any (>= 2.7.5-5~).
 python-xdg depends on python (>= 2.7).
 python-xdg depends on python (<< 2.8).
 python-xdg depends on python (>= 2.7).
 python-xdg depends on python (<< 2.8).
 python-pip depends on python:any (<< 2.8).
 python-pip depends on python:any (>= 2.7.5-5~).
 python-pip depends on python:any (<< 2.8).
 python-pip depends on python:any (>= 2.7.5-5~).
 python-ipaddress depends on python:any (<< 2.8).
 python-ipaddress depends on python:any (>= 2.7.5-5~).
 python-ipaddress depends on python:any (<< 2.8).
 python-ipaddress depends on python:any (>= 2.7.5-5~).
 python-dbus depends on python (<< 2.8).
 python-dbus depends on python (>= 2.7~).
 python-dbus depends on python:any (>= 2.7.5-5~).
 python-dbus depends on python (<< 2.8).
 python-dbus depends on python (>= 2.7~).
 python-dbus depends on python:any (>= 2.7.5-5~).
 python-dbus depends on python (<< 2.8).
 python-dbus depends on python (>= 2.7~).
 python-dbus depends on python:any (>= 2.7.5-5~).
 python-cryptography depends on python (<< 2.8).
 python-cryptography depends on python (>= 2.7~).
 python-cryptography depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-cryptography depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-cryptography depends on python (<< 2.8).
 python-cryptography depends on python (>= 2.7~).
 python-cryptography depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-cryptography depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-cryptography depends on python (<< 2.8).
 python-cryptography depends on python (>= 2.7~).
 python-cryptography depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-cryptography depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-cryptography depends on python (<< 2.8).
 python-cryptography depends on python (>= 2.7~).
 python-cryptography depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-cryptography depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-enum34 depends on python:any (<< 2.8).
 python-enum34 depends on python:any (>= 2.7.5-5~).
 python-enum34 depends on python:any (<< 2.8).
 python-enum34 depends on python:any (>= 2.7.5-5~).
 python-six depends on python:any (<< 2.8).
 python-six depends on python:any (>= 2.7.5-5~).
 python-six depends on python:any (<< 2.8).
 python-six depends on python:any (>= 2.7.5-5~).
 python-gi depends on python (<< 2.8).
 python-gi depends on python (>= 2.7~).
 python-gi depends on python:any (<< 2.8).
 python-gi depends on python:any (>= 2.7.5-5~).
 python-gi depends on python (<< 2.8).
 python-gi depends on python (>= 2.7~).
 python-gi depends on python:any (<< 2.8).
 python-gi depends on python:any (>= 2.7.5-5~).
 python-gi depends on python (<< 2.8).
 python-gi depends on python (>= 2.7~).
 python-gi depends on python:any (<< 2.8).
 python-gi depends on python:any (>= 2.7.5-5~).
 python-gi depends on python (<< 2.8).
 python-gi depends on python (>= 2.7~).
 python-gi depends on python:any (<< 2.8).
 python-gi depends on python:any (>= 2.7.5-5~).
 python-cffi-backend depends on python (<< 2.8).
 python-cffi-backend depends on python (>= 2.7~).
 python-cffi-backend depends on python:any (<< 2.8).
 python-cffi-backend depends on python:any (>= 2.7~).
 python-cffi-backend depends on python (<< 2.8).
 python-cffi-backend depends on python (>= 2.7~).
 python-cffi-backend depends on python:any (<< 2.8).
 python-cffi-backend depends on python:any (>= 2.7~).
 python-cffi-backend depends on python (<< 2.8).
 python-cffi-backend depends on python (>= 2.7~).
 python-cffi-backend depends on python:any (<< 2.8).
 python-cffi-backend depends on python:any (>= 2.7~).
 python-cffi-backend depends on python (<< 2.8).
 python-cffi-backend depends on python (>= 2.7~).
 python-cffi-backend depends on python:any (<< 2.8).
 python-cffi-backend depends on python:any (>= 2.7~).
 python-keyrings.alt depends on python:any (<< 2.8).
 python-keyrings.alt depends on python:any (>= 2.7.5-5~).
 python-keyrings.alt depends on python:any (<< 2.8).
 python-keyrings.alt depends on python:any (>= 2.7.5-5~).
 python-pkg-resources depends on python:any (<< 2.8).
 python-pkg-resources depends on python:any (>= 2.7.5-5~).
 python-pkg-resources depends on python:any (<< 2.8).
 python-pkg-resources depends on python:any (>= 2.7.5-5~).
 python-samba depends on python (<< 2.8); however:
  Package python is to be removed.
 python-samba depends on python (>= 2.7~); however:
  Package python is to be removed.
 python-samba depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-samba depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-samba depends on python (<< 2.8); however:
  Package python is to be removed.
 python-samba depends on python (>= 2.7~); however:
  Package python is to be removed.
 python-samba depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-samba depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-samba depends on python (<< 2.8); however:
  Package python is to be removed.
 python-samba depends on python (>= 2.7~); however:
  Package python is to be removed.
 python-samba depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-samba depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-samba depends on python (<< 2.8); however:
  Package python is to be removed.
 python-samba depends on python (>= 2.7~); however:
  Package python is to be removed.
 python-samba depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-samba depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-wheel depends on python:any (<< 2.8).
 python-wheel depends on python:any (>= 2.7.5-5~).
 python-wheel depends on python:any (<< 2.8).
 python-wheel depends on python:any (>= 2.7.5-5~).
 python-pyasn1 depends on python:any (<< 2.8).
 python-pyasn1 depends on python:any (>= 2.7.5-5~).
 python-pyasn1 depends on python:any (<< 2.8).
 python-pyasn1 depends on python:any (>= 2.7.5-5~).
 python-tdb depends on python (<< 2.8).
 python-tdb depends on python (>= 2.7~).
 python-tdb depends on python:any (<< 2.8).
 python-tdb depends on python:any (>= 2.7.5-5~).
 python-tdb depends on python (<< 2.8).
 python-tdb depends on python (>= 2.7~).
 python-tdb depends on python:any (<< 2.8).
 python-tdb depends on python:any (>= 2.7.5-5~).
 python-tdb depends on python (<< 2.8).
 python-tdb depends on python (>= 2.7~).
 python-tdb depends on python:any (<< 2.8).
 python-tdb depends on python:any (>= 2.7.5-5~).
 python-tdb depends on python (<< 2.8).
 python-tdb depends on python (>= 2.7~).
 python-tdb depends on python:any (<< 2.8).
 python-tdb depends on python:any (>= 2.7.5-5~).
 python-keyring depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-keyring depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-keyring depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-keyring depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-crypto depends on python (<< 2.8).
 python-crypto depends on python (>= 2.7~).
 python-crypto depends on python:any (<< 2.8).
 python-crypto depends on python:any (>= 2.7.5-5~).
 python-crypto depends on python (<< 2.8).
 python-crypto depends on python (>= 2.7~).
 python-crypto depends on python:any (<< 2.8).
 python-crypto depends on python:any (>= 2.7.5-5~).
 python-crypto depends on python (<< 2.8).
 python-crypto depends on python (>= 2.7~).
 python-crypto depends on python:any (<< 2.8).
 python-crypto depends on python:any (>= 2.7.5-5~).
 python-crypto depends on python (<< 2.8).
 python-crypto depends on python (>= 2.7~).
 python-crypto depends on python:any (<< 2.8).
 python-crypto depends on python:any (>= 2.7.5-5~).
 python-setuptools depends on python:any (<< 2.8).
 python-setuptools depends on python:any (>= 2.7.5-5~).
 python-setuptools depends on python:any (<< 2.8).
 python-setuptools depends on python:any (>= 2.7.5-5~).
 python-idna depends on python:any (<< 2.8).
 python-idna depends on python:any (>= 2.7.5-5~).
 python-idna depends on python:any (<< 2.8).
 python-idna depends on python:any (>= 2.7.5-5~).
 python-secretstorage depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-secretstorage depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-secretstorage depends on python:any (<< 2.8); however:
  Package python is to be removed.
 python-secretstorage depends on python:any (>= 2.7.5-5~); however:
  Package python is to be removed.
 python-dnspython depends on python:any (<< 2.8).
 python-dnspython depends on python:any (>= 2.7.5-5~).
 python-dnspython depends on python:any (<< 2.8).
 python-dnspython depends on python:any (>= 2.7.5-5~).

Removing python (2.7.13-2) ...
Removing libpython-stdlib:armhf (2.7.13-2) ...
dpkg: python-tdb: dependency problems, but removing anyway as you requested:
 python-samba depends on python-tdb; however:
  Package python-tdb is to be removed.

Removing python-tdb (1.3.11-2) ...
  File "/usr/bin/pyclean", line 63
    except (IOError, OSError), e:
                             ^
SyntaxError: invalid syntax
dpkg: error processing package python-tdb (--remove):
 subprocess installed pre-removal script returned error exit status 1
dpkg: libpython2.7:armhf: dependency problems, but removing anyway as you requested:
 python-ldb depends on libpython2.7 (>= 2.7); however:
  Package libpython2.7:armhf is to be removed.
 python-talloc depends on libpython2.7 (>= 2.7).
 python-samba depends on libpython2.7 (>= 2.7); however:
  Package libpython2.7:armhf is to be removed.
 python-tdb depends on libpython2.7 (>= 2.7); however:
  Package libpython2.7:armhf is to be removed.

Removing libpython2.7:armhf (2.7.13-2+deb9u3) ...
Removing python2.7 (2.7.13-2+deb9u3) ...
Removing libpython2.7-stdlib:armhf (2.7.13-2+deb9u3) ...
Removing python-minimal (2.7.13-2) ...
dpkg: warning: while removing python-minimal, directory '/usr/share/python/debpython' not empty so not removed
Removing python2.7-minimal (2.7.13-2+deb9u3) ...
Unlinking and removing bytecode for runtime python2.7
Removing libpython2.7-minimal:armhf (2.7.13-2+deb9u3) ...
dpkg: libtdb1:armhf: dependency problems, but removing anyway as you requested:
 python-tdb depends on libtdb1 (= 1.3.11-2).

Removing libtdb1:armhf (1.3.11-2) ...
dpkg: libtevent0:armhf: dependency problems, but removing anyway as you requested:
 python-samba depends on libtevent0 (>= 0.9.16); however:
  Package libtevent0:armhf is to be removed.

Removing libtevent0:armhf (0.9.31-1) ...
dpkg: python-cffi-backend: dependency problems, but removing anyway as you requested:
 python-cryptography depends on python-cffi-backend-api-min (<= 9729); however:
  Package python-cffi-backend-api-min is not installed.
  Package python-cffi-backend which provides python-cffi-backend-api-min is to be removed.
 python-cryptography depends on python-cffi-backend-api-max (>= 9729); however:
  Package python-cffi-backend-api-max is not installed.
  Package python-cffi-backend which provides python-cffi-backend-api-max is to be removed.
 python-cryptography depends on python-cffi-backend-api-min (<= 9729); however:
  Package python-cffi-backend-api-min is not installed.
  Package python-cffi-backend which provides python-cffi-backend-api-min is to be removed.
 python-cryptography depends on python-cffi-backend-api-max (>= 9729); however:
  Package python-cffi-backend-api-max is not installed.
  Package python-cffi-backend which provides python-cffi-backend-api-max is to be removed.

Removing python-cffi-backend (1.9.1-2) ...
dpkg: python-crypto: dependency problems, but removing anyway as you requested:
 python-keyrings.alt depends on python-crypto.
 python-samba depends on python-crypto.

Removing python-crypto (2.6.1-7) ...
dpkg: python-enum34: dependency problems, but removing anyway as you requested:
 python-cryptography depends on python-enum34; however:
  Package python-enum34 is to be removed.

Removing python-enum34 (1.1.6-1) ...
dpkg: python-idna: dependency problems, but removing anyway as you requested:
 python-cryptography depends on python-idna (>= 2.0); however:
  Package python-idna is to be removed.

Removing python-idna (2.2-1) ...
dpkg: python-ipaddress: dependency problems, but removing anyway as you requested:
 python-cryptography depends on python-ipaddress; however:
  Package python-ipaddress is to be removed.

Removing python-ipaddress (1.0.17-1) ...
dpkg: python-pip-whl: dependency problems, but removing anyway as you requested:
 python-pip depends on python-pip-whl (= 9.0.1-2+rpt2).

Removing python-pip-whl (9.0.1-2+rpt2) ...
dpkg: python-setuptools: dependency problems, but removing anyway as you requested:
 python-cryptography depends on python-setuptools (>= 11.3); however:
  Package python-setuptools is to be removed.

Removing python-setuptools (33.1.1-1) ...
Removing python-pkg-resources (33.1.1-1) ...
dpkg: python-pyasn1: dependency problems, but removing anyway as you requested:
 python-cryptography depends on python-pyasn1 (>= 0.1.8); however:
  Package python-pyasn1 is to be removed.

Removing python-pyasn1 (0.1.9-2) ...
dpkg: python-talloc: dependency problems, but removing anyway as you requested:
 python-samba depends on python-talloc (>= 2.1.6); however:
  Package python-talloc is to be removed.

Removing python-talloc (2.1.8-1) ...
dpkg: gir1.2-glib-2.0:armhf: dependency problems, but removing anyway as you requested:
 python-gi depends on gir1.2-glib-2.0 (>= 1.39.0); however:
  Package gir1.2-glib-2.0:armhf is to be removed.

Removing gir1.2-glib-2.0:armhf (1.50.0-1) ...
dpkg: python-secretstorage: dependency problems, but removing anyway as you requested:
 python-keyring depends on python-secretstorage; however:
  Package python-secretstorage is to be removed.

Removing python-secretstorage (2.3.1-2) ...
Errors were encountered while processing:
 python-gi
 python-keyring
 python-samba
 python-xdg
 python-dnspython
 python-keyrings.alt
 python-pip
 python-rpi.gpio
 python-wheel
 python-dbus
 python-ldb
 python-cryptography
 python-six
 python-tdb
E: Sub-process /usr/bin/dpkg returned an error code (1)

pi@raspberry:~ $ python -V
-bash: /usr/bin/python: No such file or directory

bash: /usr/bin/python: No such file or directory : 해당 부분은 reboot로 재시작 해주면 
bash: python: command not found로 바뀜

 

 

 

python3을 python으로 바꿔줄때 사용하는 것

echo "alias python=/usr/local/bin/python3.8" >> ~/.bashrc
echo "alias pip='pip3'" >> ~/.bashrc
source ~/.bashrc

위의 내용은 ~/.bashrc 파일에 alias 뒤의 구문을 추가해주는 내용이다.

source는 bashrc파일을 수정 했으면 작동시켜줘야하니 실행해주는 구문이다.

 

그러니 .bashrc 파일에서 python과 pip 문장 삭제할것