Score:0

is there another method to install gcc in a linux environment?

mq flag

I installed linux environment with ubuntu feature on my windows computer. After that I installed make from the terminal(which was successful). So i wrote my first code in vs code editor but make could not run make because cc could not be found. I checked to see whether it was installed but it wasn't so I tried installing it with 'sudo apt install gcc'. However, I always get an error in the middle of the process and from my search it seems the package could not be found. The link to the package is invalid. The few suggestions I found after doing some digging is that I could wait for the server to come online before I continue. However, i was wondering it there could be another way to do this.

The terminal input and output are shown below:

dillon@OPTIMUS:~$ sudo apt install gcc
[sudo] password for dillon:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  cpp cpp-11 fontconfig-config fonts-dejavu-core gcc-11 gcc-11-base libasan6 libatomic1 libc-dev-bin libc-devtools
  libc6-dev libcc1-0 libcrypt-dev libdeflate0 libfontconfig1 libfreetype6 libgcc-11-dev libgd3 libgomp1 libisl23
  libitm1 libjbig0 libjpeg-turbo8 libjpeg8 liblsan0 libmpc3 libnsl-dev libquadmath0 libtiff5 libtirpc-dev libtsan0
  libubsan1 libwebp7 libxpm4 linux-libc-dev manpages-dev rpcsvc-proto
Suggested packages:
  cpp-doc gcc-11-locales gcc-multilib autoconf automake libtool flex bison gdb gcc-doc gcc-11-multilib gcc-11-doc
  glibc-doc libgd-tools
The following NEW packages will be installed:
  cpp cpp-11 fontconfig-config fonts-dejavu-core gcc gcc-11 gcc-11-base libasan6 libatomic1 libc-dev-bin libc-devtools
  libc6-dev libcc1-0 libcrypt-dev libdeflate0 libfontconfig1 libfreetype6 libgcc-11-dev libgd3 libgomp1 libisl23
  libitm1 libjbig0 libjpeg-turbo8 libjpeg8 liblsan0 libmpc3 libnsl-dev libquadmath0 libtiff5 libtirpc-dev libtsan0
  libubsan1 libwebp7 libxpm4 linux-libc-dev manpages-dev rpcsvc-proto
0 upgraded, 38 newly installed, 0 to remove and 0 not upgraded.
Need to get 1339 kB/49.0 MB of archives.
After this operation, 153 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Err:1 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 linux-libc-dev amd64 5.15.0-70.77
  404  Not Found [IP: 185.125.190.36 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_5.15.0-70.77_amd64.deb  404  Not Found [IP: 185.125.190.36 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I tried using the fixes provided at the end of the error message but that didn't solve the problem. I was also thinking I could go online and download the package manually but I don't have much knowledge on that and what particular package I'm supposed to select. I'm also not sure how to install it so that it becomes part of the linux environment.

Hannu avatar
ca flag
`$ sudo apt install build-essential` might be good start.
hu flag
One way to deal with the "404 Not Found ..." error is to use another mirror. I wouln't advice to download and install packages manually.
hr flag
The current version of linux-libc-dev in jammy-updates/main appears to be `5.15.0-71.78` so perhaps your package catalog needs updating? Please run `sudo apt update` then try again.
Henry Dillon avatar
mq flag
`$ sudo apt install build-essential` returns the same error
Score:1
pl flag

This is simple. Your local package cache is outdate. You need to run sudo apt update before you run sudo apt install gcc.

Henry Dillon avatar
mq flag
I don't know what 'mirror' is (i'm very much new to programming). Running the update command seems to work except that there is an error saying the Release is invalid for another 1hr 45min 16s. Should i wait and try again?
user535733 avatar
cn flag
No, you should use the Search box at the top of the page: Plug in that error message. Get into the habit of considering, as a learned adult human, what the error message is trying to tell you. Developers want you to read and understand the error messages. They are clues to what is wrong and how to fix it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.