CentOS装机必备-基本设置以及缺失文件
SecureCRT中注意不要使用以Ascii方式上傳文件,只有在需要的地方才使用。
?
主要是虛擬機中安裝CentOS每次總會做一些設置,記錄下來方便以后。
純粹基本設置,比如本地SecureCRT可以連接虛擬機中的CentOS。
復雜的非基本設置見:Linux? 命令集錦
?
安裝缺失文件
下載上傳命令
rz: command not found
# yum -y install lrzsz? ??
--------------------------------------------
安裝C語言編譯器gcc
cc: command not found
#yum -y install gcc
說明:-y說明安裝直接選擇yes
--------------------------------------------
安裝C++編譯器
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.
#yum install gcc gcc-c++
--------------------------------------------
安裝解壓縮命令
#yum install -y unzip zip
=========================
本地windows上傳shell到Linux不能執行
# yum install -y dos2unix
# yum install unix2dos
=========================
修改yum源
添加 yum 源
centos 推薦使用epel源
centos使用網易163的源和自動匹配源插件yum-fastestmirror
//先備份原來的設置,做什么修改之前都要有的習慣
# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
網易centos幫助:? http://mirrors.163.com/.help/centos.html
CentOS-6
# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo -O /etc/yum.repos.d/CentOS-Base.repo
# yum makecache
yum-fastestmirror插件自動選擇最快的yum源。
?
安裝方法如下:
centos5:
# yum -y install yum-fastestmirror
?
安裝之后,生成配置文件/etc/yum/pluginconf.d/fastestmirror.conf。配置文件中的hostfilepath字段,用于定義yum源的配置文件(通常是/var/cache/yum/timedhosts.txt),然后我們就可以將所知道的yum源統統寫入這個txt文件,如:
?
ftp.nsysu.edu.tw
mirror01.idc.hinet.net
mirror.khlug.org
centos.vr-zone.com
ftp.stu.edu.tw
ftp.cse.yzu.edu.tw
mirror.yongbok.net
mirrors.btte.net
mirrors.sin1.sg.voxel.net
ftp.daum.net
ftp.isu.edu.tw
mirrors.163.com
mirror.neu.edu.cn
mirrors.ta139.com
ftp.oss.eznetsols.org
centos.mirror.cdnetworks.com
centos.tt.co.kr
ftp.tc.edu.tw
ftp.twaren.net
mirror.averse.net
mirror.nus.edu.sg
data.nicehosting.co.kr
?
當然,如果你的yum版本比較高,會系統會自動將常用的yum源寫入此文件。
?
這樣,以后我們在yum安裝rpm包的時候,就可以讓yum自己去選擇yum源了。
目前公認較快的yum源是網易的:mirrors.163.com。
?
-----------------------------------------
如果yum源沒有直接下載到本地
#yum localinstall 文件
?
下載rpm
#rpm -i 文件
-------------------------------------------
安裝telnet
#yum -y install telnet
--------------------------------------------
安裝lua
#yum -y install lua
#yum -y?install lua-devel
----------------------------------------
phpize時提示
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
# wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
# tar -zvxf autoconf-2.62.tar.gz
# cd autoconf-2.62/
# ./configure && make && make install
---------------------------------------------
?getcwd: cannot access parent directories的解決方法
getcwd 命令無法定位到當前工作目錄。一般來說是因為你 cd 到了某個目錄之后 rm 了這個目錄
這時去執行某些 service 腳本的時候就會報 getcwd 。
只需要 cd 到任何一個實際存在的目錄下在執行命令即可。
出現這種現象的原因還有,當前用戶沒有當前目錄的可執行權限
----------------------------------------------
設置網絡
自動連接
#cat /etc/sysconfig/network-scripts/ifcfg-eth0 ONBOOT=yes
?
重啟網卡
#service network restart
?------------------------------------------
總結
以上是生活随笔為你收集整理的CentOS装机必备-基本设置以及缺失文件的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 求一个微信成熟男人个性签名。
- 下一篇: 奔驰e260车的大标坏了换一个多少钱