虛擬機安裝centos7後出現的問題
1. 安裝完後無法使用ifconifg,也無法使用yum
vim /etc/sysconfig/network-scripts/ifcfg-enp0s3 中
進入編輯模式,將 ONBOOT=no 改爲 ONBOOT=yes,就OK
保存後重啓網卡: service network restart
此時就可以上網了。(如果不知怎樣判斷能否上網,ping 一下網址就可以,就是這麼簡單,例如命令:ping www.baidu.com)
這樣yum,wget等等都可以用啦
安裝網絡工具:yum install net-tools -y
之後就可以用ifconfig了。
2. g++ 11
這個系統下直接執行
yum install gcc -y
yum install gcc-c++ -y
就安裝好了 gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
3. 安裝 lrzsz
yum install lrzsz
4. 安裝scons
先下載scons的安裝包,如 scons-2.2.0.tar.gz
解壓,進入執行:python setup.py install
5. 安裝protobuf
git clone
https://github.com/google/protobuf.git
yum install autoconf automake libtool -y
error: PB/reqinfo.pb.h:17:2: error: #error This file was generated by an older version of protoc which ......
如果出現上面錯誤,則將相應的pb重新生成一遍就好了。
6. 安裝. svn
yum install svn -y
[root@localhost johnson-dev]# svn co svn://119.xx.xx.21/trunk
Authentication realm: <svn://119.xx.xx.21:3690> /data/svn/repo
Password for 'root': de...0
Authentication realm: <svn://119.xx.xx.21:3690> /data/svn/repo
Username: johnson
Password for 'johnson': 123456M
7. 安裝zlib
yum install zlib
yum install zlib-devel (應該只要這一個就可以)
8. 下載安裝zeromq
下載安裝包,./configure make make install 經典安裝方法
9. 安裝boost
wget http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gztar xvf boost_1_53_0.tar.gzcd boost_1_53_0./bootstrap.shsudo ./b2 install
----------------------------------------------------------------------
之前用ubuntu都是apt-get install,centos沒有這個工具,用yum裝也差不多:
- yum install boost
- yum install boost-devel
- yum install boost-doc
10. 安裝openssl
sudo yum install openssl-devel
11. 安裝thrift
yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel openssl-devel
下載thrift-0.9.3.tar.gz,以當前新的爲準。
sudo ./configure
sudo make
sudo make install
注:collect2: error: ld returned 1 exit status 可以忽略掉
12 安裝bzip2
yum install bzip2 -y
13 安裝redis
獲取源碼、解壓、進入源碼目錄,編譯
$ wget http://download.redis.io/releases/redis-2.8.13.tar.gz
$ tar xzf redis-2.8.13.tar.gz
$ cd redis-2.8.13
$ make
測試、安裝
$ make-test
$ sudo make install
注意:解決 fatal error: hiredis/hiredis.h: No such file or directory 問題:
git clone
http://github.com/redis/hiredis
make && sudo make install && sudo ldconfig