在装有 Ubuntu 15.04(新创建)的虚拟 Linux 机器上,我即将安装 python-numpy,但是出现了一些错误:
>sudo apt-get install python-numpy
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-numpy is already the newest version.
The following packages were automatically installed and are no longer required:
fonts-texgyre libamd2.3.1 libdsdp-5.8gf libfftw3-double3 libglpk36
libgsl0ldbl preview-latex-style python-cvxopt python-joblib python-patsy
python-simplejson tex-gyre
Use 'apt-get autoremove' to remove them.
The following packages will be upgraded:
texlive-fonts-extra-doc
1 upgraded, 0 newly installed, 0 to remove and 233 not upgraded.
1 not fully installed or removed.
Need to get 0 B/60.2 MB of archives.
After this operation, 76.1 MB of additional disk space will be used.
(Reading database ... 229105 files and directories currently installed.)
Preparing to unpack .../texlive-fonts-extra-doc_2014.20141024-1_all.deb ...
E: Sub-process /usr/bin/dpkg returned an error code (2)
知道如何修复此错误吗? 无论如何,因为它说 numpy 已安装,这有问题吗?
除了此错误消息之外,我还必须运行命令
sudo dpkg --configure -a
每次我尝试安装某些东西时都会发生这种情况!发生了什么事……?
附加信息:
> dpkg -l | grep texlive
ii texlive-base 2014.20141024-2ubuntu1 all TeX Live: Essential programs and files
ii texlive-binaries 2014.20140926.35254-6build1 amd64 Binaries for TeX Live
ii texlive-extra-utils 2014.20141024-1 all TeX Live: TeX auxiliary programs
ii texlive-font-utils 2014.20141024-1 all TeX Live: Graphics and font utilities
ii texlive-fonts-extra 2014.20141024-1 all TeX Live: Additional fonts
iHR texlive-fonts-extra-doc 2014.20141024-1 all (no description available)
ii texlive-generic-recommended 2014.20141024-2ubuntu1 all TeX Live: Generic recommended packages
ii texlive-latex-base 2014.20141024-2ubuntu1 all TeX Live: LaTeX fundamental packages
ii texlive-latex-recommended 2014.20141024-2ubuntu1 all TeX Live: LaTeX recommended packages
ii texlive-pictures 2014.20141024-2ubuntu1 all TeX Live: Graphics, pictures, diagrams
ii texlive-pstricks 2014.20141024-1
all TeX Live: PSTricks
和:
>apt-cache policy texlive-fonts-extra-doc
texlive-fonts-extra-doc:
Installed: 2014.20141024-1
Candidate: 2014.20141024-1
Version table:
2014.20141024-1 0
500 http://ch.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages
*** 2014.20141024-1 0
100 /var/lib/dpkg/status
答案1
您的问题与 无关python-numpy
。原因是之前安装了texlive
。
更改下载服务器
sudo sed -i 's://ch\.://:g' /etc/apt/sources.list
sudo apt-get update
重新安装包
sudo apt-get clean
sudo apt-get install -f
sudo apt-get install --reinstall texlive-fonts-extra-doc
正如你所说,你的虚拟机只有 500 MB RAM
$ free -m total used free shared buffers cached Mem: 489 469 19 8 2 70 -/+ buffers/cache: 396 92 Swap: 0 0 0
给你的系统更多的 RAM=)