[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: aptitude works as root, not with sudo



On  0, Jeff <jcoppock1@attbi.com> wrote:
[snip]
> I get something similar running
> 
> $ sudo apt-get update && apt-get upgrade
> 
> The update works fine, but the upgrade gets this:
> 
> <snipped update stuff>
> Fetched 2287kB in 13s (172kB/s)                                                 
>    
> Reading Package Lists... Done
> Building Dependency Tree... Done
> E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
> E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

That would be because your shell is dividing the line:

sudo apt-get update && apt-get upgrade

into two commands:

sudo apt-get update
apt-get upgrade

Shell parsing happens before the command is executed!  You could do
this:

sudo apt-get update && sudo apt-get upgrade

but then you might get prompted for your password twice.

Tom
-- 
Tom Cook
Information Technology Services, The University of Adelaide

Never argue with an idiot.  They drag you down to their level, then beat you with experience.

Get my GPG public key: https://pinky.its.adelaide.edu.au/~tkcook/tom.cook-at-adelaide.edu.au

Attachment: pgpAM4jLpYXwB.pgp
Description: PGP signature


Reply to: