purging docker.io fails due to bash-specific "shopt" command

Bug #1777865 reported by Paul
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
docker.io (Ubuntu)
New
Undecided
Unassigned

Bug Description

running "apt purge docker.io" fails. This is because /var/lib/docker/nuke-graph-directory.sh uses "/bin/sh" in the shebang line, yet it uses bash-specific "shopt" builtin.

updating the script to use "/bin/bash" fixes the issue and allows "apt purge" to finish successfully.

Below is the output from "apt purge docker.io"

hostname:~# apt purge docker.io
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  docker.io*
0 upgraded, 0 newly installed, 2 to remove and 72 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 72075 files and directories currently installed.)
Removing docker.io (1.13.1-0ubuntu1~16.04.2) ...
Purging configuration files for docker.io (1.13.1-0ubuntu1~16.04.2) ...

Nuking /var/lib/docker ...
  (if this is wrong, press Ctrl+C NOW!)

+ sleep 10

/var/lib/docker/nuke-graph-directory.sh: 64: /var/lib/docker/nuke-graph-directory.sh: shopt: not found
dpkg: error processing package docker.io (--purge):
 subprocess installed post-removal script returned error exit status 127
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: docker.io 1.13.1-0ubuntu1~16.04.2
ProcVersionSignature: Ubuntu 4.4.0-122.146-generic 4.4.117
Uname: Linux 4.4.0-122-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.16
Architecture: amd64
Date: Wed Jun 20 11:52:38 2018
ProcEnviron:
 SHELL=/bin/bash
 TERM=xterm-256color
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 LANGUAGE=en_US:
SourcePackage: docker.io
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.default.docker: 2018-05-01T15:39:38.793397

Revision history for this message
Paul (thenut-d) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.