dpkg stuck downloading font files

Posted by Bob Bowles on Ask Ubuntu See other posts from Ask Ubuntu or by Bob Bowles
Published on 2012-07-06T01:09:48Z Indexed on 2012/07/06 3:24 UTC
Read the original article Hit count: 574

Filed under:
|
|

I have been reinstalling Ubuntu 12.04. The install from USB works fine, and I could update everything OK, but when I got to re-installing my application software I hit a snag.

One of the packages I tried to re-install was ttf-mscorefonts-installer. dpkg stalled during this setup, downloading a font file (it had tried to download it all night). I stopped dpkg, and attempted to re-start downloading something else, but it would not let me.

The commands I typed are as follows:

bob@bobStudio:~$ sudo rm /var/lib/dpkg/lock

This unlocks dpkg, but if I try to do something I get the following message (eg):

bob@bobStudio:~$ sudo apt-get install synaptic
E: dpgk was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem

So, I did just that:

bob@bobStudio:~$ sudo dpkg --configure -a

whereupon it started the previously failed download all over again. I went round the loop here a few times and each time after the configure command it re-started the failing download, but then I got this:

bob@bobStudio:~$ sudo dpkg --configure -a
Setting up update-notifier-common (0.119ubuntu8.4) ...
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/andale32.exe
Traceback (most recent call last):
  File "/usr/lib/update-notifier/package-data-downloader", line 234, in process_download_requests
    dest_file = urllib.urlretrieve(files[i])[0]
  File "/usr/lib/python2.7/urllib.py", line 93, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
  File "/usr/lib/python2.7/urllib.py", line 239, in retrieve
fp = self.open(url, data)
  File "/usr/lib/python2.7/urllib.py", line 207, in open
return getattr(self, name)(url)
  File "/usr/lib/python2.7/urllib.py", line 344, in open_http
h.endheaders(data)
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 776, in send
self.connect()
  File "/usr/lib/python2.7/httplib.py", line 757, in connect
self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno -2] Name or service not known
Setting up ttf-mscorefonts-installer (3.4ubuntu3) ...
bob@bobStudio:~$ sudo apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
bob@bobStudio:~$ sudo rm /var/lib/dpkg/lock
bob@bobStudio:~$ sudo apt-get update
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/

The good news is that, once I sorted out the file locks, this seems to have permanently aborted the setup of the font package, so at least I can do something else with dpkg.

That leaves two questions:

1) How could I have broken the loop without actually crashing out of dpkg?

2) How can I set up the ttf-mscorefonts-installer package in the future? Is this download really broken, or is it 'just' a bad Internet connection?

© Ask Ubuntu or respective owner

Related posts about fonts

Related posts about dpkg