This is the error I get when I try to install any thing using apt or apt-get.

/usr/bin/apt: 1: /usr/bin/apt: Syntax error: "(" unexpected

what does it mean by Syntax error?. Which file should I see to correct this?.

I tried to see the version of apt by command

dpkg -l | grep apt | head -n 1

Output :

 iU  apt:amd64  1.2.29  amd64 commandline package manager

If I try to execute any of these binary by ./apt

bash: ./apt: cannot execute binary file: Exec format error

Getting Some error like this

srushti@srushti-X556UQK:/$ sudo apt-get install --reinstall apt

/usr/bin/apt-get: 1: /usr/bin/apt-get: ELF: not found
/usr/bin/apt-get: 1: /usr/bin/apt-get: @8�@8: not found
/usr/bin/apt-get: 2: /usr/bin/apt-get: ����: not found
/usr/bin/apt-get: 3: /usr/bin/apt-get: : not found
/usr/bin/apt-get: 3: /usr/bin/apt-get: cannot open ½���������hI��p�: No such file
rm�: not foundet: 3: /usr/bin/apt-get: c
    /usr/bin/apt-get: 4: /usr/bin/apt-get: �7��: not found
�F�'�: /usr/bin/apt-get: 
n\����          \
Y[#��   �d��=
           �: not found
/usr/bin/apt-get: 6: /usr/bin/apt-get: �C��+: not found
/usr/bin/apt-get: 16: /usr/bin/apt-get: Syntax error: "(" unexpected
  • try sudo apt-get install --reinstall apt and you can use apt-get to update or whatever you need to install until you get apt working – Joshua Besneatte Dec 8 '18 at 6:41
  • Getting the same errors – Srushti Mehatkar Dec 8 '18 at 7:09
  • 2
    I suspect your question would be easier to read if you provided commands & responses. eg. why would apt be in your $PWD (current directory; ie. ./apt runs apt in your current directory). If you check file-type file /usr/bin/apt what do you get? and have you made changes to python by chance? – guiverc Dec 8 '18 at 7:11

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.