Score:2

install gcc-7 on Ubuntu 22.04

kr flag

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 avatar
es flag
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.
us flag
You can try installing the appropriate .deb files from packages.ubuntu.com.
David avatar
cn flag
What ever you added to the sources list has corrupted it. Please edit the question and include the contents of the sources list.
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.