Last active
April 25, 2018 03:21
-
-
Save cell13/c6a58823c41060fe294e59b020656e31 to your computer and use it in GitHub Desktop.
linux日常管理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget -P /opt/src https://ftp.gnu.org/gnu/libc/glibc-2.14.tar.gz | |
cd /opt/src | |
tar -xzvf /opt/src/glibc-2.14.tar.gz | |
cd /opt/src/glibc-2.14 | |
mkdir build | |
cd build | |
../configure --prefix=/opt/glibc-2.14 | |
make -j4 | |
make -p /opt/opt/glibc-2.14 | |
touch /opt/opt/glibc-2.14/etc/ld.so.conf | |
make install | |
ln -s /opt/glibc-2.14 /opt/glibc | |
echo 'export LD_LIBRARY_PATH=/opt/glibc/lib:$LD_LIBRARY_PAT'>>/etc/profile | |
source /etc/profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#modify downloadpath to your path | |
#jreversion:9.0.1 | |
wget -P /opt/src http://downloadpath/serverjre-9.0.1_linux-x64_bin.tar.gz | |
tar -xzvf /opt/src/serverjre-9.0.1_linux-x64_bin.tar.gz -C /opt | |
echo 'export JAVA_HOME=/opt/jdk-9.0.1'>>/etc/profile | |
echo 'export JAVA_BIN=$JAVA_HOME/bin'>>/etc/profile | |
echo 'export JAVA_LIB=$JAVA_HOME/lib'>>/etc/profile | |
echo 'export PATH=$JAVA_BIN:$PATH'>>/etc/profile | |
source /etc/profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#linux内核升级脚本 | |
wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.13.3.tar.xz | |
xz -d linux-4.13.3.tar.xz && tar -xvf linux-4.13.3.tar | |
cd linux-4.13.3 | |
sudo yum groupinstall "Development Tools" | |
sudo yum install ncurses-devel | |
#如果你没有 X 环境,这一条可以不用 | |
sudo yum install qt-devel | |
sudo yum install hmaccalc zlib-devel binutils-devel elfutils-libelf-devel | |
cp /boot/config-2.6.32-431.el6.x86_64 .config | |
sh -c 'yes "" | make oldconfig' | |
make bzImage | |
make modules | |
make modules_install | |
#安装 | |
如果出现了 ERROR: modinfo: could not find module xxx,数量少的话,可以忽略。 | |
make install | |
#修改grub引导顺序 | |
vi /etc/grub.conf | |
数一下刚刚新安装的内核在哪个位置,从0开始,然后设置default为哪个数字,一般新安装的内核在第一个位置,所以设置 default=0 | |
#重启 | |
reboot | |
#使用 uname -r 命令查看下当前内核版本号 | |
uname -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version:2.7.13 | |
yum -y install xz | |
yum -y install gcc gcc-c++ | |
yum -y install openssl openssl-devel | |
wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz | |
xz -d Python-2.7.13.tar.xz | |
tar -xvf Python-2.7.13.tar | |
cd Python-2.7.13 | |
sed -i 's/# -DUSE_SSL/ -DUSE_SSL/' ./Modules/Setup.dist | |
sed -i 's/-L$(SSL)/\\ -L$(SSL)/' ./Modules/Setup.dist | |
./configure | |
make && make install | |
mv /usr/bin/python /usr/bin/python.bak | |
ln -s /usr/local/bin/python2.7 /usr/bin/python | |
wget http://bootstrap.pypa.io/get-pip.py | |
python get-pip.py | |
sed -i 's/#!\/usr\/bin\/python/#!\/usr\/bin\/python2.6/' /usr/bin/yum | |
pip install --upgrade pip setuptools |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment