Я не могу установить что-либо в Ubuntu 16.04 “шоу Alwas та же ошибка”

когда я выполняю эту команду:

sudo apt-get autoremove

соответствующий вывод покажет:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up dput (0.9.6.4ubuntu3) ...
*** Error compiling '/usr/share/dput/ftp.py'...
  File "/usr/share/dput/ftp.py", line 9
    print "D: FTP-Connection to host: %s" % fqdn
                                        ^
SyntaxError: Missing parentheses in call to 'print'

*** Error compiling '/usr/share/dput/helper/dputhelper.py'...
  File "/usr/share/dput/helper/dputhelper.py", line 12
    print "Error: Failed to execute '"+file+"'."
                                     ^
SyntaxError: Missing parentheses in call to 'print'

*** Error compiling '/usr/share/dput/http.py'...
  File "/usr/share/dput/http.py", line 55
    except ValueError, e:
                     ^
SyntaxError: invalid syntax

*** Error compiling '/usr/share/dput/https.py'...
  File "/usr/share/dput/https.py", line 3
    exec open("/usr/share/dput/http.py") in d
            ^
SyntaxError: invalid syntax

*** Error compiling '/usr/share/dput/local.py'...
  File "/usr/share/dput/local.py", line 20
    print "D: Uploading with cp to %s" % (incoming)
                                     ^
SyntaxError: invalid syntax

*** Error compiling '/usr/share/dput/rsync.py'...
  File "/usr/share/dput/rsync.py", line 25
    print "D: Uploading with rsync to %s%s:%s" % \
                                             ^
SyntaxError: Missing parentheses in call to 'print'

*** Error compiling '/usr/share/dput/scp.py'...
  File "/usr/share/dput/scp.py", line 29
    if not stat.S_IMODE(os.lstat(file)[stat.ST_MODE])==0644:
                                                          ^
SyntaxError: invalid token

*** Error compiling '/usr/share/dput/sftp.py'...
  File "/usr/share/dput/sftp.py", line 13
    except Exception, e:
                    ^
SyntaxError: invalid syntax

dpkg: error processing package dput (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 dput
E: Sub-process /usr/bin/dpkg returned an error code (1)

Я также пытаюсь выполнить ответ "Neil" от:

Ошибки зависимости после установки и попытки удалить Google Chrome

Вывод был:

    ashraful@ashraful-Vostro-3458:~$ sudo rm /etc/apt/sources.list
    ashraful@ashraful-Vostro-3458:~$ sudo software-properties-gtk
    /usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py:40: PyGIWarning: Gdk was imported without specifying a version first. Use gi.require_version('Gdk', '3.0') before import to ensure that the right version gets loaded.
      from gi.repository import GObject, Gdk, Gtk, Gio, GLib
    /usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py:40: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
      from gi.repository import GObject, Gdk, Gtk, Gio, GLib
    WARNING:root:could not open file '/etc/apt/sources.list'

    WARNING:root:could not open file '/etc/apt/sources.list'

    Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
    ashraful@ashraful-Vostro-3458:~$ sudo apt-get remove --purge google-chrome-stable
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package google-chrome-stable
    ashraful@ashraful-Vostro-3458:~$ sudo apt-get update
    Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
    Hit:2 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu xenial InRelease
    Reading package lists... Done                     
    ashraful@ashraful-Vostro-3458:~$ sudo apt-get dist-upgrade -y
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Calculating upgrade... Done
    The following packages were automatically installed and are no longer required:
      libdb5.3:i386 libgcrypt20:i386 libsystemd0:i386
    Use 'sudo apt autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Setting up dput (0.9.6.4ubuntu3) ...
    *** Error compiling '/usr/share/dput/ftp.py'...
      File "/usr/share/dput/ftp.py", line 9
        print "D: FTP-Connection to host: %s" % fqdn
                                            ^
    SyntaxError: Missing parentheses in call to 'print'

    *** Error compiling '/usr/share/dput/helper/dputhelper.py'...
      File "/usr/share/dput/helper/dputhelper.py", line 12
        print "Error: Failed to execute '"+file+"'."
                                         ^
    SyntaxError: Missing parentheses in call to 'print'

    *** Error compiling '/usr/share/dput/http.py'...
      File "/usr/share/dput/http.py", line 55
        except ValueError, e:
                         ^
    SyntaxError: invalid syntax

    *** Error compiling '/usr/share/dput/https.py'...
      File "/usr/share/dput/https.py", line 3
        exec open("/usr/share/dput/http.py") in d
                ^
    SyntaxError: invalid syntax

    *** Error compiling '/usr/share/dput/local.py'...
      File "/usr/share/dput/local.py", line 20
        print "D: Uploading with cp to %s" % (incoming)
                                         ^
    SyntaxError: invalid syntax

    *** Error compiling '/usr/share/dput/rsync.py'...
      File "/usr/share/dput/rsync.py", line 25
        print "D: Uploading with rsync to %s%s:%s" % \
                                                 ^
    SyntaxError: Missing parentheses in call to 'print'

    *** Error compiling '/usr/share/dput/scp.py'...
      File "/usr/share/dput/scp.py", line 29
        if not stat.S_IMODE(os.lstat(file)[stat.ST_MODE])==0644:
                                                              ^
    SyntaxError: invalid token

    *** Error compiling '/usr/share/dput/sftp.py'...
      File "/usr/share/dput/sftp.py", line 13
        except Exception, e:
                        ^
    SyntaxError: invalid syntax

    dpkg: error processing package dput (--configure):
     subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
     dput
    E: Sub-process /usr/bin/dpkg returned an error code (1)

Я пытался чистить способное использование

sudo apt-get clean

Я также попробовал

ashraful@ashraful-Vostro-3458:~$ sudo apt-get -f install
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  1 not fully installed or removed.
  After this operation, 0 B of additional disk space will be used.
  Setting up dput (0.9.6.4ubuntu3) ...
  *** Error compiling '/usr/share/dput/ftp.py'...
    File "/usr/share/dput/ftp.py", line 9
      print "D: FTP-Connection to host: %s" % fqdn
                                          ^
  SyntaxError: Missing parentheses in call to 'print'

  *** Error compiling '/usr/share/dput/helper/dputhelper.py'...
    File "/usr/share/dput/helper/dputhelper.py", line 12
      print "Error: Failed to execute '"+file+"'."
                                       ^
  SyntaxError: Missing parentheses in call to 'print'

  *** Error compiling '/usr/share/dput/http.py'...
    File "/usr/share/dput/http.py", line 55
      except ValueError, e:
                       ^
  SyntaxError: invalid syntax

  *** Error compiling '/usr/share/dput/https.py'...
    File "/usr/share/dput/https.py", line 3
      exec open("/usr/share/dput/http.py") in d
              ^
  SyntaxError: invalid syntax

  *** Error compiling '/usr/share/dput/local.py'...
    File "/usr/share/dput/local.py", line 20
      print "D: Uploading with cp to %s" % (incoming)
                                       ^
  SyntaxError: invalid syntax

  *** Error compiling '/usr/share/dput/rsync.py'...
    File "/usr/share/dput/rsync.py", line 25
      print "D: Uploading with rsync to %s%s:%s" % \
                                               ^
  SyntaxError: Missing parentheses in call to 'print'

  *** Error compiling '/usr/share/dput/scp.py'...
    File "/usr/share/dput/scp.py", line 29
      if not stat.S_IMODE(os.lstat(file)[stat.ST_MODE])==0644:
                                                            ^
  SyntaxError: invalid token

  *** Error compiling '/usr/share/dput/sftp.py'...
    File "/usr/share/dput/sftp.py", line 13
      except Exception, e:
                      ^
  SyntaxError: invalid syntax

  dpkg: error processing package dput (--configure):
   subprocess installed post-installation script returned error exit status 1
  Errors were encountered while processing:
   dput
  E: Sub-process /usr/bin/dpkg returned an error code (1)
  ashraful@ashraful-Vostro-3458:~$

Пожалуйста, помогите мне. как я могу установить что-нибудь в своей Ubuntu 16.04

1
задан 26 January 2019 в 04:39

1 ответ

Кажется, что Вы, должно быть, установили python3 в какой-то момент. Python не назад совместим, таким образом, сценарий, записанный для python2, не будет работать с python3.

Сначала сделайте "Python - версия" и удостоверьтесь дело обстоит так. Возможности, Вы получите что-то вроде этого, что показывает python3.x

desktop:~$ python --version
Python 3.5.2

Также удостоверьтесь, что у Вас все еще есть python2:

desktop:~$ python2 --version
Python 2.7.12

Для фиксации этого, я должен был сделать новую символьную ссылку для/usr/bin/python, указывающего на python2 вместо этого.

sudo ln -sf /usr/bin/python2 /usr/bin/python

Удостоверьтесь, что это работало, просто сделайте 'Python - версия' снова и удостоверьтесь, что это 2.x

1
ответ дан 7 December 2019 в 15:08

Другие вопросы по тегам:

Похожие вопросы: