From 73fe49f9b4748eddb5a2dad4f0abb51a8f63564c Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 16 Oct 2015 12:54:14 +0200 Subject: suggest 'apt autoremove' to get right of unneeded packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bugreport is more conservative in asking for a conditional, but given that this is a message intended to be read by users to be run by users we should suggest using a command intended to be used by users. And while we are at, add sudo to the message – conditional of course. Closes: 801571 --- apt-private/private-install.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'apt-private') diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc index a9d93a92a..dda5b50be 100644 --- a/apt-private/private-install.cc +++ b/apt-private/private-install.cc @@ -484,7 +484,11 @@ static bool DoAutomaticRemove(CacheFile &Cache) else ioprintf(c1out, P_("%lu package was automatically installed and is no longer required.\n", "%lu packages were automatically installed and are no longer required.\n", autoRemoveCount), autoRemoveCount); - c1out << P_("Use 'apt-get autoremove' to remove it.", "Use 'apt-get autoremove' to remove them.", autoRemoveCount) << std::endl; + std::string autocmd = "apt autoremove"; + if (getenv("SUDO_USER") != NULL) + autocmd = "sudo " + autocmd; + ioprintf(c1out, P_("Use '%s' to remove it.", "Use '%s' to remove them.", autoRemoveCount), autocmd.c_str()); + c1out << std::endl; } return true; } -- cgit v1.2.3