目录http://see.sl 088.com/wiki/python _编译安装
[隐藏]
进一步研究
好处
它不会像安装yum等安装工具那样损害与原始系统的关联性(通常没有)
安装只需将文件放置在适当的位置
很有趣
可重复编译
不管编译多少次,看起来都和你在一起
我很困扰
如何卸载源代码安装?
可以卸载源代码安装吗?
经验
Centos5编译安装Python2.7
获取python2.7.4
[ root @ li84-236 app ] # wget http://www.python.org/FTP/python/2.7.4/python-2.7.4.tgz-- 2013-10 - 2001336088336020003360 d :3360 a2 connectingtowww.python.org|82.94.164.162 | :80 . connected.httprequeuer aiting response . 200 ok length :14489063 (14m ) [ application/x-tar ] saving to : python-2.7.4.tgz ' 100 % [=====================
解冻
tar zxvf Python-2.7.4.tgz
进入商品目录呢。 cd Python-2.7.4
[ root @ li84-236 app ] # CD python-2.7.4 [ root @ li84-236 python-2.7.4 ] # lsbuildconfigureincludemacmodulespyconfig.hreadmeconfig.guess configure.AC install-shmakefileobjectspyconfig.h.inri sigure ist all-s ake file.preparserpythonsetup.py config.statusdoclibpython 2.7.a makefile.pre.inpcpythontoolsconfig.subgragral
初始化编译配置的什么
./configure
这检查了很多东西
编译和安装
sudo make make安装
在这里,在make看起来成功后再执行
可能在这里结束
. running install _ scriptscopyingbuild/scripts-2.7/idle-/usr/local/tmdspcopyingbuild/scripts-2.7/smtpd tmdspcopyingbuild/scripts-2.7/pydoc--/usr/local/tmdspchangingmodeof/usr/local/tmdsp/smtpd.pyto 7555 2 to3to 755 changingmodeof/usr/local/tmdsp/pydoc to 755 running install _ egg _ info writing/usr/local/lib/python 2.7 (elsetrue; fi(CD/usr/local/tmdsp; ln-s python2python (RM-f/usr/local/tmdsp/python2) CD/usr/local/tmdsp; ln -s python2.7 python2) RM-f/usr/local/tmdsp/python2- config (CD/usr/local/tmdsp; ln-s python 2.7-config python2- config (RM-f/usr/local/tmdsp/python-config ) CD/usr/local/tmdsp; ln-s python2- config python-config (test-d/usr/local/lib/pkgconfig||/usr/tmdsp/install-c-d-m755/) python.PC ) CD/usr/local/lib/pkgconfig/pkgconfig ln-s python2. pcpython.PC (RM-f/usr/local/share/man ) man1ln-s python2.7.1python 2.1 (RM-f/usr/local/share/man/man1/python.1 ) CD/usr/local/share/man/1
编译到此为止,安装完成了
安装后的位置
[ root @ li84-236 python-2.7.4 ] #/usr/local/tmdsp/python 2.7 python2.7.4(默认,oct 82013,183:173666
Linux上的is not in the sudoers file解决方法
当我们使用sudo命令切换用户时,可能会显示以下错误消息: xxxisnotinthesudoersfile.thisincidentwillbereported,XXX是您的当前用户名,原因是用户未加入sudo的配置文件
vi/vim
切换到根用户,然后运行visudo命令
2
在打开的配置文件中,找到根全部=(all )全部,然后在下面添加一行
xxx ALL=(ALL ) ALL其中xxx是您加入的用户名
3
如果输入:wq保存配置式并退出,然后再次使用sudo命令,将不再显示上述提示。
sudo : can ' topen/etc/sudoers 3360 permission denied解决方案: chmod -R 0440 /etc/sudoers.d或chmod u-w /etc/sudoers
sudo lsattr /etc/sudoers
I看有无属性
假设有sudo chattr -i /etc/sudoers