无法在Ubuntu

时间:2017-02-17 02:34:07

标签: ubuntu latex ubuntu-14.04 dpkg

最初,我遇到了一个小问题。在执行latex文件时,我收到类似于

的错误
 \newtx package not found. 

所以,我决定更新乳胶。我按照链接https://askubuntu.com/questions/794671/upgrading-tex-live-from-2015-to-2016-on-ubuntu-16-04-lts中的主题进行了操作,并执行了以下操作

sudo add-apt-repository ppa:jonathonf/texlive-2016
sudo apt-get update
sudo apt-get install texlive

无法正确安装。不久之后,我开始收到错误消息

New software cannot be installed as there is a problem in the currently installed program.

我尝试了几件事来解决这个问题。例如我按照https://askubuntu.com/questions/474646/cant-install-software-can-i-fix-missing-dpkg链接进行了

sudo -i
mkdir /tmp/dpkg
cd /tmp/dpkg
wget http://security.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg_1.18.10ubuntu1_amd64.deb
ar x dpkg*.deb data.tar.gz
tar xfvz data.tar.gz ./usr/bin/dpkg
cp ./usr/bin/dpkg /usr/bin/
apt-get update
apt-get install --reinstall dpkg

在最终命令

之后显示以下错误消息
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these: 
The following packages have unmet dependencies.
latex-beamer : Depends: texlive-latex-base but it is not going to be installed
prosper : Depends: texlive-latex-base but it is not going to be installed
skype :   Depends: skype-bin but it is not installable
texlive : Depends: texlive-latex-recommended (>= 2016) but    2013.20140215-1 is to be installed
          Depends: texlive-latex-base (>= 2016) but it is not going to be installed
          Depends: texlive-fonts-recommended (>= 2016) but it is not going to be installed
texlive-base : Depends: luatex (>= 0.70.1)
          Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
texlive-fonts-recommended-doc : Depends: texlive-base (>= 2016) but 2013.20140215-1 is to be installed
         Depends: tex-common (>= 6) but 4.04 is to be installed
texlive-latex-extra : Depends: luatex
         Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
texlive-latex-extra-doc : Depends: tex-common (>= 6) but 4.04 is to be installed
         Depends: texlive-base (>= 2016) but 2013.20140215-1 is to be installed
texlive-latex-recommended : Depends: texlive-latex-base (>= 2013.20130512) but it is not going to be installed
         Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
texlive-luatex : Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
         Depends: luatex (>= 0.70.1)
texlive-pictures : Depends: luatex
         Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
texlive-pstricks : Depends: texlive-generic-recommended (>= 2013.20130512) but it is not going to be installed
         Depends: texlive-binaries (>= 2013.20130512) but it is not going to be installed
         Recommends: texlive-font-utils but it is not going to be installed
         Recommends: texlive-extra-utils but it is not going to be installed
tipa : Depends: texlive-latex-base but it is not going to be installed
         Depends: texlive-base-bin
wine1.6 : Depends: wine1.6-i386 (= 1:1.6.2-0ubuntu4) but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

我也试过

sudo apt-get -f install

带有以下错误消息

E: Sub-process /usr/bin/dpkg returned an error code (127)

我的系统有64位corei5处理器,操作系统是Ubuntu 14.04。我甚至无法升级到Ubuntu 16.04。摆脱这个问题的解决方案是什么?现在,它也说乳胶没有安装,所以我的乳胶工作也停止了。

1 个答案:

答案 0 :(得分:1)

打开终端并输入

  sudo dpkg --configure -a

如果它没有用,那么就这样做

  sudo apt autoremove <packagename>

如果这对您没有帮助 需要互联网连接。终端类型

  sudo apt-get autoclean

删除sources.list文件并创建新的sources.list ...

sudo rm /etc/apt/sources.list 

然后,输入

sudo software-properties-gtk 

enter image description here 这将打开software-properties-gtk,并自动创建newsources.list。

然后将服务器更改为美国或您选择的任何其他服务器。您必须从新对话框中启用存储库才能创建新的sources.list。

勾选所有框,然后单击“恢复”,然后单击“关闭”。

需要恢复默认存储库

 sudo apt-get update && sudo apt-get dist-upgrade -y

(最好在安装之前备份此文件,以便在发生此类情况时进行恢复)

现在安装任何东西!

 sudo apt-get install ____packagename_____