Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to compile kernel in Ubuntu virtual machine

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to compile the kernel in the Ubuntu virtual machine". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. "Ctrl+Alt+T" enters the terminal, uses the command sudo passwd root to start the root account, restarts, and uses the su command to obtain root permission.

2. Install the software packages needed to compile the kernel

Copy the contents to the clipboard

# apt-get update

# apt-get install build-essential kernel-package libncurses5-dev fakeroot Select Y

3. Download 3.19.3 source code package and decompress it

Copy the contents to the clipboard

# wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.19.3.tar.xz

# tar-Jxvf linux-3.19.3.tar.xz

4. Configure the kernel

Copy the contents to the clipboard

# cd linux-3.19.3 (the cd command enters the source directory)

# make mrproper (after you get the source code, purify it)

# make menuconfig (configure kernel options without configuration, direct enter)

# cp / boot/config-'uname-r'-generic. / .config ('uname-r'-generic refers to the current version of kernel)

# make clean (delete some unused files left by the configuration)

5. Compile the kernel (it takes a long time, it took me two hours, please wait patiently)

Copy the contents to the clipboard

# make bzImage

# make modules (compiler module)

6. Install the new kernel

Copy the contents to the clipboard

# make modules_install (installation module)

# make install

7. Make a boot disk

Copy the contents to the clipboard

# sudo mkinitramfs 3.19.3-o / boot/initrd.img-3.19.3

Update grub2

Copy the contents to the clipboard

# sudo update-grub2

8. Restart and use the new kernel (not logout, restart)

Use the command # uname-r to view the kernel version

Note:

1. The thing to pay attention to is to be patient. When I compiled the kernel for the first time, I didn't know it would take a long time. When I compiled the module, I checked out directly.

2. If you strictly follow the steps above, you will definitely succeed. Of course, 3.19.3 is the kernel version I downloaded. All you have to do is change the version number.

This is the end of "how to compile the kernel in the Ubuntu virtual machine". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report