0

I tried installing nvidia drivers through an install script but got the error

  ERROR: Unable to find the development tool `cc` in your      
     path; please make sure that you have the package      
     'gcc' installed.  If gcc is installed on your system, 
     then please check that `cc` is in your PATH.   

When i used apt it said that gcc was already installed but using which returned nothing.I then decided to try to reinstall it which resulted in this, idk whats happening but alot of packages turn out like this and i have no idea what to do.

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 3 not upgraded.
Need to get 5,112 B of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu jammy/main amd64 gcc amd64 4:11.2.0-1ubuntu1 [5,112 B]
Fetched 5,112 B in 0s (39.7 kB/s)
dpkg: warning: files list file for package 'libuno-cppuhelpergcc3-3' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-mingw-w64-i686-win32' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libuno-purpenvhelpergcc3-3' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libx32gcc-s1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-mingw-w64-i686-posix' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-mingw-w64-base:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-12-base:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-12-base:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-mingw-w64-i686' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-mingw-w64-i686-posix-runtime' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libx32gcc-11-dev' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-12' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'lib32gcc-s1' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-11' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-mingw-w64-i686-win32-runtime' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gdm3' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libuno-salhelpergcc3-3' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-11-multilib' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcc-multilib' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'lib32gcc-11-dev' missing; assuming package has no files currently installed
(Reading database ... 450000 files and directories currently installed.)
Preparing to unpack .../gcc_4%3a11.2.0-1ubuntu1_amd64.deb ...
Unpacking gcc (4:11.2.0-1ubuntu1) over (4:11.2.0-1ubuntu1) ...
Setting up gcc (4:11.2.0-1ubuntu1) ...
update-alternatives: error: alternative path /usr/bin/gcc doesn't exist
dpkg: error processing package gcc (--configure):
 installed gcc package post-installation script subprocess returned error exit status 2
Processing triggers for man-db (2.10.2-1) ...
/usr/bin/mandb: can't chmod /var/cache/man/de.UTF-8/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/de.UTF-8/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't rename /var/cache/man/de.UTF-8/15728 to /var/cache/man/de.UTF-8/index.db: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/de.UTF-8/index.db: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/de.UTF-8/index.db: Operation not permitted
/usr/bin/mandb: can't chmod /var/cache/man/oldlocal/CACHEDIR.TAG: Operation not permitted
/usr/bin/mandb: can't remove /var/cache/man/oldlocal/CACHEDIR.TAG: Operation not permitted
Errors were encountered while processing:
 gcc
E: Sub-process /usr/bin/dpkg returned an error code (1)

Edit: the issue rooted from me reinstalling with home, var, and etc folders from a previous install. I was trying to avoid reinstalling again but I caved.

1 Answers1

2

I've always installed those tools using

sudo apt install build-essential

That process ensures that all of the build tools are available and matching.

If you've done that, and this is a new problem, then it sounds like you have bad hardware. Try

fsck [/mount/point]
W1T3H4T
  • 121