Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 104444  / 1 Year ago, sat, may 27, 2023, 12:31:10

I have a source tarball: ap-kernelmodule-1.0.14-13.tar.gz
I have to compile a kernel module out of it and was instructed to install development tools for my Ubuntu version (which is 12.10).
The format is: sudo apt-get install linux-headers-$(uname -r) build-essential



Question #1: what is uname?



(When I installed Ubuntu, I input sharon as my name and which is also my account name. Whenever I open a terminal window, the words sharon@sharon: appear)
Based on the format, I should input:



sudo apt-get install linux-headers-$(sharon -r) build-essential


or



sudo apt-get install linux-headers-$sharon -r build-essential


Question #2: Which of the above is correct?



(I am new to Linux and Ubuntu; hence detailed instructions are appreciated)


More From » 12.10

 Answers
3

Do not copy my commands, you must type them in and use your tab key becuase my kernel may be different than yours. I explain play by play:



Open up a terminal and type:



sudo apt-get update


This update gives your computer a heads up of files you may need. But no files download, only information on what can be downloaded. If you didn't do this first, you may not have the latest link to security updates or the latest versions of software.



As you type, press the tab key, to finish your command. Start typing the command that will install build-essential. Once you get this far stop:



sudo apt-get install linux-headers-


The next part that should appear will be your Linux kernel. So open another terminal and type this:



uname -r


You should see something like this:



3.2.0-23-generic


Now go back to the other terminal and press tab as type. You should see your kernel pop up. Choose that one.



sudo apt-get install linux-headers-3.2.0-23-generic


Now type a space and add build-essential (don't forget use your tab for completion).



sudo apt-get install linux-headers-3.2.0-23-generic build-essential


Now hit enter and files will download that help you compile code.


[#33542] Saturday, May 27, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
luringdge

Total Points: 3
Total Questions: 126
Total Answers: 109

Location: India
Member since Sun, Feb 6, 2022
2 Years ago
;