gpt4 book ai didi

ubuntu - 无法在 Ubuntu 中安装任何软件

转载 作者:行者123 更新时间:2023-12-04 18:40:47 30 4
gpt4 key购买 nike

最初,我有一个很小的问题。在执行一个 latex 文件时,我得到了一个类似的错误

 \newtx package not found. 

所以,我决定更新 latex 。我关注了链接中的线程 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。摆脱这个问题的解决方案是什么?现在,它也说没有安装 latex ,所以我在 latex 上的工作也停止了。

最佳答案

打开终端并输入

  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_____

关于ubuntu - 无法在 Ubuntu 中安装任何软件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42288403/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com