From 3d155ef0eaf8c527e2fbdfd86e96d2faaeb3f4a5 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 23 Feb 2016 14:29:15 +0100 Subject: [PATCH] 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 --- scripts/pre_test_root_password | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 scripts/pre_test_root_password diff --git a/scripts/pre_test_root_password b/scripts/pre_test_root_password new file mode 100755 index 0000000..b9520fa --- /dev/null +++ b/scripts/pre_test_root_password @@ -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