3

As an Ubuntu newbie, I'm always lost with what to do when this happens...

reading package lists... done. then nothing

The progress appears to be stalled, but there's nothing on the current line to show me what might be happening that could stall... it's just a blank line and a blinking cursor, and the last line said it was 'done'.

It has been on this for like 15 minutes now, but this hasn't been the first time, and sometimes it eventually does something afterward. As well as in this specific situation, how am I supposed to know what to do whenever this kind of thing happens in Ubuntu? Is there a best practice or something? One of these times I Ctrl+C'd and then ran the command again waited longer, and it actually finished doing the thing. This time I don't seem to be having much success no matter how long I wait.

All my experience with Windows and CentOS hasn't ever prepared me for these situations and I really want to finally apt-get Ubuntu this time.

EDIT: I forgot as I am so used to using CentOS over SSH and it feels virtually the same for the most part, but technically I'm not running "pure" Ubuntu, I'm running it via the Windows Linux Subsystem... so perhaps that is to blame for everything. Still, I figured it would be easier than trying to get Ubuntu set up as an entire OS, not harder...

  • That output is from sudo apt update, I guess? The next line to expect would be "Building dependency tree". What I would try first is deleting and re-downloading all package lists: sudo rm -rf /var/lib/apt/lists ; sudo apt update. That should help if any of your current lists got corrupt somehow and is causing this. Another thing you could try is to run sudo dpkg --audit to perform some database sanity checks, but I doubt this would return anything. Also, does it make a difference whether you use sudo apt update or sudo apt-get update? – Byte Commander Aug 27 '18 at 22:27
  • It was apt-get update && apt-get upgrade I believe, and I was following a guide for installing postgresql... so perhaps it may have been stalled between the two (assuming there was nothing left for the update command)? I've only ever used apt-get so far as I figured it was the synonymous command of yum from CentOS. It may be important to note that this isn't a "pure" Ubuntu build as it's running it in the Windows Linux Subsystem (which I actually forgot as I'm so used to using CentOS via SSH), so every command I attempt to run seems to require extra consideration... – Deji Aug 27 '18 at 22:45
  • As far as installation from remote repositories, apt and yum are the same. That's not the issue. As you see, it's done reading packages, so we can rule out that as an issue, but then it's probably taking long time to calculate updates size. I wouldn't worry about this too much. Either let the command finish or restart it. – Sergiy Kolodyazhnyy Aug 27 '18 at 22:52
  • 1
    @Deji --fix-missing is the correct method, which works most times, although there are times when you have to trace which packages need fixing manually. Unfortunately, remote package managers in general can break, be it yum or apt - doesn't matter. – Sergiy Kolodyazhnyy Aug 27 '18 at 23:50
  • 1
    @Deji Btw, here's a suggestion: the next time the command stalls, try finding out its PID and then look at what the process is doing via sudo strace -p <PID>. The strace utility shows low level system calls being executed for a process. I use it for troubleshooting processes that have high CPU usage sometimes. You could also specify -o file.txt where to save the output, so next time you could paste that file and maybe someone can help you see what's actually happening – Sergiy Kolodyazhnyy Aug 27 '18 at 23:51
0

I would check the /var/log/apt/term.log. This is the default location for the apt-get log.

Next, but this is what @Sergiy Kolodyazhnyy already mentioned I would use the strace¹ to check what exactly is happening in here.

Probable I would use, apt-get update and check what will happen, then I will do the apt-get upgrade.

Hopefully this all makes sense.

You can also use strace -p to check the process and strace -o to a file.

¹ strace apt-get update

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.