0

I committed a big mistake. I issued the following command on my terminal

sudo apt-get purge python

I didn't read what it removed :(

I use LaTeX typesetting system and some of it's packages are not working now. I've asked my question here.

If I've lost the python files, is it needed to reinstall the full OS or something else might help me out of this?


Log -

Start-Date: 2019-08-17  13:55:17
Commandline: apt-get purge python
Requested-By: ubuntu (1000)
Purge: python-webencodings:amd64 (0.5-2), python-six:amd64 (1.11.0-2), python-matplotlib:amd64 (2.1.1-2ubuntu3), vprerex:amd64 (1:6.5.1-1), python-cycler:amd64 (0.10.0-1), feynmf:amd64 (1.08-10), fragmaster:amd64 (1.7-5), python-xdg:amd64 (0.25-4ubuntu1), python-gi:amd64 (3.26.1-2ubuntu1), latex-cjk-all:amd64 (4.8.4+git20170127-2), python-tk:amd64 (2.7.16-2~18.04.york0), python-tz:amd64 (2018.3-2), python-dbus:amd64 (1.2.6-1), python-chardet:amd64 (3.0.4-1), texlive-pictures:amd64 (2017.20180305-1), python-pyparsing:amd64 (2.2.0+dfsg1-2), python-subprocess32:amd64 (3.2.7-3), python:amd64 (2.7.16-1~18.04.york0), python-lxml:amd64 (4.2.1-1ubuntu0.1), python-enum34:amd64 (1.1.6-2), texlive-xetex:amd64 (2017.20180305-1), qbittorrent:amd64 (4.0.3-1), lyx:amd64 (2.2.4-0ubuntu0.18.04.1), texlive-latex-extra:amd64 (2017.20180305-2), python-cryptography:amd64 (2.1.4-1ubuntu1.3), python-crypto:amd64 (2.6.1-8ubuntu2), texlive-music:amd64 (2017.20180305-2), python-keyrings.alt:amd64 (3.0-1), python-cffi-backend:amd64 (1.11.5-1), python-ipaddress:amd64 (1.0.17-1), python-olefile:amd64 (0.45.1-1), prerex:amd64 (6.5.4-1), texlive-lang-other:amd64 (2017.20180305-1), texlive-full:amd64 (2017.20180305-1), python-scour:amd64 (0.36-2), python-pkg-resources:amd64 (39.0.1-2), python-html5lib:amd64 (0.999999999-1), python-all:amd64 (2.7.16-1~18.04.york0), inkscape:amd64 (0.92.3-1), python-bs4:amd64 (4.6.0-1), texlive-pstricks:amd64 (2017.20180305-2), python-secretstorage:amd64 (2.3.1-2), python-dev:amd64 (2.7.16-1~18.04.york0), python-setuptools:amd64 (39.0.1-2), python-keyring:amd64 (10.6.0-1), lyx-common:amd64 (2.2.4-0ubuntu0.18.04.1), texlive-formats-extra:amd64 (2017.20180305-2), python-idna:amd64 (2.6-1), python-wheel:amd64 (0.30.0-0.2), texlive-science:amd64 (2017.20180305-2), asymptote:amd64 (2.41-4), python-dateutil:amd64 (2.6.1-1), latex-cjk-thai:amd64 (4.8.4+git20170127-2), python-numpy:amd64 (1:1.13.3-2ubuntu1), texlive-extra-utils:amd64 (2017.20180305-2), python-pil:amd64 (5.1.0-1), python-pip:amd64 (9.0.1-2.3~ubuntu1.18.04.1), python-asn1crypto:amd64 (0.24.0-1), python-backports.functools-lru-cache:amd64 (1.4-2), python-all-dev:amd64 (2.7.16-1~18.04.york0)
End-Date: 2019-08-17  13:59:03
3
  • 1
    You didn't tell us what release of Ubuntu you are using; the effect is less on later release of Ubuntu (as they rely more on python3), however you can read in /var/log/apt/ what else was removed (and should be re-installed). You may find some package tools no longer work, so you may need to re-install using dpkg instead of higher-level apt tools
    – guiverc
    Aug 24, 2019 at 5:32
  • @guiverc sorry I didn't mention it. I'm using ubuntu 16.04
    – Niranjan
    Aug 24, 2019 at 5:50
  • I've added the log that I found in the answer. Is there any way to undo all of these these unistallations in one command?
    – Niranjan
    Aug 24, 2019 at 5:54

1 Answer 1

1

I copied your list and compared it with the programms I have installed (Ubuntu 19.04). Then I removed every package that was makred "automatically" at my system. They will be installed on your system, too but marked as "automatically" too.

sudo apt install asymptote feynmf fragmaster inkscape latex-cjk-all latex-cjk-thai lyx lyx-common prerex python-all python python-bs4 python-chardet python-crypto python-cycler python-dbus python-gi python-html5lib python-idna python-keyring python-lxml python-matplotlib python-pil python-pkg-resources python-pyparsing python-secretstorage python-six python-subprocess32 python-tz python-xdg qbittorrent texlive-extra-utils texlive-formats-extra texlive-full texlive-lang-other texlive-music texlive-pstricks texlive-science texlive-xetex vprerex

That are all the programms you have to install. The "automatically" marked programms will follow. If you want to verify if the rest is installed you may run

apt list python-all-dev python-asn1crypto python-backports.functools-lru-cache python-cffi-backend python-cryptography python-dateutil python-dev python-enum34 python-ipaddress python-keyrings.alt python-numpy python-olefile python-pip python-scour python-setuptools python-tk python-webencodings python-wheel texlive-latex-extra texlive-pictures

and check if the rest was installed. If not, install each of the missing as "manually".

5
  • Thank you so much for your solution. I tried what you mentioned here, everything is installed as of now, but still my TeX programme is not working perfectly, why do you think this is so?
    – Niranjan
    Aug 25, 2019 at 4:20
  • Do you have texlive-latex-recommended istalled? You can check it by usinge apt list texlive-latex-recommended.
    – Boba Fit
    Aug 25, 2019 at 8:53
  • Yes, I have it installed.
    – Niranjan
    Aug 25, 2019 at 9:11
  • Try sudo apt install --install-suggests --reinstall texlive to reinstall texlive and all the suggested libarys again
    – Boba Fit
    Aug 25, 2019 at 9:18
  • Thanks, it worked!
    – Niranjan
    Aug 26, 2019 at 15:37

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