尝试在Linux中使用apt-get安装软件时出错

yx2lnoni  于 2023-05-06  发布在  Linux
关注(0)|答案(1)|浏览(301)

每当我尝试使用apt-get安装软件GAMIT时,它都会出现此错误。如何解决这个问题?

Reading package lists... Done
Building dependency tree
Reading state information... Done
make is already the newest version (4.2.1-1.2).
csh is already the newest version (20110502-5).
tcsh is already the newest version (6.21.00-1).
libx11-dev is already the newest version (2:1.6.9-2ubuntu1.2).
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up vim (2:8.1.2269-1ubuntu5.14) ...
update-alternatives: error: cannot stat file '/usr/bin/gcc': Too many levels of symbolic links
dpkg: error processing package vim (--configure):
 installed vim package post-installation script subprocess returned error exit status 2
Setting up vim-tiny (2:8.1.2269-1ubuntu5.14) ...
update-alternatives: error: cannot stat file '/usr/bin/gcc': Too many levels of symbolic links
dpkg: error processing package vim-tiny (--configure):
 installed vim-tiny package post-installation script subprocess returned error exit status 2
Setting up shim-signed (1.40.9+15.7-0ubuntu1) ...
update-alternatives: error: cannot stat file '/usr/bin/gcc': Too many levels of symbolic links
dpkg: error processing package shim-signed (--configure):
 installed shim-signed package post-installation script subprocess returned error exit status 2
Setting up gfortran (4:9.3.0-1ubuntu2) ...
update-alternatives: error: cannot stat file '/usr/bin/gcc': Too many levels of symbolic links
dpkg: error processing package gfortran (--configure):
 installed gfortran package post-installation script subprocess returned error exit status 2
No apport report written because MaxReports is reached already
                                                              Setting up plymouth-theme-ubuntu-text (0.9.4git20200323-0ubuntu6.2) ...
update-alternatives: error: cannot stat file '/usr/bin/gcc': Too many levels of symbolic links
dpkg: error processing package plymouth-theme-ubuntu-text (--configure):
 installed plymouth-theme-ubuntu-text package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of gfortran-multilib:
 gfortran-multilib depends on gfortran (= 4:9.3.0-1ubuntu2); however:
  Package gfortran is not configured yet.

我试试这个代码
sudo apt-get remove gcc
sudo dpkg --configure -a
但结果是一样的

bgtovc5b

bgtovc5b1#

使用ls -al检查给定文件夹中的smybolic链接(检查错误消息)。
尝试删除符号链接手动由rm /usr/bin/<name-comes-here>然后删除并重新安装gcc.如果删除和重新安装gcc没有帮助,您将需要手动创建gcc的符号链接

相关问题