我一直在重新安装Ubuntu 12.04。从 USB 安装工作正常,我可以正常更新所有内容,但是当我重新安装我的应用程序软件时,我遇到了障碍。
ttf-mscorefonts-installer
我尝试重新安装的其中一个软件包dpkg
在安装过程中停滞,正在下载字体文件(它尝试下载整个晚上)。我停止了dpkg
,并尝试重新开始下载其他内容,但它不允许我这样做。
我输入的命令如下:
bob@bobStudio:~$ sudo rm /var/lib/dpkg/lock
这将解锁 dpkg,但如果我尝试执行某些操作,我会收到以下消息(例如):
bob@bobStudio:~$ sudo apt-get install synaptic
E: dpgk was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem
因此,我就是这么做的:
bob@bobStudio:~$ sudo dpkg --configure -a
于是它又重新开始了之前失败的下载。我在这里循环了几次,每次在 configure 命令之后它都会重新开始失败的下载,但后来我得到了这个:
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/
好消息是,一旦我理清了文件锁,这似乎就永久中止了字体包的设置,所以至少我可以用它做些别的事情dpkg
。
这留下了两个问题:
1)我怎样才能在不真正崩溃的情况下打破循环dpkg
?
ttf-mscorefonts-installer
2) 我以后该如何设置该软件包?这个下载真的坏了吗,还是“只是”网络连接不好?
答案1
您应该能够像这样删除损坏的包装:
dpkg -r ttf-mscorefonts-installer
至于问题 2,我不确定。安装该软件包时,您肯定需要互联网连接。