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

Re: fixing broken apt



Jacob S <stormspotter@6Texans.net> writes:

> Please keep it on-list. You'll have a better chance of getting help from
> the experts and the solution will be archived in Google should anyone
> else have similar problems in the future.
>
> On Sat, 2 Apr 2005 05:05:19 -0900
> Oliver Savage <oliver.savage@gmail.com> wrote:
>
>> Thanks.
>> The top readout is showing the same process over time. I can kill it
>> just fine. The problem is that it doesn't give me any errors. I
>> removed the apt.conf earlier today and ran "apt-get update" for a few
>> hours when I came back it was still just sitting there with no output.
>> No matter what apt-* command I run I get the same thing, absolutely
>> nothing.
>
> Ah, it wasn't clear in your previous e-mail whether the top output was
> after you used Ctrl-C to stop apt-get or before. 
>
>> Is there something I can do to at least find out where apt is
>> breaking? Or would reinstalling be easier? Does this mean I get to
>> learn how to debug now? (please say no to the last one) :p
>
> Does "apt-get -v update" produce any extra output? Sorry, but I'm out of
> ideas, so I'm taking the 'debug' approach. :-) 
>

Folks

I'm just a recent Debian user and hence no apt geek, but I still may share
the steps I'd take. One observation first though, the 90+ figures in the
top output apparently are CPU usage, so the process is not hanging but gone
wild instead, presumably looping at some point.

So what I'd do is

* look what files/sockets apt-get accesses while running with lsof, just
  to know
* run it with strace like 'strace apt-get'. The latter will produce lots
  of output, especially since the process is not 'hanging'. You might
  redirect the output to a file via
  strace apt-get > apt.log 2>&1
  then let the process run some 10 seconds at the 90+ CPU usage level
  and kill it of. The log will tell you where the process (presumably)
  is looping, you just have to interprete those low level system calls
  right.

Especially step 2 might already give you decisive info if you have some
programming experience. strace is hopefully installed on your system, and
if ltrace is too you could try that as well. If you feel fit, you could
even attach with a debugger, if installed, and examine the call stack,
which also might be pretty helpful.

All this of course is pretty 'low level', but has helped me often enough.

Good luck, Bruno.



Reply to: