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

问题描述 投票:0回答:1

每当我尝试使用 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 删除 gcc sudo apt-get 安装 gcc

sudo dpkg --configure -a

但结果一样

linux installation apt-get
1个回答
0
投票

使用

ls -al
检查给定文件夹中的符号链接(检查错误消息)。

尝试通过

rm /usr/bin/<name-comes-here>
手动删除符号链接,然后删除并重新安装gcc。如果删除并重新安装 gcc 没有帮助,您将需要手动为 gcc 创建符号链接

© www.soinside.com 2019 - 2024. All rights reserved.