Whenever I try to install software GAMIT using apt-get it gives this error. How to solve this?
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.
I try this code
sudo apt-get remove gcc sudo apt-get install gcc
sudo dpkg --configure -a
but the result same
Use
ls -alto check smybolic links in the given folders (check the error message).try to delete the symbolic links manually by
rm /usr/bin/<name-comes-here>then remove and reinstall the gcc. if removing and reinstalling gcc does not help, you will need to manually create symbolic link for gcc