Centos环境搭建
Centos环境搭建

Centos环境搭建

Centos使用环境 (全程root用户下运行)

镜像

http://mirrors.aliyun.com/centos/8-stream/isos/x86_64/

http://ftp.sjtu.edu.cn/centos/7.9.2009/isos/x86_64/

自动时间校对

# 安装
yum install -y ntp

# 校准
ntpdate pool.ntp.org

# 启动服务
systemctl start ntpd
systemctl enable ntpd

切换默认登陆用户

#默认root登陆
vim /etc/gdm/custom.conf
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=root


#修改用户密码
passwd root
passwd user

reboot

换源

# curl -o 或 wget -O

#网易
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

#腾讯
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.cloud.tencent.com/repo/epel-7.repo

#阿里
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

yum clean all
yum makecache

字体修改

yum install -y fontconfig mkfontscale

mkdir -p /usr/share/fonts/Chinese
cd /usr/share/fonts/Chinese
#拷贝字体文件
chmod -R 755 /usr/share/fonts/Chinese

#重建字体缓存
mkfontscale
mkfontdir
fc-cache

显卡安装

./NVIDIA-Linux-x86_64-525.60.11.run -no-x-check

报错1

The Nouveau kernel driver is currently in use by your system. This driver is incompatible with the NVIDIA driver, and must be disabled before proceeding. Please consult the NVIDIA driver README and your Linux distribution’s documentation for details on how to correctly disable the Nouveau kernel driver.

#关闭 nouveau
echo -e "blacklist nouveau\noptions nouveau modeset=0" > /etc/modprobe.d/blacklist.conf
reboot
lsmod | grep nouveau

报错2

An NVIDIA kernel module ‘nvidia-drm’ appears to already be loaded in your kernel.

#先卸载再重启
./NVIDIA-Linux-x86_64-525.60.11.run --uninstall

添加源

http://mirrors.ustc.edu.cn/help/epel.html

#sed -e 's|^metalink=|#metalink=|g' -e 's|^#baseurl=https\?://download.fedoraproject.org/pub/epel/|baseurl=https://mirrors.ustc.edu.cn/epel/|g' -e 's|^#baseurl=https\?://download.example/pub/epel/|baseurl=https://mirrors.ustc.edu.cn/epel/|g' -i.bak /etc/yum.repos.d/epel.repo

#epel
#mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.bak
#wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

#epel
yum install -y epel-release
yum install -y https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm

修改hostname,打通ssh

echo "xxxxx">/etc/hostname

sudo vi /etc/hosts
192.168.1.200   QL-200
192.168.1.201   QL-201
192.168.1.202   QL-202

# 生成密钥
ssh-keygen
# 上传公钥
ssh-copy-id 目标服务器的别名

1.常用环境

mkdir -p /opt/env
mkdir -p /opt/soft
mkdir -p /opt/download

yum install -y vim git wget gcc gdb strace gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs patch e2fsprogs-devel krb5-devel libidn libidn-devel openldap-devel nss_ldap openldap-clients openldap-servers libevent-devel libevent uuid-devel uuid mysql-devel ntfs-3g make ca-certificates cmake vlc gstreamer-ffmpeg gstreamer-plugins-bad gstreamer-plugins-ugly gstreamer1-libav texinfo ruby tcl unzip p7zip p7zip-plugins tree java-1.8.0-openjdk-devel net-tools
yum -y update

#硬盘格式支持(epel源下的包)
#rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
#rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum install -y exfat-utils fuse-exfat ntfs-3g

#关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service

2.SVN

sudo yum install -y subversion

svn checkout https://192.168.1.11/svn/ZhxcWeb --username QL --password xxxxxxx
sudo chmod -R 777 *

3.JetBrains IDE

https://www.jetbrains.com/products/

https://download.jetbrains.com.cn/webstorm/WebStorm-2021.2.2.tar.gz

https://download.jetbrains.com.cn/datagrip/datagrip-2021.2.2.tar.gz

https://download.jetbrains.com.cn/idea/ideaIU-2021.2.2.tar.gz (旧 https://download.jetbrains.com/idea/ideaIU-2021.2.2.tar.gz)

mkdir -p /opt/download
mkdir -p /opt/soft/
wget https://download.jetbrains.com.cn/idea/ideaIU-2021.2.2.tar.gz -O /opt/download/ideaIU-2021.2.2.tar.gz
tar -zxvf /opt/download/ideaIU-2021.2.2.tar.gz -C /opt/soft/
#启动
sudo bash /opt/soft/idea-IU-212.5284.40/bin/idea.sh

wget https://download.jetbrains.com.cn/webstorm/WebStorm-2021.2.2.tar.gz -O /opt/download/WebStorm-2021.2.2.tar.gz
tar -zxvf /opt/download/WebStorm-2021.2.2.tar.gz -C /opt/soft/
#启动
sudo bash /opt/soft/WebStorm-212.5284.41/bin/webstorm.sh


#激活(30天无限试用 2021.2.2前使用此方法)
#添加插件源
https://plugins.zhile.io
#安装  evalreset  插件

Maven

https://dlcdn.apache.org/maven/maven-3

wget https://dlcdn.apache.org/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.tar.gz -O /opt/download/apache-maven-3.5.4-bin.tar.gz
tar -zxvf /opt/download/apache-maven-3.5.4-bin.tar.gz -C /opt/env/
#环境变量
echo "export PATH=/opt/env/apache-maven-3.5.4/bin:\$PATH" >> /etc/profile
source /etc/profile

mvn -v

#换源/更改下载位置
mkdir -p /opt/env/apache-maven-3.5.4/repo
vi /opt/env/apache-maven-3.5.4/conf/settings.xml

<localRepository>/opt/env/apache-maven-3.5.4/repo</localRepository>
<mirrors>
    <mirror>
        <id>aliyunmaven</id>
        <mirrorOf>*</mirrorOf>
        <name>阿里云公共仓库</name>
        <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
</mirrors>

中文报错

https://www.oracle.com/java/technologies/downloads/#java11

#登陆,下载  jdk11  jdk-11.0.18_linux-x64_bin.tar.gz
tar -vxf /opt/download/jdk-11.0.18_linux-x64_bin.tar.gz -C /opt/env/

#修改IDE启动配置
vim /opt/soft/idea-IU-212.5284.40/bin/idea.sh
#此行根据原来的  XXXX_JDK  填写
export IDEA_JDK=/opt/env/jdk-11.0.18
export XIM="ibus"
export XIM_PROGRAM="ibus"
export XMODIFIERS="@im=ibus"
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"

4. redis

https://redis.io/download/#redis-downloads

wget https://download.redis.io/releases/redis-5.0.14.tar.gz -O /opt/download/redis-5.0.14.tar.gz

mkdir -p /opt/env/
tar -zxvf /opt/download/redis-5.0.14.tar.gz -C /opt/env/

cd /opt/env/redis-5.0.14
make && make install

#环境变量
ln -s /opt/env/redis-5.0.14/src/redis-server /usr/bin/redis-server
ln -s /opt/env/redis-5.0.14/src/redis-cli /usr/bin/redis-cli

#自定义配置
mkdir -p /usr/local/redis
\cp /opt/env/redis-5.0.14/redis.conf /usr/local/redis

vi /usr/local/redis/redis.conf
daemonize yes   #后台运行
protected-mode no   #打开外网访问



#添加启动项
\cp /opt/env/redis-5.0.14/utils/redis_init_script /etc/init.d/redis
vi /etc/init.d/redis

#在首行  /bin/sh 下添加下方两行注释  
# chkconfig: 2345 10 90  
# description: Start and Stop redis

#修改配置项
CONF=/usr/local/redis/redis.conf


#运行
#redis-server /usr/local/redis/redis.conf
systemctl start redis

#连接测试
redis-cli -h 127.0.0.1 -p 6379
ping
#>pong
quit

#查看进程
ps -ef | grep redis
#查看服务
systemctl -l | grep redis

集群配置

环境初始化

yum install -y tcl
mkdir -p /data/redis-cluster
\cp /opt/env/redis-5.0.14/redis.conf /data/redis-cluster

集群配置文件

echo "
port 7000
#设置后台运行
daemonize yes
#设置pidfile存放在 run目录下的文件名
pidfile  /data/redis-cluster/redis.pid
#指定数据文件存放位置,必须要指定不同的目录位置,不然会丢失数据
dir /data/redis-cluster/
#设置开启rbd持久化模式
save 900 1
save 300 10
save 60 100
dbfilename redis.rdb
#启动集群
cluster-enabled yes
#关联集群节点信息文件
cluster-config-file /data/redis-cluster/nodes.conf
#设置超时
cluster-node-timeout 5000
#关闭保护模式
protected-mode no
#日志信息,可有可无
logfile /data/redis-cluster/redis.log
#指定ip访问的地址,设置0.0.0.0 默认是全部地址,不设置,后面会连接不上的
bind 0.0.0.0
">/data/redis-cluster/redis.conf

添加自启服务

echo "
[Unit]
Description=redis-cluster
After=syslog.target network.target

[Service]
Type=forking
NotifyAccess=all
TimeoutStartSec=600
LimitNOFILE=32768
Restart=on-failure
RestartSec=10
ExecStart=/usr/bin/redis-server /data/redis-cluster/redis.conf
ExecStop=/usr/bin/redis-cli -p 7000 shutdown

[Install]
WantedBy=multi-user.target">/usr/lib/systemd/system/redis-cluster.service

#设置服务自启动
systemctl enable redis-cluster.service
#启动服务
systemctl start redis-cluster.service


#PS:
#手动启动
/usr/bin/redis-server /data/redis-cluster/redis.conf

#关闭服务自启动
systemctl disable redis-cluster.service

#停止服务
systemctl stop redis-cluster.service
#重启服务
systemctl restart redis-cluster.service
#服务状态
systemctl status redis-cluster.service
#查找服务
systemctl list-units --type=service | grep redis-cluster*

#进程
ps -ef | grep redis-server
ps -ef | grep 7000

启动并管理集群

#最少  三主三从  
#将配置并启动好的redis加入集群  7000 7001      
redis-cli --cluster create --cluster-replicas 1 192.168.1.180:7000 192.168.1.180:7001 192.168.1.182:7001 192.168.1.182:7000 192.168.1.183:7000 192.168.1.183:7001
# 根据提示输入yes

#测试集群
redis-cli -p 7000
#查看集群健康状态
cluster info
#查看节点健康状态
cluster nodes

重建集群

#随意连接一台设备
redis-cli -p 7000
#清空集群,以便重建
cluster reset

#重开终端,重建集群
redis-cli --cluster create --cluster-replicas 1 192.168.1.180:7000 192.168.1.180:7001 192.168.1.182:7001 192.168.1.182:7000 192.168.1.183:7000 192.168.1.183:7001

#常用命令
#查看redis服务列表
systemctl -a | grep redis-cluster*
#失败服务列表
systemctl --failed
#清除失败服务
systemctl reset-failed
#检查集群node状态
redis-cli --cluster check 127.0.0.1:7000
#修复节点
redis-cli --cluster fix 127.0.0.1:7000
#重载服务配置
systemctl daemon-reload
#重启服务
systemctl restart redis-cluster_7000.service
#开启自启
systemctl enable redis-cluster-7000.service
#查看进程
ps -ef | grep redis-server

管理工具

1.Another-Redis-Desktop-Manager

https://github.com/qishibo/AnotherRedisDesktopManager

mkdir -p /opt/soft/Another-Redis-Desktop-Manager/
wget https://ghproxy.com/https://github.com/qishibo/AnotherRedisDesktopManager/releases/download/v1.5.9/Another-Redis-Desktop-Manager.1.5.9.AppImage -O /opt/soft/Another-Redis-Desktop-Manager/Another-Redis-Desktop-Manager.1.5.9.AppImage
chmod +x /opt/soft/Another-Redis-Desktop-Manager/Another-Redis-Desktop-Manager.1.5.9.AppImage

#桌面快捷方式
vi /usr/share/applications/Another-Redis-Desktop-Manager.desktop

[Desktop Entry]
Name=Another-Redis-Desktop-Manager
Exec=/opt/soft/Another-Redis-Desktop-Manager/Another-Redis-Desktop-Manager.1.5.9.AppImage --no-sandbox
Terminal=false
Type=Application
StartupNotify=true

5. gcc/glibc 升级

gcc

#yum install -y centos-release-scl
#yum install -y devtoolset-9-gcc*
#scl enable devtoolset-9 bash
#gcc -v

#wget http://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz -O /opt/download/gcc-11.2.0.tar.gz
wget https://mirrors.aliyun.com/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.gz -O /opt/download/gcc-11.2.0.tar.gz
tar -zxvf /opt/download/gcc-11.2.0.tar.gz -C /opt/env
cd /opt/env/gcc-11.2.0
./contrib/download_prerequisites
mkdir build
cd build/
../configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
make -j8 && make install

#验证(新开终端)
gcc -v
#gcc 版本 11.2.0

#检查系统libstdc,须包含CXXABI_1.3.8及以上
strings /lib64/libstdc++.so.6 | grep CXXABI

#如果不是,请执行以下步骤
#查找设备上安装好的so
#find /usr/local/lib64/ -name "libstdc++.so.6*"
#没有请建立软链接
sln /usr/local/lib64/libstdc++.so.6.0.29 /usr/lib64/
sln /usr/lib64/libstdc++.so.6.0.29 /usr/lib64/libstdc++.so.6


#升级失败,修复
yum -y reinstall gcc
#ll /usr/lib64/libstd*
#sln /usr/lib64/libstdc++.so.6.0.19 /usr/lib64/libstdc++.so.6

glibc

https://blog.csdn.net/carefree2005/article/details/117559312

#不建议,更新失败就得炸(切记先开一个文件管理)
wget http://ftp.gnu.org/gnu/glibc/glibc-2.20.tar.gz -O /opt/download/glibc-2.20.tar.gz
tar -zxvf /opt/download/glibc-2.20.tar.gz -C /opt/env
cd /opt/env/glibc-2.20
mkdir build
cd build/
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make -j8 && make install

#验证,须包含GLIBC_2.1.8及以上
strings /lib64/libc.so.6 | grep GLIBC_*

#升级失败,修复(切勿关闭文件管理)
使用图形界面删除/lib64/libc.so.6
复制 /usr/lib64/libc.so-2.17 到 /usr/lib64/libc.so.6
#sln /usr/lib64/ld-2.17.so /usr/lib64/ld-linux-x86-64.so.2
#sln /usr/lib64/libc-2.17.so /usr/lib64/libc.so.6

报错或安装失败导致爆炸后恢复

checking whether the C compiler works... no
configure: error: C compiler cannot create executables
See "config.log" for more details

#gcc -v
#ldd --version

#先删干净gcc库(gcc安装失败)
which gcc
rm -rf /usr/lib64/ccache/gcc
which gcc
rm -rf /usr/local/bin/gcc
which gcc
rm -rf /usr/bin/gcc
which gcc

#ll /usr/lib64/libc.so*
#ll /usr/lib64/ld-*

#查找是否有多余的库,并卸载
rpm -qa | grep glibc 
#yum remove glibc-aarch64-linux-gnu-2.24-2.sdl7.2.noarch

#查找系统上安装的库
yum list installed | grep g++
yum list installed | grep gcc
yum list installed | grep glibc

#重装基础环境
yum reinstall -y gcc gdb gcc-c++ glibc glibc-devel glib2 glib2-devel libidn libidn-devel make cmake binutils

#重启

6. navicat

此内容查看价格为66.66QL币立即购买
客服: 273641837

7. ansible

yum install -y epel-release 
yum install -y ansible 

8. vscode

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
yum check-update
yum install code


#快捷方式在    应用程序->编程
#运行无响应,报错
[0130/111436.102914:FATAL:electron_main_delegate.cc(303)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

#在快捷方式启动项中添加     --no-sandbox

9. utools(不可用)

yum install alien -y
wget https://res.u-tools.cn/version2/utools_3.3.0_amd64.deb -O /opt/soft/utools_3.3.0_amd64.deb
cd /opt/soft
alien -rv utools_3.3.0_amd64.deb -g

vim ./utools-3.3.0/utools-3.3.0-2.spec
Summary: 0

cd utools-3.3.0; rpmbuild --buildroot='/opt/soft/utools-3.3.0' -bb --target x86_64 'utools-3.3.0-2.spec' 2>&1

#安装
rpm -Uvh /opt/soft/utools-3.3.0-2.x86_64.rpm --force

#报错(暂时无法解决)
libpng16.so.16()(64bit) 被 utools-3.3.0-2.x86_64 需要
libpng16.so.16(PNG16_0)(64bit) 被 utools-3.3.0-2.x86_64 需要
libstdc++.so.6(CXXABI_1.3.9)(64bit) 被 utools-3.3.0-2.x86_64 需要
libstdc++.so.6(GLIBCXX_3.4.21)(64bit) 被 utools-3.3.0-2.x86_64 需要

#https://github.com/madler/zlib
cd /opt/env/
git clone https://ghproxy.com/https://github.com/madler/zlib.git
cd zlib
./configure && make && make install

#https://github.com/glennrp/libpng
cd /opt/env/
git clone https://ghproxy.com/https://github.com/glennrp/libpng.git
cd libpng
./configure && make && make install



yum provides libpng16.so.16 
yum install -y libstdc++-4.8.5-44.el7.x86_64

10. qq(不可用)

https://im.qq.com/linuxqq/index.shtml

wget https://dldir1.qq.com/qqfile/qq/QQNT/c005c911/linuxqq_3.0.0-571_x86_64.rpm -O /opt/download/linuxqq_3.0.0-571_x86_64.rpm
rpm -Uvh /opt/download/linuxqq_3.0.0-571_x86_64.rpm

#Libgcrypt.so.20
wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/atomic-release-1.0-20.el7.art.noarch.rpm -O /opt/download/atomic-release-1.0-20.el7.art.noarch.rpm
rpm -Uvh /opt/download/atomic-release-1.0-20.el7.art.noarch.rpm

wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/atomic-libgcrypt-1.8.4-2.el7.x86_64.rpm -O /opt/download/atomic-libgcrypt-1.8.4-2.el7.x86_64.rpm
rpm -Uvh /opt/download/atom
ic-libgcrypt-1.8.4-2.el7.x86_64.rpm


wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/atomic-libgpg-error-1.33-6790.el7.art.x86_64.rpm -O /opt/download/atomic-libgpg-error-1.33-6790.el7.art.x86_64.rpm
rpm -Uvh /opt/download/atomic-libgpg-error-1.33-6790.el7.art.x86_64.rpm

10. apipost

https://www.apipost.cn/download.html

#适用于Linux系统,x64架构(deb包) 
wget https://dlcdn.apipost.cn/dl/7.0.15/apipost_linuxgz_x64_7.0.15.tar.gz?auth_key=1675227721-0-0-b84fbe15bc435c9293057e83e868b293 -O /opt/download/apipost_linuxgz_x64_7.0.15.tar.gz
tar -zxvf /opt/download/apipost_linuxgz_x64_7.0.15.tar.gz -C /opt/soft/
mv -f /opt/soft/linux-unpacked /opt/soft/apipost

vi /usr/share/applications/Apipost7.desktop

[Desktop Entry]
Name=Apipost7
Name[zh_CN]=Apipost7
Exec=/opt/soft/apipost/apipost7 --no-sandbox
Icon=/opt/soft/apipost/resources/app/icon/linux-borders/play_store.png
Terminal=false
Type=Application
StartupNotify=true

12. nodejs(不建议,直接安装WebStome)

https://help.aliyun.com/document_detail/50775.html

#更新make
wget http://ftp.gnu.org/pub/gnu/make/make-4.3.tar.gz -O /opt/download/make-4.3.tar.gz
tar -zxvf /opt/download/make-4.3.tar.gz -C /opt/env/
cd /opt/env/make-4.3
./configure --prefix=/usr
make && make install


#查看glibc版本
strings /lib64/libc.so.6 | grep GLIBC
#更新glibc
wget https://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz -O /opt/download/glibc-2.28.tar.gz
tar -xzvf /opt/download/glibc-2.28.tar.gz -C /opt/env/
cd /opt/env/glibc-2.28
mkdir build && cd build
../configure --prefix=/opt/env/glibc-2.28 --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin --libexecdir=/usr/lib
make && make install

git clone https://github.com/cnpm/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
echo ". ~/.nvm/nvm.sh" >> /etc/profile
source /etc/profile

#列出所有版本
nvm list-remote

#安装 16.18.1 版本
nvm install v16.18.1
#切换版本
nvm use v16.18.1

#查看安装版本
nvm ls

13. Typora

https://typoraio.cn/#linux

wget https://download2.typoraio.cn/linux/.tar.gz  -O /opt/download/Typora-linux-x64.tar.gz
mkdir -p /opt/soft/Typora
tar -xvf /opt/download/Typora-linux-x64.tar.gz -C /opt/soft/Typora
mv /opt/soft/Typora/bin/Typora-linux-x64/* /opt/soft/Typora
rm -rf /opt/soft/Typora/bin

#快捷方式
vi /usr/share/applications/Typora.desktop
[Desktop Entry]
Categories=Application;TextEditor;WordProcessor;
Comment=Beautiful Markdown Editor
Encoding=UTF-8
Exec=/opt/soft/Typora/Typora --no-sandbox %F
Icon=/opt/soft/Typora/resources/assets/icon/icon_512x512.png
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-patch;text/x-adasrc;text/x-chdr;text/x-csrc;text/css;application/x-desktop;text/x-patch;text/x-fortran;text/html;text/x-java;text/x-tex;text/x-makefile;text/x-objcsrc;text/x-pascal;application/x-perl;application/x-perl;application/x-php;text/vnd.wap.wml;text/x-python;application/x-ruby;text/sgml;application/xml;model/vrml;image/svg+xml;application/json;
Name=Typora
Name[en]=Typora
Name[en_US]=Typora
Terminal=false
Type=Application
X-Deepin-Vendor=user-custom

#chown root chrome-sandbox
#chgrp root chrome-sandbox
#chmod 4755 chrome-sandbox

#破解 全版本(<=1.5.9) Typora_NodeInject.tar.bz2
#注入
/opt/soft/Typora/node_inject
#启动
/opt/soft/Typora/Typora
#算号,激活
/opt/soft/Typora/license-gen

14. Git升级

yum remove -f git

#方案1
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.30.0.tar.xz -O /opt/download/git-2.30.0.tar.xz
tar -vxf /opt/download/git-2.30.0.tar.xz -C /opt/env/
cd /opt/env/git-2.30.0
make prefix=/usr/local/git all
make prefix=/usr/local/git install
echo "export PATH=/usr/local/git/bin:\$PATH" >> /etc/profile
source /etc/profile

#方案2
yum install \
https://repo.ius.io/ius-release-el7.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum install git236


git --version

15. JDK

1.oracle

https://www.oracle.com/java/technologies/downloads/#java17
https://www.oracle.com/java/technologies/downloads/#java11
https://www.oracle.com/java/technologies/downloads/#java8

wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz -O /opt/download/jdk-17_linux-x64_bin.tar.gz
tar -vxf /opt/download/jdk-17_linux-x64_bin.tar.gz -C /opt/env/
#/opt/env/jdk-17.0.6/bin

2.OpenJDK

https://jdk.java.net/19/

https://jdk.java.net/java-se-ri/8-MR4

wget https://download.java.net/java/GA/jdk19.0.2/fdb695a9d9064ad6b064dc6df578380c/7/GPL/openjdk-19.0.2_linux-x64_bin.tar.gz -O /opt/download/openjdk-19.0.2_linux-x64_bin.tar.gz
tar -vxf /opt/download/openjdk-19.0.2_linux-x64_bin.tar.gz -C /opt/env/


wget https://download.java.net/openjdk/jdk8u42/ri/openjdk-8u42-b03-linux-x64-14_jul_2022.tar.gz -O /opt/download/openjdk-8u42-b03-linux-x64-14_jul_2022.tar.gz
tar -vxf /opt/download/openjdk-8u42-b03-linux-x64-14_jul_2022.tar.gz -C /opt/env/
#/opt/env/java-se-8u42-ri/bin

环境变量

echo -e "export JAVA_HOME=/opt/env/java-se-8u42-ri\n    export JRE_HOME=\$JAVA_HOME/jre\n   export CLASSPATH=\$JAVA_HOME/lib:\$JRE_HOME/lib:\$CLASSPATH \nexport PATH=\$JAVA_HOME/bin:\$JRE_HOME/bin:\$PATH" >> /etc/profile
source /etc/profile

16. LibreOffice

https://zh-cn.libreoffice.org/get-help/install-howto/linux/

#英文主程序
wget https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/7.5.0/rpm/x86_64/LibreOffice_7.5.0_Linux_x86-64_rpm.tar.gz -O /opt/download/LibreOffice_7.5.0_Linux_x86-64_rpm.tar.gz
#中文包
wget https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/7.5.0/rpm/x86_64/LibreOffice_7.5.0_Linux_x86-64_rpm_langpack_zh-CN.tar.gz -O /opt/download/LibreOffice_7.5.0_Linux_x86-64_rpm_langpack_zh-CN.tar.gz
#中文帮助doc包
wget https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/7.5.0/rpm/x86_64/LibreOffice_7.5.0_Linux_x86-64_rpm_helppack_zh-CN.tar.gz -O /opt/download/LibreOffice_7.5.0_Linux_x86-64_rpm_helppack_zh-CN.tar.gz

tar -vxf /opt/download/LibreOffice_7.5.0_Linux_x86-64_rpm.tar.gz -C /opt/soft/
tar -vxf /opt/download/LibreOffice_7.5.0_Linux_x86-64_rpm_helppack_zh-CN.tar.gz -C /opt/soft/
tar -vxf /opt/download/LibreOffice_7.5.0_Linux_x86-64_rpm_langpack_zh-CN.tar.gz -C /opt/soft/

#务必按顺序执行安装命令
yum install -y /opt/soft/LibreOffice_7.5.0.3_Linux_x86-64_rpm/RPMS/*.rpm
yum install -y /opt/soft/LibreOffice_7.5.0.3_Linux_x86-64_rpm_langpack_zh-CN/RPMS/*.rpm
yum install -y /opt/soft/LibreOffice_7.5.0.3_Linux_x86-64_rpm_helppack_zh-CN/RPMS/*.rpm

#清理安装包
rm -rf /opt/soft/LibreOffice_*

#卸载
yum remove libreoffice4.x-*

17. Python

https://registry.npmmirror.com/binary.html?path=python/

python3 --version

#卸载python3
rpm -qa|grep python3|xargs rpm -ev --allmatches --nodeps
whereis python3 |xargs rm -frv

#方案1 直装3.6.8
yum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make 
yum install -y python3 python3-devel

#方案2 源码编译3.8.6
yum install -y openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel psmisc libffi-devel zlib* libffi-devel
wget https://registry.npmmirror.com/-/binary/python/3.8.6/Python-3.8.6.tgz -O /opt/download/Python-3.8.6.tgz
tar -vxf /opt/download/Python-3.8.6.tgz -C /opt/download/
cd /opt/download/Python-3.8.6

./configure --prefix=/opt/env/python38
make -j8 &&  make install
rm -rf /opt/download/Python-3.8.6

#重登用户,重载环境配置
su - root

#软链接
ln -sf /opt/env/python38/bin/python3 /usr/bin/python3
ln -sf /opt/env/python38/bin/pip3 /usr/bin/pip3

#升级pip
pip3 install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

#换源
pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple


#环境变量
vi ~/.bash_profile
export PYTHON_HOME=/usr/bin/python3.6
export PATH=$PYTHON_HOME/bin:$PATH

source ~/.bash_profile
echo $PYTHON_HOME
python3 --version


#3.9.16        https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tgz

# 3.10.5    https://mirrors.huaweicloud.com/python/3.10.5/Python-3.10.5.tgz
# 3.10.5需要单独编译ssl
wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz -O /opt/download/
tar zxvf openssl-1.1.1g.tar.gz -C /opt/env/
cd /opt/env/openssl-1.1.1g
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl no-ssl2
make -j8 && make install

wget https://mirrors.huaweicloud.com/python/3.10.5/Python-3.10.5.tgz -O /opt/download/
tar -vxf /opt/download/Python-3.10.5.tgz -C /opt/env/
cd /opt/env/Python-3.10.5
./configure --enable-optimizations --with-openssl=/usr/local/openssl
make distclean
make altinstall
# 测试
python3 -m ssl

rm -rf /opt/env/openssl-1.1.1g
rm -rf /opt/download/Python-3.8.6

18. eclipse

https://www.eclipse.org/downloads/packages/release/2021-12/r

https://download.eclipse.org/technology/babel/babel_language_packs/latest/index.php

#主程序
wget https://archive.eclipse.org/technology/epp/downloads/release/2021-12/R/eclipse-java-2021-12-R-linux-gtk-x86_64.tar.gz -O /opt/download/eclipse-java-2021-12-R-linux-gtk-x86_64.tar.gz
tar -vxf /opt/download/eclipse-java-2021-12-R-linux-gtk-x86_64.tar.gz -C /opt/soft/

#汉化包
wget https://ftp.yz.yamagata-u.ac.jp/pub/eclipse/technology/babel/babel_language_packs/latest/BabelLanguagePack-eclipse-zh_4.22.0.v20211218020001.zip -O /opt/download/BabelLanguagePack-eclipse-zh_4.22.0.v20211218020001.zip
unzip -d /opt/soft/ /opt/download/BabelLanguagePack-eclipse-zh_4.22.0.v20211218020001.zip

#快捷方式
echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=eclipse\nComment=Eclipse\nExec=/opt/soft/eclipse/eclipse\nIcon=/opt/soft/eclipse/icon.xpm\nTerminal=false\nStartupNotify=true\nType=Application\nCategories=Application;Development;">~/桌面/Eclipse.desktop

19. Sublime

rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
yum-config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
yum install -y sublime-text

#中文
Tools->Install Package Contorol
Preferences->Package Contorol->install package->ChineseLocaloztions

QT5

https://download.qt.io/archive/qt/5.12/5.12.12/

yum install -y ccache

wget https://download.qt.io/archive/qt/5.12/5.12.12/qt-opensource-linux-x64-5.12.12.run -O /opt/download/qt-opensource-linux-x64-5.12.12.run
chmod 777 /opt/download/qt-opensource-linux-x64-5.12.12.run
/opt/download/qt-opensource-linux-x64-5.12.12.run

#注册并登陆帐号
#安装路径改为  /opt/soft/Qt5.12.12
#增加环境变量
echo "export QTDIR=/opt/soft/Qt5.12.12
export "PATH=\$QTDIR/5.12.12/gcc_64/bin:\$QTDIR/Tools/QtCreator/bin/:\$PATH" >> ~/.bash_profile
source .bash_profile

#启动
qtcreator

docker

curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

# 启动
sudo systemctl start docker

# 详情
docker info

# 开机启动
sudo systemctl enable docker

# 配置代理
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo touch /etc/systemd/system/docker.service.d/proxy.conf
sudo vim  /etc/systemd/system/docker.service.d/proxy.conf

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:8080/"
Environment="HTTPS_PROXY=http://proxy.example.com:8080/"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com"

远程Windows

freerdp

yum install –y  xorg-x11-xauth xorg-x11-fonts-* xorg-x11-utils freerdp

#挂载   
#--plugin rdpdr  --data disk:挂载到windows的名称:本地路径 --

#同步剪切版(无法上传文件,请传入挂载目录)
#--plugin cliprdr

#分辨率
#-g 1600x900

#账户
#-u xxxxxx

#密码
#-p xxxxxx

#最后接连接地址
#ip:port


xfreerdp --plugin rdpdr  --data disk:QL:/opt/ -- --plugin cliprdr -g 1600x900 -u admin -p 'xxxxxx'  '192.168.1.11:6666'

#快捷方式
vi ~/桌面/1.rdp.desktop
[Desktop Entry]
Name=1.rdp
Exec=xfreerdp xxxxxxxxxxxxxx
Terminal=false

Ftp/Smb

yum -y install ftp
ftp 192.168.1.11

#挂载局域网smb到本地
mount -t cifs -o username="xxxxx",password="xxxxx" //192.168.1.1/smb  /opt/smb

Greenplum

cp -rf ./Greenplum  /opt/soft
cd /opt/soft/Greenplum
#主/子节点
sh install.sh
#主节点二步
sh install.sh 1

GreenPlum-PL/JAVA

https://blog.csdn.net/qq_41580613/article/details/128022107

https://network.pivotal.io/products/vmware-tanzu-greenplum#/releases/716903/file_groups/2736

PL/Java for RHEL 7

su - gpadmin
#需提前安装OpenJDK8,并配置环境变量(参考上面配置)
gppkg -i /opt/download/pljava-2.0.2-gp6-rhel7_x86_64.gppkg

#重启数据库
gpstop -r -a
psql -d 数据库名 -c 'CREATE EXTENSION pljava;'

报错

  1. ERROR: Cannot load libjvm.so library, check that it is available in LD_LIBRARY_PATH (Backend.c:239) DETAIL: libjvm.so: cannot open shared object file: No such file or directory
#root用户 所有设备都要
echo "$JAVA_HOME/jre/lib/amd64/server" > /etc/ld.so.conf.d/libjdk1.8.0_311.conf
ldconfig
  1. ERROR: query plan with multiple segworker groups is not supported HINT: likely caused by a function that reads or modifies data in a distributed table
#子节点没有配置jdk环境
#子节点没有配置LD_LIBRARY_PATH(参考上一个错误解决方案)

postgresql

https://www.postgresql.org/download/

https://www.postgresql.org/download/linux/redhat/

#9.2版本
yum install postgresql-server

VPN

# 全局代理
vim ~/.bashrc

export http_proxy=http://127.0.0.1:7890
export https_proxy=http://127.0.0.1:7890
export all_proxy=socks5://127.0.0.1:7890

source ~/.bashrc

QzV2ray

https://github.com/Qv2ray/Qv2ray/releases/

win配置教程

mkdir -p /opt/soft/V2ray/
wget https://github.com/Qv2ray/Qv2ray/releases/download/v2.1.1/Qv2ray.v2.1.1.linux-x64.qt5.13.2.AppImage -O /opt/soft/V2ray/Qv2ray.AppImage
wget https://github.com/v2fly/v2ray-core/releases/download/v4.41.0/v2ray-linux-64.zip -O /opt/soft/V2ray/v2ray-linux-64.zip
tar -vxf /opt/soft/V2ray/v2ray-linux-64.zip -C /opt/soft/V2ray/core/
echo -e "[Desktop Entry]\nEncoding=UTF-8\nName=Qv2ray\nComment=Qv2ray\nExec=/opt/soft/V2ray/Qv2ray.v2.1.1.linux-x64.qt5.13.2.AppImage --I-just-wanna-run-with-root\nTerminal=false\nStartupNotify=true\nType=Application\nCategories=Application;Development;">~/桌面/Qv2ray.desktop

#打开后,设置核心路径
#核心可执行文件路径
/opt/soft/V2ray/core/v2ray
#V2ray资源目录
/opt/soft/V2ray/core
#点击检查V2ray核心设置
#路径配置检查通过

Clash

https://github.com/Dreamacro/clash/releases/download/v1.13.0/clash-linux-amd64-v1.13.0.gz

V2ray

https://github.com/v2fly/v2ray-core/releases/download/v4.41.0/v2ray-linux-64.zip
#https://github.com/v2fly/fhs-install-v2ray/tree/master
#bash <(curl -L https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh)

GoLang

https://golang.google.cn/

wget https://golang.google.cn/dl/go1.20.2.linux-amd64.tar.gz -O /opt/download/go1.20.2.linux-amd64.tar.gz
tar -vxf /opt/download/go1.20.2.linux-amd64.tar.gz -C /opt/env/
mkdir /opt/env/go/gopath

#添加环境变量
vi /etc/profile
export GO111MODULE=on
export GOROOT=/opt/env/go
export GOPATH=/opt/env/go/gopath
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

source /etc/profile

跨设备文件传输

#从183拷贝文件到本地smb目录
rsync -r root@192.168.1.183:/opt/env/apache-maven-3.5.4/repo/com/sun /opt/smb/

#发送本地文件到183
rsync /opt/smb/123.txt root@192.168.1.183:/opt/env/

一些常见的路径

1. 自启

/etc/rc.d/rc.local
#添加要运行的命令


chkconfig
#chkconfig –-add xxx //把服务添加到chkconfig列表
#chkconfig --del xxx //把服务从chkconfig列表中删除
#chkconfig xxx on //开启开机自动启动
#chkconfig xxx off //关闭开机自动启动
#chkconfig --list //查看所有chklist中服务
#chkconfig --list xxx 查看指定服务

systemctl enble 服务名
#/etc/systemd/system(user)/   =>   /usr/lib/systemd/
#nginx.service
#[Unit]
#Description=nginx - high performance web server
#After=network.target remote-fs.target nss-lookup.target
#
#[Service]
#Type=forking
#ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
#ExecReload=/usr/local/nginx/sbin/nginx -s reload
#ExecStop=/usr/local/nginx/sbin/nginx -s stop
#[Install]
#WantedBy=multi-user.target

2. 环境变量

环境变量脚本文件的执行顺序如下

/etc/profile->/etc/profile.d->/etc/bashrc->用户的.bash_profile->用户的.bashrc

/etc/profile
/etc/profile.d/*
/etc/bashrc
#ls .bash_*
.bash_profile
.bashrc
.bash_logout
.bash_history

资源下载
Greenplum一键化搭建.tar.gz此资源下载价格为99.99QL币,请先
navicat15_QL.tar.gz此资源下载价格为16.66QL币,请先
navicat.tar.gz此资源下载价格为16.66QL币,请先
Typora_1.5.9(NodeInject)此资源下载价格为89.99QL币,请先
客服: 273641837