apt-get tells me to run "dpkg", but the correct command is "sudo dpkg"

Bug #52697 reported by Chris Moore
22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Low
Michael Vogt

Bug Description

Since ubuntu doesn't set a root password, wouldn't it make sense to include the "sudo" prefix in error messages like the following?

E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
(ubuntu) chris@chrislap:~$ dpkg --configure -a
dpkg: requested operation requires superuser privilege

apt-get tells me to run "dpkg ...", but when I do it doesn't work.

It would be better if it told me explicitly to run "sudo dpkg ..." instead.

Revision history for this message
frogzoo (frogzoo) wrote :

Though this might seem the right approach, it's probably not. There's other ways of gaining access. sudo is just one approach.

Changed in apt:
status: Unconfirmed → Rejected
Revision history for this message
Chris Moore (dooglus) wrote :

If there are other approaches which work in a default install, then mention one of them instead. I suggested using "sudo dpkg --configure -a" since I know that works in a default install.

The command which is currently suggested, "dpkg --configure -a", just plain doesn't work in a default ubuntu install unless the user is somehow running a root shell, which (according to https://help.ubuntu.com/community/RootSudo ) is *not recommended*.

Revision history for this message
David D Short (chameleondave) wrote :

I was about to report this bug myself.

dpkg ought to be patched so that on Ubuntu it tells the user to use “sudo”. This is not a matter of opinion. It is Ubuntu policy to gain root privileges with “sudo” and not with “su”.

Remember that the message is for the benefit of new users. Experts already know what to do. The command should be exactly what the user needs to type.

Revision history for this message
Chris Moore (dooglus) wrote : Re: [Bug 52697] Re: apt-get tells me to run "dpkg", but the correct command is "sudo dpkg"

> Remember that the message is for the benefit of new users. Experts
> already know what to do. The command should be exactly what the user
> needs to type.

 Why do we even tell the user "you must run <this command>"?

Why not just offer to run it for them, possibly after prompting:
  "dpkg was interrupted; run 'dpkg --configure -a' to correct the problem?
[Y/n]"
or some such.

The same could be done for the "autoremove". Rather that telling the use
what command to run, we could offer to run it for them.

Revision history for this message
Mackenzie Morgan (maco.m) wrote :

I'm opening this back up. The error message is unclear and *will* confuse new users. It should either include the "sudo" prefix or state that it must be run "as root" or "with superuser privileges" or something of the sort. As it stands, the user will try "dpkg --configure -a" and get permission denied, even though they were just following directions.

Changed in apt:
importance: Undecided → Low
status: Invalid → Confirmed
Revision history for this message
Vadim Peretokin (vperetokin) wrote :

I'll start compiling a list of threads about this as I run into them. Unbelievable that the problem wasn't touched for two years.

http://ubuntuforums.org/showthread.php?t=981299

Revision history for this message
Ian Weisser (ian-weisser) wrote :

Very simple patch to add 'sudo' to that string.

Michael Vogt (mvo)
Changed in apt:
assignee: nobody → mvo
status: Confirmed → In Progress
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for the bugreport and the debdiff. This is commited to the ubuntu bzr branch and will be part of the next upload.

Changed in apt:
status: In Progress → Fix Committed
Revision history for this message
Bryce Harrington (bryce) wrote : Unsubscribing Sponsors.

I'm unsubscribing the Sponsors' Team for now. Please re-subscribe when ready.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt - 0.7.20.2ubuntu1

---------------
apt (0.7.20.2ubuntu1) jaunty; urgency=low

  [ Christian Perrier ]
  * Translations:
    - bg.po. Closes: #513211
    - zh_TW.po. Closes: #513311
    - nb.po. Closes: #513843

  [ Michael Vogt ]
  * merged from the debian-sid branch
  * [ABI break] merge support for http redirects, thanks to
    Jeff Licquia and Anthony Towns
  * [ABI break] use int for the package IDs (thanks to Steve Cotton)
  * apt-pkg/contrib/strutl.cc:
    - fix TimeToStr i18n (LP: #289807)
  * debian/apt.conf.autoremove:
    - readd "linux-image" (and friends) to the auto-remove
     blacklist
  * fix some i18n issues (thanks to Gabor Kelemen)
    LP: #263089
  * apt-pkg/deb/dpkgpm.cc:
    - filter "ENOMEM" errors when creating apport reports
  * cmdline/apt-get.cc:
    - fix "apt-get source pkg=ver" if binary name != source name
      (LP: #202219)
  * apt-pkg/indexrecords.cc:
    - fix some i18n issues
  * apt-pkg/contrib/strutl.h:
    - add new strprintf() function to make i18n strings easier
  * apt-pkg/dev/debsystem.cc:
    - add missing apti18n.h header
  * cmdline/apt-get.cc:
    - default to "false" for the "APT::Get::Build-Dep-Automatic"
      option (follow debian here)
  * apt-pkg/pkgcache.cc:
    - do not run "dpkg --configure pkg" if pkg is in trigger-awaited
      state (LP: #322955)
  * methods/https.cc:
    - add Acquire::https::AllowRedirect support
    - do not unlink files in partial/ (thanks to robbiew)

  [ Dereck Wonnacott ]
  * Clarify the --help for 'purge' (LP: #243948)

  [ Ian Weisser ]
  * /apt-pkg/deb/debsystem.cc:
    - add 'sudo' to the error message to "run 'dpkg --configure -a'"
      (LP: #52697)

 -- Michael Vogt <email address hidden> Mon, 09 Feb 2009 14:21:05 +0100

Changed in apt:
status: Fix Committed → Fix Released
Revision history for this message
Cindy (cpratt99) wrote :

i bought an hp netbook and it has not worked once. All of my other computers are windows operating systems. This is my first exposure to linux operating system.

The error message I am getting is you must manually run 'dpkg --configure -a' to correct the problem. E:_cache->open() failed, please report.

I have no idea how to correct this and I am having trouble accessing the web with the browser. Please help. I am very frustrated.

Revision history for this message
Andrew Zajac (arzajac) wrote : Re: [Bug 52697] Re: apt-get tells me to run "dpkg", but the correct command is "sudo dpkg"

Hi Cindy.

You probably should contact HP for support for your netbook.  You can also get help from ubuntuforums.org.

It would seem to me that you interrupted the package manager when it was in the middle of installing something and it is stuck in between being able to proceed with any other task and completing the current task which has been interrupted.  That message is telling you that to continue to stopped installation of the package, you need to run that command.

Open a terminal and type

sudo dpkg --configure -a

It will then ask you for the password and your package manager should fix the problem.  There is a way to fix the problem from a graphical interface, but I am not able to help you with that presently.

Regards,

Andrew Zajac

--- On Sun, 3/14/10, Cindy <email address hidden> wrote:

From: Cindy <email address hidden>
Subject: [Bug 52697] Re: apt-get tells me to run "dpkg", but the correct command is "sudo dpkg"
To: <email address hidden>
Received: Sunday, March 14, 2010, 12:05 PM

i bought an hp netbook and it has not worked once.  All of my other
computers are windows operating systems.  This is my first exposure to
linux operating system.

The error message I am getting is you must manually run 'dpkg
--configure -a' to correct the problem. E:_cache->open() failed, please
report.

I have no idea how to correct this and I am having trouble accessing the
web with the browser.  Please help.  I am very frustrated.

--
apt-get tells me to run "dpkg", but the correct command is "sudo dpkg"
https://bugs.launchpad.net/bugs/52697
You received this bug notification because you are a direct subscriber
of a duplicate bug.

      __________________________________________________________________
Be smarter than spam. See how smart SpamGuard is at giving junk email the boot with the All-new Yahoo! Mail. Click on Options in Mail and switch to New Mail today or register for free at http://mail.yahoo.ca

Revision history for this message
bridget morran (bohemia-city) wrote :

I am getting this message 'sudo dpgk --configurate-a', it tells me to 'run' it - I don't even know what 'run' means. What am I supposed to do? I don't know anything about computers just want it to work. Can someone please explain in plain English. If I have to type something in, where and how? Thank you so much!!!

Revision history for this message
Andrew Zajac (arzajac) wrote :

Hi Bridget.

Yes, you do need to run that command.

If you look in the Applications menu you should find a terminal menu item.  Click on it and you will be shown a terminal - a screen into which you can enter commands.  Run that command.  You can cut and paste if you like.

sudo dpkg --configure -a

--- On Tue, 7/20/10, bridget morran <email address hidden> wrote:

From: bridget morran <email address hidden>
Subject: [Bug 52697] Re: apt-get tells me to run "dpkg", but the correct command is "sudo dpkg"
To: <email address hidden>
Received: Tuesday, July 20, 2010, 12:17 PM

I am getting this message 'sudo dpgk --configurate-a', it tells me to
'run' it - I don't even know what 'run' means. What am I supposed to do?
I don't know anything about computers just want it to work. Can someone
please explain in plain English. If I have to type something in, where
and how? Thank you so much!!!

--
apt-get tells me to run "dpkg", but the correct command is "sudo dpkg"
https://bugs.launchpad.net/bugs/52697
You received this bug notification because you are a direct subscriber
of a duplicate bug.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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