CentOS {BANNED}最佳小化安装
注意:
1、以下安装的软件包,务必使用本文使用的版本,不要使用高版本!
2、升级后nis服务没法正常使用。
所有源码包均上传到/root/下。
1、关闭 selinux 和防火墙
sed -i '/^SELINUX/s/enforcing/disabled/' /etc/selinux/config
systemctl disable firewalld
systemctl stop firewalld
2、改用阿里的yum源
cd /etc/yum.repos.d/
rm -f CentOS*
curl -o /etc/yum.repos.d/CentOS-Base.repo
3、安装自带的软件包
yum -y groupinstall "Development tools"
yum -y install gmp-devel nss.x86_64 tk-devel
yum -y install zlib-devel bzip2-devel openssl-devel
yum -y install ncurses-devel sqlite-devel readline-devel
yum -y update binutils.x86_64
4、安装bison-3.2.1
cd
tar -zxf bison-3.2.1.tar.gz
cd bison-3.2.1
./configure --prefix=/usr/local/bison-3.2.1
make -j16
make install
mv /usr/bin/bison /usr/bin/bison_bak
ln -s /usr/local/bison-3.2.1/bin/bison /usr/bin/bison
bison -V
5、安装make-4.3
cd
tar -zxf make-4.3.tar.gz
cd make-4.3
./configure --prefix=/usr/local/make-4.3
make -j16
make install
mv /usr/bin/make /usr/bin/make_bak
ln -s /usr/local/make-4.3/bin/make /usr/bin/make
make -v
6、安装binutils-2.32
cd
tar -jxf binutils-2.32.tar.bz2
cd binutils-2.32
./configure --prefix=/usr/local/binutils-2.32
make -j16
make install
cd /usr/local/binutils-2.32/bin
./ld --version
mv /usr/bin/ld /usr/bin/ld_bak
mv /usr/bin/as /usr/bin/as_bak
ln -s /usr/local/binutils-2.32/bin/ld /usr/bin/ld
ln -s /usr/local/binutils-2.32/bin/as /usr/bin/as
7、安装gcc-8.5.0
cd
tar -zxf gcc-8.5.0.tar.gz
cd gcc-8.5.0
./contrib/download_prerequisites
mkdir build
cd build/
../configure --prefix=/usr/local/gcc-8.5.0 --enable-bootstrap --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j16
make install
mv /usr/bin/gcc /usr/bin/gcc_bak
ln -s /usr/local/gcc-8.5.0/bin/gcc /usr/bin/gcc
gcc -v
8、安装openssl-1.1.1
cd
#wget -c
tar -zxf openssl-1.1.1.tar.gz
cd openssl-1.1.1
./config --prefix=/usr/local/openssl
#./config --prefix=/usr/local/openssl shared zlib -fPIC
make -j16
make install
mv /usr/bin/openssl /usr/bin/openssl.bak
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
echo "/usr/local/openssl/lib" > /etc/ld.so.conf.d/openssl.conf
ldconfig -v
9、安装python 3.12.9
cd
tar -zxf Python-3.12.9.tgz
cd Python-3.12.9
./configure --prefix=/usr/local/python3
make -j16
make install
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
python3
10、安装glibc-2.29
cd
tar -zxf glibc-2.29.tar.gz
vi glibc-2.29/scripts/test-installation.pl
替换 128行,不修改后面会报错,但是升级后nis服务没法正常使用,可能和这有关。
-
&& $name ne "nss_test1" && $name ne "libgcc_s") {
为
-
&& $name ne "nss_test1" && $name ne "nss_test2" && $name ne "nss_nis" && $name ne "nss_nisplus" && $name ne "libgcc_s") {
cd glibc-2.29
mkdir build
cd build/
export LD_LIBRARY_PATH=
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make -j16
make install
完成。
阅读(281) | 评论(0) | 转发(0) |