[Bug 1692235] Re: Syntax error in .postinst - broken package

fermulator 1692235 at bugs.launchpad.net
Sun May 21 14:09:57 UTC 2017


"me too"
{{{
$ dpkg --list | grep grub-pc
iF  grub-pc                               2.02~beta2-36ubuntu3.10                    amd64        GRand Unified Bootloader, version 2 (PC/BIOS version)
ii  grub-pc-bin                           2.02~beta2-36ubuntu3.10                    amd64        GRand Unified Bootloader, version 2 (PC/BIOS binaries)

$ uname -a
Linux <hostname> 4.4.0-79-generic #100-Ubuntu SMP Wed May 17 19:58:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
}}}


This is the block it's complaining about:
{{{
        if dpkg --compare-versions "$2" lt-nl 2.02~beta2-36ubuntu3.10 then
          if [ -e "/boot/efi/EFI/${bootloader_id}/fbx64.efi" ]; then
            rm -f "/boot/efi/EFI/${bootloader_id}/fbx64.efi";
          fi
        fi                                                                <--- HERE
}}}

However there are no syntax errors that I can see in this shell script.

Working backwards a bit, I added a debug echo just above that;
 -> echo statement doesn't get hit

Added another statement just above the previous block
{{{
      grub-efi-ia32|grub-efi-amd64|grub-efi-ia64|grub-efi-arm|grub-efi-arm64)
        bootloader_id="$(config_item GRUB_DISTRIBUTOR | tr A-Z a-z | \
                         cut -d' ' -f1)"
        case $bootloader_id in
          kubuntu) bootloader_id=ubuntu ;;
        esac
}}}

And it borked there
/var/lib/dpkg/info/grub-pc.postinst: line 694: syntax error near unexpected token `"fermmy:DEBUG: foo"'

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1692235

Title:
  Syntax error in .postinst - broken package

Status in grub2 package in Ubuntu:
  Confirmed

Bug description:
  Apport doesn't allow the upload, because it's a known error.
  Since I never had an issue I'd like to report the multiple syntax errors in the .postinst file of grub-pc.
  Terminal output excerpt:
  sudo apt upgrade
  0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  1 not fully installed or removed.
  Setting up grub-pc (2.02~beta2-36ubuntu3.10) ...
  /var/lib/dpkg/info/grub-pc.postinst: line 703: syntax error near unexpected token `fi'
  dpkg: error processing package grub-pc (--configure):
   subprocess installed post-installation script returned error exit status 2
  Errors were encountered while processing:
   grub-pc
  E: Sub-process /usr/bin/dpkg returned an error code (1)

  I've started to fix grub-pc.postinst step by step, because after
  removing the 'fi' in line 703 there occur more and more til line 740,
  e.g. semicolons, brackets and at the end it says unexpected end of
  file, which I was unable to fix, original it says exit 0. I've tried
  several inputs, looked at examples of other .postinst files, but
  nothing worked.

  Renaming /var/lib/dpkg/info/grub-pc.postinst and reinstalling grub-pc
  didn't help.

  dpkg --configure -a 
  and
  dpkg-reconfigure <package>
  didn't help.

  It would be nice if someone could fix the syntax. Thanks!

  apt-cache policy grub-pc
  grub-pc:
    Installiert:           2.02~beta2-36ubuntu3.10
    Installationskandidat: 2.02~beta2-36ubuntu3.10
    Versionstabelle:
   *** 2.02~beta2-36ubuntu3.10 500
          500 http://archive.ubuntu.com/ubuntu xenial-proposed/main amd64 Packages
          100 /var/lib/dpkg/status
       2.02~beta2-36ubuntu3.9 500
          500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
       2.02~beta2-36ubuntu3 500
          500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: grub-pc 2.02~beta2-36ubuntu3.10
  ProcVersionSignature: Ubuntu 4.8.0-53.56~16.04.1-generic 4.8.17
  Uname: Linux 4.8.0-53-generic x86_64
  ApportVersion: 2.20.1-0ubuntu2.6
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Sat May 20 17:21:45 2017
  InstallationDate: Installed on 2016-11-02 (198 days ago)
  InstallationMedia: Ubuntu 16.04.1 LTS "Xenial Xerus" - Beta amd64 (20160823)
  SourcePackage: grub2
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1692235/+subscriptions



More information about the foundations-bugs mailing list