3

I installed terminator and it was working very well, but suddenly It stopped working.

When I add terminator repository, I got this error:

Command:

sudo add-apt-repository ppa:gnome-terminator/ppa

Error:

E: The repository 'http://ppa.launchpad.net/gnome-terminator/ppa/ubuntu bionic Release' does not have a Release file.

and When I ran terminator command in the terminal, I got this error:

File "/usr/bin/terminator", line 123
   except (KeyError,ValueError), ex:
                                ^
SyntaxError: invalid syntax
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 24, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
  File "/usr/bin/terminator", line 123
    except (KeyError,ValueError), ex:
                                ^
SyntaxError: invalid syntax

I use python3.7 and Ubuntu18.04

References:


Update

Software and Update:

Here is my software and update the latest status:

enter image description here

Python path:

ubuntu@ubuntu-Z97-D3H:~$ which python3;
/usr/bin/python3
ubuntu@ubuntu-Z97-D3H:~$ which python
/usr/bin/python
ubuntu@ubuntu-Z97-D3H:~$  ls -al $(which python python3)
lrwxrwxrwx 1 root root 24 Dec  9 08:46 /usr/bin/python -> /etc/alternatives/python
lrwxrwxrwx 1 root root  9 Oct 25  2018 /usr/bin/python3 -> python3.6
ubuntu@ubuntu-Z97-D3H:~$  dpkg -l | grep python | grep apt
ii  python-apt-common                          1.6.4                                           all          Python interface to libapt-pkg (locales)
ii  python3-apt                                1.6.4                                           amd64        Python 3 interface to libapt-pkg
ii  python3-aptdaemon                          1.1.1+bzr982-0ubuntu19.1                        all          Python 3 module for the server and client of aptdaemon
ii  python3-aptdaemon.gtk3widgets              1.1.1+bzr982-0ubuntu19.1                        all          Python 3 GTK+ 3 widgets to run an aptdaemon client
ubuntu@ubuntu-Z97-D3H:~$ 

Phoenix
  • 167
  • 5
  • 12
  • 5
    That PPA doesn't support any releases later than xenial (16.04), thus the *no release file* error message. Terminator exists in Ubuntu repositories, so why was it added? PPA's are 3rd party sources for software, with security and validation on you. – guiverc Dec 10 '19 at 07:37
  • Thanks your response. So I remove that dependencies and I reinstall terminator. how can I get rid of python error messages? – Phoenix Dec 10 '19 at 07:47
  • Did you uninstall Pythonv2? – xenoid Dec 10 '19 at 08:04
  • In my case, I fixed the problem with uninstalling ``python3`` and ``python2`` and manage whole stuff with venv – Phoenix Jan 16 '20 at 10:50
  • yes, use new maintained repo: sudo add-apt-repository ppa:mattrose/terminator – secretAgent Mar 01 '21 at 18:30

3 Answers3

2

You should not use PPA to get Terminator installed. You have to remove the problematic PPA with

sudo add-apt-repository -r ppa:gnome-terminator/ppa

and then install the Terminator from universe pocket.

All you need is to enable this pocket and install package from it:

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install terminator

And then use it as was planned:

$ terminator -v
terminator 1.91
N0rbert
  • 97,162
  • 34
  • 239
  • 423
  • thanks for your response, but that does not work for me. I ran the first command and I got this error: ``The team named '~gnome-terminator' has no PPA named 'ubuntu/ppa'`` – Phoenix Dec 11 '19 at 04:46
  • It seems to be expected, as you really did not add this PPA to the system, so it can't be removed. Then you can proceed with next part of my answer. – N0rbert Dec 11 '19 at 06:10
  • I tried other parts of your answer, but nothing changed. It threw ``No module named 'apt_pkg'`` – Phoenix Dec 11 '19 at 06:27
  • Then try to reinstall these python modules with `sudo apt-get install --reinstall python3-apt` and then retry – N0rbert Dec 11 '19 at 07:04
  • Even I tried that, but not thing changed – Phoenix Dec 11 '19 at 07:05
  • Please add output of `which python3; which python; which python2; ls -al $(which python python3 python2)` and `dpkg -l | grep python | grep apt` to the question body. – N0rbert Dec 11 '19 at 07:08
  • I updated the question due to satisfy your requirements. – Phoenix Dec 11 '19 at 07:12
  • @MohammadMasoumi, did it really solve your problem? I have the same issue. – Kira Feb 11 '20 at 16:13
  • @Kira No, I just uninstall ``python3`` and then try to install ``terminator`` – Phoenix Feb 12 '20 at 03:16
  • This can work, but if you want to keep `python3` in your system, consider my answer below. – Kira Feb 13 '20 at 11:13
1

You can now use the instructions provided on this page after the project moved to GitHub:

https://github.com/gnome-terminator/terminator/blob/master/INSTALL.md#source-install

secretAgent
  • 139
  • 6
Roel Van de Paar
  • 676
  • 7
  • 21
0

The syntax error is due to the fact that /usr/bin/terminator is invoking python, rather than explicitly invoking python2, and in your environment python points to python3.

An easy fix is to make terminator call python2, as it should:

sudo sed '1s.!/usr/bin/python.!/usr/bin/python2.' /usr/bin/terminator
Kira
  • 139
  • 4