今天需要配置ubuntu无人值守自动安装,在配置到kickstart时,那个kickstart图形界面无法出来
首先安装system-config-kickstart 软件包,这一步没什么错
shell> apt-get install system-config-kickstart
安装完成之后,启动system-config-kickstart时报错
shell> system-config-kickstart
#错误信息如下
Traceback (most recent call last):
File"/usr/share/system-config-kickstart/system-config-kickstart.py", line 92, in<module>
kickstartGui.kickstartGui(file)
File"/usr/share/system-config-kickstart/kickstartGui.py", line 135, in__init__
self.packages_class =packages.Packages(xml, self.kickstartData)
File"/usr/share/system-config-kickstart/packages.py", line 107, in__init__
importpackageGroupList
File"/usr/share/system-config-kickstart/packageGroupList.py", line 69, in<module>
comps_file =apt_comps()
File"/usr/share/system-config-kickstart/packageGroupList.py", line 46, in__init__
availparse =apt_pkg.ParseTagFile(availfile)
AttributeError: 'module'objecthas no attribute 'ParseTagFile'
谷歌了一下,好像是这个软件包的bug,七拼八凑终于把问题解决了
#解决步骤:
复制下面这段代码,然后保存文件名为sck_pkgGL_Patch文件在当前目录下
--- /home/selven/packageGroupList.py.orig 2013-12-11 14:36:50.236478915 +0400 +++ /usr/share/system-config-kickstart/packageGroupList.py 2013-12-11 14:47:21.976475840 +0400 @@ -43,10 +43,10 @@ os.execlp("apt-cache", "apt-cache", "dumpavail") os.waitpid(pid, 0) availfile.seek(0) - availparse = apt_pkg.ParseTagFile(availfile) - while availparse.Step() == 1: - if availparse.Section.has_key("Task"): - task = availparse.Section["Task"] + availparse = apt_pkg.TagFile(availfile) + while availparse.step() == 1: + if availparse.section.has_key("Task"): + task = availparse.section["Task"] if not self.groups.has_key(task): if apt_group_names.has_key(task): taskname = apt_group_names[task]
然后,执行下面这条命令
shell> sudo patch -b -p1 < sck_pkgGL_Patch
#出现下面提示找不到文件,让手动输入文件位置
File to patch:
#输入的文件就是上面启动system-config-kickstart时报错的那个文件,如下
/usr/share/system-config-kickstart/packageGroupList.py
OK!,到这儿图形界面就可以出来了