ubuntu下载当前版本内核源码

1
vi /etc/apt/sources.list

uncomment lines beginning with 'deb-src' and save, then

1
2
apt-get update
apt-get source linux-image-unsigned-$(uname -r)

refer to:
https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
https://stackoverflow.com/questions/45766719/error-during-ubuntu-kernel-source-download

cannot find -lbz2

ubuntu下编译源码出现错误

1
/usr/bin/ld: cannot find -lbz2

解决办法

1
apt-get install libbz2-dev