1. 程式人生 > >linux編譯核心make menuconfig報錯解決辦法

linux編譯核心make menuconfig報錯解決辦法

linux編譯核心時

輸入make menuconfig命令

*** Unable to find the ncurses libraries or the

*** required header files.

*** 'make menuconfig' requires the ncurses libraries.

***

*** Install ncurses (ncurses-devel) and try again.

***


上面提示缺少ncurses-devel

在ubuntu系統下執行

$sudo apt-get install ncurses命令

在linux下執行

#yum install ncurses ncurses-devel命令

此時如果提示

#yum install pam-devel

#This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Setting up Install Process

Nothing to do

意思是redhat 預設自帶的 yum 源需要註冊

解決方法:

第一步下載相關安裝包

可以通過http://mirrors.163.com/centos下載,這是筆者已經下載好的http://pan.baidu.com/s/1qW0MbgC(第三部中的安裝包)

第二步解除安裝Redhat自帶的yum

#rpm -qa | grep yum | xargs rpm -e --nodeps

第三步安裝下載的安裝包

#rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm

#rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

#rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

第四步到http://mirrors.163.com的 centos幫助文件 
中下載CentOS6-Base-163.repo檔案,存放到/etc/yum.repo.d中

#wget http://mirrors.163.com/.help/CentOS6-Base-163.repo(也可直接訪問該網址下載)

第五步將Centos6-Base-163.repo中的$releasever改為Centos的版本號即可

為了防止錯誤,也可使用我已修改好的檔案http://pan.baidu.com/s/1o6AZ23o

檔案修改成如下即可:(直接覆蓋原始文件)

# CentOS-Base.repo

#

# The mirror system uses the connecting IP address of the client and the

# update status of each mirror to pick mirrors that are updated to and

# geographically close to the client.  You should use this for CentOS updates

# unless you are manually picking other mirrors.

#

# If the mirrorlist= does not work for you, as a fall back you can try the

# remarked out baseurl= line instead.

#

#

[base]

name=CentOS-6 - Base - 163.com

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=os

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#released updates

[updates]

name=CentOS-6 - Updates - 163.com

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=updates

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful

[extras]

name=CentOS-6 - Extras - 163.com

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=extras

gpgcheck=1

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-6 - Plus - 163.com

baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=centosplus

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users

[contrib]

name=CentOS-6 - Contrib - 163.com

baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

#mirrorlist=http://mirrorlist.centos.org/?release=6&arch=$basearch&repo=contrib

gpgcheck=1

enabled=0

gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

第六步 

#yum clean all 清除原有快取

第七步 

#yum makecache  獲取yum列表

第七步

# yum update更新系統

後續步驟中出現提示選則Y即可(筆者安裝了400M的歌東西,並且進行了更新)

完成上述步驟後重新進入linux原始碼檔案,

執行#make menuconfig命令

此時提示缺少ncurses-devel

此時直接執行

yum install ncurses ncurses-devel

成功!!!