Difficulty installing LLVM/Clang (newbie)

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
Person from Porlock
Level 1
Level 1
Posts: 11
Joined: Mon Oct 02, 2017 2:21 pm

Difficulty installing LLVM/Clang (newbie)

Post by Person from Porlock » Mon Oct 02, 2017 2:45 pm

Hi, I am brand new to using Linux and am facing trouble installing LLVM and Clang 5.0 using the command line. I am running Linux Mint 18.2, the 64-bit version.

I've read up some advice, mostly from the Unix StackExchange and have been following the instructions on apt.llvm.org.

First I added the repository using sudo apt-add-repository and then the repository. As I understand this version of Mint is based on Ubuntu 16.04 I added the ones recommended by LLVM:
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main
and then
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main.

This all seemed to work fine.

To retrieve the archive signature I then ran

Code: Select all

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - # Fingerprint: 6084 F3CF 814B 57C1 CF12 EFD5 15CF 4D18 AF4F 7421 
Again, this all seemed to work fine. It connected and something called application/pgp-keys was saved to STDOUT.

Finally I tried typing sudo apt-get install followed by the various names of the files I need. At this point I got an error message:

Code: Select all

E: malformed entry 1 in list file /etc/apt/sources.list.d/additional-repositories.list (Component)
E: The list of sources could not be read.
This pair of error messages was actually duplicated.

I must admit I am stumped. Anyone's help would be much appreciated; either in remedying this error, or advice on an alternative method of installing Clang/LLVM.

Best wishes,
Andrew

User avatar
karlchen
Level 20
Level 20
Posts: 11532
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Difficulty installing LLVM/Clang (newbie)

Post by karlchen » Mon Oct 02, 2017 2:58 pm

Hi, Andrew.

Please, execute the commandline

Code: Select all

inxi -Sr
exactly as it has been typed here. Mark the complete screen output and paste it into your next reply.
This should help determine what the malfomred entry is in line 1 of the software sources list file /etc/apt/sources.list.d/additional-repositories.list.

Regards,
Karl
Image
Linux Mint 19.2 64-bit Cinnamon, Total Commander 9.22a 64-bit
Haß gleicht einer Krankheit, dem Miserere, wo man vorne herausgibt, was eigentlich hinten wegsollte. (Goethe)

Person from Porlock
Level 1
Level 1
Posts: 11
Joined: Mon Oct 02, 2017 2:21 pm

Re: Difficulty installing LLVM/Clang (newbie)

Post by Person from Porlock » Mon Oct 02, 2017 3:05 pm

Thank you for the quick reply Karl.

Output is as follows:

Code: Select all

System:    Host: Azathoth Kernel: 4.8.0-53-generic x86_64 (64 bit)
           Desktop: Cinnamon 3.4.3  Distro: Linux Mint 18.2 Sonya
Repos:     Active apt sources in file: /etc/apt/sources.list.d/additional-repositories.list
           deb http://apt.llvm.org/xenial/llvm-toolchain-xenial-5.0 main
           deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main
           Active apt sources in file: /etc/apt/sources.list.d/official-package-repositories.list
           deb http://packages.linuxmint.com sonya main upstream import backport #id:linuxmint_main
           deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse
           deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse
           deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
           deb http://archive.canonical.com/ubuntu/ xenial partner
Many thanks,
Andrew

User avatar
karlchen
Level 20
Level 20
Posts: 11532
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Difficulty installing LLVM/Clang (newbie)

Post by karlchen » Mon Oct 02, 2017 3:11 pm

Hi, Andrew.

It is a missing space character (field separator) in line 1. :)

Code: Select all

Repos:     Active apt sources in file: /etc/apt/sources.list.d/additional-repositories.list
           deb http://apt.llvm.org/xenial/llvm-toolchain-xenial-5.0 main
           deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main
In the second line there is a space character before llvm-toolchain-xenial-5.0. (correct)
In the first line there is no space character before llvm-toolchain-xenial-5.0. (wrong) => Add it.

Second mistake: Both lines specify "deb" as their type. But from your initial post it seems you want it to be "deb" and "deb-src".

Code: Select all

gksudo xed /etc/apt/sources.list.d/additional-repositories.list
This will load the file into your editor xed with root permissions.

Correct line 1 to read deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main
Change line 2 to read deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main
Save the file.
Exit from xed.
The error should be gone.
sudo apt-get update should succeed.
sudo apt-get install <packagename> should succeed.

Regards,
Karl
Image
Linux Mint 19.2 64-bit Cinnamon, Total Commander 9.22a 64-bit
Haß gleicht einer Krankheit, dem Miserere, wo man vorne herausgibt, was eigentlich hinten wegsollte. (Goethe)

Person from Porlock
Level 1
Level 1
Posts: 11
Joined: Mon Oct 02, 2017 2:21 pm

Re: Difficulty installing LLVM/Clang (newbie)

Post by Person from Porlock » Mon Oct 02, 2017 3:19 pm

Ha! Yes I realised I had done that so I had to run the command again :oops: .

I've made the correction and also deleted the second line (the duplicate)

ran sudo apt-get install and it looks like it worked!

Thanks very much. I will enjoy being a Linux user, with helpful people like yourself on hand.

Have a good day,
Andrew

geekwannabe
Level 1
Level 1
Posts: 3
Joined: Tue Feb 20, 2018 2:09 pm

Re: Difficulty installing LLVM/Clang (newbie)

Post by geekwannabe » Sat Mar 03, 2018 10:31 pm

In regards to LLVM/Clang....i have a coulple questions.
First what is the higest version of LLVM/clang that i can have on Linux Mint 17.1 (Rebecca)?
Second ....i read somewhere that the entire LLVM/clang "package" was about 20 GB. Is this true? If so.....
How can i get the entire package on my system?

Ok that was more than a couple.....
I am very new to linux and programming not just a Command LIne Power User, but also a Software Developer. I read that Clang gives great feed back for
human error. So i want to use this to learn. Thank you for whatever input that you have.

geekwannabe

Hoser Rob
Level 15
Level 15
Posts: 5670
Joined: Sat Dec 15, 2012 8:57 am

Re: Difficulty installing LLVM/Clang (newbie)

Post by Hoser Rob » Mon Mar 05, 2018 8:45 am

I cannot think of a WORSE way for a newbie to start learning programming than a kernel building project using C and C++ like this. Seriously, this is not meant for beginners ... most university CS programs don't introduce C programming until the 2nd year ... and dont't expect any guru support.

Start with something manageable like Perl or Python.

Post Reply

Return to “Software & Applications”