Results 1 to 5 of 5

Thread: Can't install gcc

  1. #1
    Join Date
    Dec 2012
    Beans
    27
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Can't install gcc

    I need some help. I did a clean install of 18.04 and I am trying to install VMWare player. It needs "gcc", so I'm thinking - no big deal, ran "apt install gcc" and this is what I get:

    Code:
    sudo apt install gcc
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     gcc : Depends: gcc-7 (>= 7.3.0-12~) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    Trying to get gcc-7, I get:

    Code:
    sudo apt install gcc-7
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:
    
    The following packages have unmet dependencies:
     gcc-7 : Depends: cpp-7 (= 7.3.0-16ubuntu3) but 7.3.0-27ubuntu1~18.04 is to be installed
             Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.3.0-27ubuntu1~18.04 is to be installed
             Depends: libgcc-7-dev (= 7.3.0-16ubuntu3) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    Any help as to why I can't get these packages (and how to fix it) would be greatly appreciated!!

  2. #2
    Join Date
    Mar 2011
    Beans
    1,994

    Re: Can't install gcc

    Those are all old versions, with 7.3.0-27 the current one. Did you first run sudo apt-get update? I thought gcc was installed by default, no need to do anything. You probably need the build-essential package (and the kernel header if no in the build-essential). g++ takes an explicit install if you need it.

  3. #3
    Join Date
    Dec 2012
    Beans
    27
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Can't install gcc

    Yes, update/upgrade has been ran. And gcc is not installed. This is what I get when I try to install "build-essential":

    Code:
    The following packages have unmet dependencies:
     build-essential : Depends: gcc (>= 4:7.2) but it is not going to be installed
                       Depends: g++ (>= 4:7.2) but it is not going to be installed
                       Depends: dpkg-dev (>= 1.17.11) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    And when I try to install g++:

    Code:
    The following packages have unmet dependencies:
     g++ : Depends: gcc (>= 4:7.3.0-3ubuntu2) but it is not going to be installed
           Depends: g++-7 (>= 7.3.0-12~) but it is not going to be installed
           Depends: gcc-7 (>= 7.3.0-12~) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    I really don't understand why it says "but it is not going to be installed" on all those packages...

  4. #4
    Join Date
    Dec 2012
    Beans
    27
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Can't install gcc

    Well, just wanted to follow up, it seems I have resolved the problem, but who knows how much harm I did in the process

    I ended up installing aptitude and using it to install gcc and build-essential. It had to downgrade a bunch of packages in the process, so only time will tell what issues this will cause in the future...

    The whole reason for this was so I could install VMware Player, and as far as that task is concerned - mission accomplished.

  5. #5
    Join Date
    Mar 2011
    Beans
    1,994

    Re: Can't install gcc

    Probably some ppa resource brought in some old versions. If problems persist, remove the extra ppas, do the apt-get update again, install build-essential and g++ (getting the current versions), then add the other ppa, run apt-get update again, and install again.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •