title: Repair python2.7 installation on Ubuntu after manually overwriting elements in /usr/
body: <p>I downloaded the latest ParaView from <a href="https://www.paraview.org/download/" rel="nofollow noreferrer">here</a> and thought it would be clever to integrate the directory structure inside the tar.gz to my /usr/ directory using</p>
  
  <pre><code>sudo tar -xzvf ParaView-5.4.1-Qt5-OpenGL2-MPI-Linux-64bit.tar.gz -C /usr/ --strip-components=1
  </code></pre>
  
  <p>Paraview runs fine, but after todays reboot my guake terminal refused to launch</p>
  
  <pre><code>~&gt; guake
     /usr/bin/python2: No module named guake
  </code></pre>
  
  <p>Obviously, my python installation is completely broken :( I tried reinstalling <code>guake</code>, <code>python-dev</code> and so on, nothing helps. Even running <code>pip</code> fails and points at a problem in the <code>ctypes</code>-module:</p>
  
  <pre><code>~&gt; pip install --upgrade pip
        File "/usr/lib/python2.7/ctypes/__init__.py", line 10, in &lt;module&gt;
          from _ctypes import Union, Structure, Array
      ImportError: /usr/lib/python2.7/_ctypes.so: undefined symbol: 
      PyUnicodeUCS2_FromUnicode
  </code></pre>
  
  <p>Checking the Paraview tar.gz revealed that the ctypes module is really included and untaring overwrote it. <em>I really need some help here!</em></p>
  
  <p>Thanks in advance.</p>
  
  <hr>
  
  <h1>Edit</h1>
  
  <p>Based on the comments of @BoboDarph, I tried to build python from source using the same version and installing to /usr. This is the install script:</p>
  
  <pre><code>!#/bin/bash
  
  sudo apt-get install build-essential checkinstall
  sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
  
  version=2.7.11
  wget https://www.python.org/ftp/python/$version/Python-$version.tgz
  
  tar -xvf Python-$version.tgz
  cd Python-$version
  
  ./configure --prefix=/usr
  make profile-opt
  sudo checkinstall
  </code></pre>
  
  <p>Since checkinstall failed to install the resulting package because files of existing packages would have been overwritten, I forced the install using</p>
  
  <pre><code>sudo dpkg --force-overwrite --install python_2.7.11-1_amd64.deb
  </code></pre>
  
  <p><code>pip</code> is now working again, but guake did not work even after reinstalling. It now seems things are really broken and I can't figure out how to fix. E.g. running</p>
  
  <pre><code>sudo aptitude reinstall python-dev
  </code></pre>
  
  <p>now suggest to remove almost all package of the system to resolve conflicts, see <a href="https://pastebin.com/CiaRSCq2" rel="nofollow noreferrer">pastebin</a>.</p>
  
  <p><strong>Any help to rescue my system is highly appreciated!</strong></p>