2

I would like to install gcc-7 on Ubuntu 22.04. I added:

deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe

to /etc/apt/sources.list and ran apt update; apt install g++-7, but it did not work.

click@click:~$ sudo nano /etc/apt/sources.list
click@click:~$ apt update; apt install g++-7
E: Malformed line 1 in source list /etc/apt/sources.list (type)
E: The list of sources could not be read.
E: Malformed line 1 in source list /etc/apt/sources.list (type)
E: The list of sources could not be read.
click@click:~$
Hi-Angel
  • 3,702
  • 1
  • 29
  • 36
  • 2
    As a side note: why do you want an older version of GCC? That's not common at all to desire, so I'm wondering if your problem maybe could be solved some other way. Btw, you can also install an older version of Ubuntu inside a Podman/Docker container. So you'd run a more or less modern system (barring the fact you're using LTS, even if a new one), but for development still get an older version of the distro. – Hi-Angel Oct 22 '22 at 00:41
  • You can try installing the appropriate .deb files from packages.ubuntu.com. – Archisman Panigrahi Oct 22 '22 at 04:36
  • What ever you added to the sources list has corrupted it. Please edit the question and include the contents of the sources list. – David Oct 22 '22 at 05:19

0 Answers0