MT#11387 Ensure that sudo package can be removed during piupart runs

We need to set the password for user root, otherwise the
sudo package refuses to get removed. See e.g.
See https://jenkins.mgm.sipwise.com/view/piuparts/job/metapackages-piuparts/290/consoleFull

|   Removing sudo (1.8.10p3-1+deb8u3) ...
|   You have asked that the sudo package be removed,
|   but no root password has been set.
|   Without sudo, you may not be able to gain administrative privileges.
|
|   If you would prefer to access the root account with su(1)
|   or by logging in directly,
|   you must set a root password with "sudo passwd".
|
|   If you have arranged other means to access the root account,
|   and you are sure this is what you want,
|   you may bypass this check by setting an environment variable
|   (export SUDO_FORCE_REMOVE=yes).
|
|   Refusing to remove sudo.
|   dpkg: error processing package sudo (--purge):
|    subprocess installed pre-removal script returned error exit status 1

Change-Id: Id49bfa2cdf1f4018d26c13d240682967a8507caa
changes/92/4792/1
Michael Prokop 11 years ago
parent 95c57e226f
commit 3d155ef0ea

@ -0,0 +1,10 @@
#!/bin/sh
# Origin: custom-scripts/scripts/pre_test_root_password from
# git://anonscm.debian.org/piuparts/piuparts.git
set -e
# sudo refuses removal if no root password is set, so set one
# do this unconditionally, as there are quite some packages depending on sudo
# (and since its harmless and fast)
yes "yes" 2>/dev/null | passwd
Loading…
Cancel
Save