10

I have a fast computer (great processor, good SSD) but Software Centre takes a good 30 seconds to load up. This isn't a whinge, I think there could be something wrong. Synaptic takes a second to load.

I ran strace software-center to see if it was thrashing the disk (it's an SSD - I can't hear it) and it's statting and attempting to open a whole shed-load of files. Here's an excerpt:

open("/usr/local/lib/python2.6/dist-packages/FlexGet-1.0r1465-py2.6.egg/StringIOmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/FlexGet-1.0r1465-py2.6.egg/StringIO.py", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/FlexGet-1.0r1465-py2.6.egg/StringIO.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python2.6/dist-packages/progressbar-2.3_dev-py2.6.egg/StringIO", 0x7fff19d3af30) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/progressbar-2.3_dev-py2.6.egg/StringIO.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/progressbar-2.3_dev-py2.6.egg/StringIOmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/progressbar-2.3_dev-py2.6.egg/StringIO.py", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/progressbar-2.3_dev-py2.6.egg/StringIO.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python2.6/dist-packages/pynzb-0.1.0-py2.6.egg/StringIO", 0x7fff19d3af30) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/pynzb-0.1.0-py2.6.egg/StringIO.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/pynzb-0.1.0-py2.6.egg/StringIOmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/pynzb-0.1.0-py2.6.egg/StringIO.py", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/pynzb-0.1.0-py2.6.egg/StringIO.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python2.6/dist-packages/PyRSS2Gen-1.0.0-py2.6.egg/StringIO", 0x7fff19d3af30) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/PyRSS2Gen-1.0.0-py2.6.egg/StringIO.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/PyRSS2Gen-1.0.0-py2.6.egg/StringIOmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/PyRSS2Gen-1.0.0-py2.6.egg/StringIO.py", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/PyRSS2Gen-1.0.0-py2.6.egg/StringIO.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python2.6/dist-packages/html5lib-0.90-py2.6.egg/StringIO", 0x7fff19d3af30) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/html5lib-0.90-py2.6.egg/StringIO.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/html5lib-0.90-py2.6.egg/StringIOmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/html5lib-0.90-py2.6.egg/StringIO.py", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/html5lib-0.90-py2.6.egg/StringIO.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python2.6/dist-packages/PyYAML-3.09-py2.6-linux-x86_64.egg/StringIO", 0x7fff19d3af30) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/PyYAML-3.09-py2.6-linux-x86_64.egg/StringIO.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/PyYAML-3.09-py2.6-linux-x86_64.egg/StringIOmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/PyYAML-3.09-py2.6-linux-x86_64.egg/StringIO.py", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/PyYAML-3.09-py2.6-linux-x86_64.egg/StringIO.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/python2.6/dist-packages/transmissionrpc-0.6-py2.6.egg/StringIO", 0x7fff19d3af30) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/transmissionrpc-0.6-py2.6.egg/StringIO.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/transmissionrpc-0.6-py2.6.egg/StringIOmodule.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/transmissionrpc-0.6-py2.6.egg/StringIO.py", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/python2.6/dist-packages/transmissionrpc-0.6-py2.6.egg/StringIO.pyc", O_RDONLY) = -1 ENOENT (No such file or directory)

This might be a red herring. Later on it pauses at this:

poll([{fd=3, events=POLLIN}], 1, 25000) = 1 ([{fd=3, revents=POLLIN}])
recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"l\2\1\1\v\0\0\0\3\0\0\0=\0\0\0\6\1s\0\7\0\0\0:1.3497\0"..., 2048}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 91
recvmsg(3, 0x7fff8c57cc00, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
sendmsg(3, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\0\1\0\0\0\0\3\0\0\0{\0\0\0\1\1o\0\32\0\0\0/com/ubu"..., 144}, {"", 0}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 144
poll([{fd=3, events=POLLIN}], 1, 25000

And then it does it again... These two pauses account for most of the load time.

And then it really flips out with thousands of poll/read/temporarily unavailable lines.

So what on earth is going on here? Why is Software Centre scanning what looks to be any possible python package looking for StringIO? Bug?

Then why is it stalling at what looks like a web-request to something.ubuntu.com (can't see the full message)? Why is it talking to ubuntu.com anyway?

Oli
  • 289,791
  • 117
  • 680
  • 835
  • +1, it is the same on all computers I installed Ubuntu on, so we have to wait for a fix – Praweł Nov 05 '10 at 14:45
  • @Oli What version of Ubuntu is this? I've been using Lucid for a while now and have never run into this. – Mussnoon Nov 05 '10 at 15:36
  • I can confirm: it's extremly slow! I use Synaptic infact. – Andrea Grandi Nov 05 '10 at 17:29
  • @Mussnoon: Maverick. And it's only been this slow since Maverick. I think it might have something to do with the added For Purchase or single-sign-on parts of the new version... Either way, having it stall like that is pretty awful. – Oli Nov 05 '10 at 18:06
  • 3
    This should probably be reported as a bug. – Jorge Castro Nov 05 '10 at 18:44
  • @Jorge Agreed. I didn't start with a bug because I wanted to know if it was just me. I hack my install around. It's an update of an update of clone of an updated install. Entropy happens in systems. At least now I know it's not just me. – Oli Nov 05 '10 at 23:28
  • Do you have packages in `/usr/local/lib/python2.6/dist-packages/`? Somehow that seems wrong to me... – JanC Nov 06 '10 at 00:12
  • @JanC it scans `/usr/lib/...`, `/usr/local/lib/...` and `/usr/share/software-center/` for a whole load of Python libraries at startup. That's not clear in my extract but all of it would be a multi-megabyte text file. After hitting one prefix and not finding the file, it moves onto the next and then the next. I assume it finally finds what it wants because it loads up eventually. Doesn't seem to be the main cause of the delay though. – Oli Nov 06 '10 at 00:18
  • Yes, it's normal that it scans directories (and maybe I should have said that this probably isn't related to your issue), but AFAIK `dist-packages` should only be used for distro-provided packages, and I don't see how those can end up under `/usr/local/`. – JanC Nov 06 '10 at 01:20
  • In my case, loading software center hogs my CPU for a minute. I am using ubuntu 10.10 – user Apr 17 '11 at 17:24
  • Fixed in 11.10, only takes a few seconds (at least on my PC). – Greg Treleaven Oct 26 '11 at 17:06

2 Answers2

5

It appears to be fetching a fully up-to-date view of available packages (like what apt-get update does), which can take a while depending on how far out of date the cache is, how quickly the software repositories respond, and the speed of your network connection.

As mentioned in the comments, this lack of interactivity while refreshing seems like a bug.

Kees Cook
  • 17,243
  • 9
  • 68
  • 96
  • I'd accept that as an answer if Aptitude, Synaptic or even just an `apt-get update` doing the same took anywhere near the same time. **Including me typing my password** `time bash -c "sudo apt-get update"` returns 0m2.446s. A hot run (straight after with no password entry) took 0m0.572s. The SC consistently takes >30s so if this is what is causing the delay, the bug is much more than just an interactivity issue. – Oli Nov 05 '10 at 23:18
  • Hm, weird. It took about 30s the first time I ran it, then it only took a few moments. "30 seconds" is always a red flag to me that something is timing out on DNS. Regardless, opening a bug would make the most sense. – Kees Cook Nov 05 '10 at 23:21
  • Do you know if there's something I can wrap it in that examines just its network traffic? – Oli Nov 06 '10 at 00:19
  • And I thought I was exaggerating but it turns out I'm more patient than I give myself credit. Just ran software centre with `time`. 1m.55.410s. Ouch. – Oli Nov 06 '10 at 00:23
  • Usually I just start a VM and try to reproduce it there while running `tcpdump` or `wireshark`. But it'd be nice to have a way to do this. I've asked: http://askubuntu.com/q/11709/721 – Kees Cook Nov 06 '10 at 06:59
0

I meet the same problem . When I first open software-center , it is opened fast. Then I close it, but I find the process of software-center are not killed . The second time I open it , it will take long time to open. The method is that I kill software-center process manually after I close software-center .

I use ubuntu11.04 amd64 arch in thinkpad w500 .

waterloo2005
  • 2,007
  • 8
  • 31
  • 41