I'm using Ubuntu 16.04.03. I was installing the updates as and when Ubuntu prompts me to. A week back, for some unknown reason "linux-image-4.13.0-37-generic" failed to install.
After that I'm not able to install any of the packages from "Ubuntu Software center" or from terminal using "dpkg -i PACKAGE-NAME". I'm getting the below syntax error. /var/lib/dpkg/tmp.ci/preinst: Syntax error: "(" unexpected
I gave a try to commands like
sudo apt-get autoremove
sudo apt-get -f install
sudo update-grub
sudo apt-get --force-yes remove linux-image-4.13.0-37-generic (this of course didn't work because the image is not installed yet.)
sudo apt-get clean; sudo apt-get autoclean
Below is the full error
desktop:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
linux-image-4.13.0-37-generic
Suggested packages:
fdutils linux-tools
The following packages will be upgraded:
linux-image-4.13.0-37-generic
1 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
8 not fully installed or removed.
Need to get 0 B/20.9 MB of archives.
After this operation, 72.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
/usr/sbin/dpkg-preconfigure: 6: /usr/sbin/dpkg-preconfigure: BEGIN: not found
/usr/sbin/dpkg-preconfigure: 1: eval: qq{: not found
/usr/sbin/dpkg-preconfigure: 8: /usr/sbin/dpkg-preconfigure: use: not found
/usr/sbin/dpkg-preconfigure: 9: /usr/sbin/dpkg-preconfigure: use: not found
/usr/sbin/dpkg-preconfigure: 10: /usr/sbin/dpkg-preconfigure: Syntax error: "(" unexpected
(Reading database ... 244264 files and directories currently installed.)
Preparing to unpack .../linux-image-4.13.0-37-generic_4.13.0-37.42~16.04.1_amd64.deb ...
/var/lib/dpkg/tmp.ci/preinst: 20: /var/lib/dpkg/tmp.ci/preinst: Syntax error: "(" unexpected
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.13.0-37-generic_4.13.0-37.42~16.04.1_amd64.deb (--unpack):
subprocess new pre-installation script returned error exit status 2
/var/lib/dpkg/tmp.ci/postrm: 21: /var/lib/dpkg/tmp.ci/postrm: use: not found
/var/lib/dpkg/tmp.ci/postrm: 23: /var/lib/dpkg/tmp.ci/postrm: =1: not found
/var/lib/dpkg/tmp.ci/postrm: 23: /var/lib/dpkg/tmp.ci/postrm: $: not found
/var/lib/dpkg/tmp.ci/postrm: 26: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 27: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 28: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 29: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 30: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 31: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 32: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 33: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 34: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 35: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 36: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 37: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 38: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 39: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 40: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 41: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 42: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 43: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 44: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 45: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 46: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 47: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 48: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 49: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 50: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 51: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 52: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 53: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 55: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 56: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 57: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 58: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 59: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 60: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 61: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 62: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 63: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 64: /var/lib/dpkg/tmp.ci/postrm: =: not found
/var/lib/dpkg/tmp.ci/postrm: 68: /var/lib/dpkg/tmp.ci/postrm: my: not found
/var/lib/dpkg/tmp.ci/postrm: 71: /var/lib/dpkg/tmp.ci/postrm: Syntax error: "(" unexpected
dpkg: error while cleaning up:
subprocess new post-removal script returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-4.13.0-37-generic_4.13.0-37.42~16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Since I was redirected to initramfs> prompt multiple times very frequently and after executing fsck -y /dev/sda3
, only 0.2% of the error on disk was to be found, So I reinstalled Ubuntu OS couple of weeks ago. Now I will be prompted with initramfs prompt very occasionally.
Do I need to reinstall Ubuntu again? I had replaced my Hard disk very recently.
Update
Output of namei -lx /usr/bin/perl as asked by muru
f: /usr/bin/perl
Drwxr-xr-x root root /
drwxr-xr-x root root usr
drwxr-xr-x root root bin
-rwxr-xr-x root root perl
Thank you.
0 Answers