依然是虚拟机安装常用软件系列,CentOS 7目前官方支持到2024,还行
默认都安装成功了
阿里源最近老是403,换了网易源
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
# 刷新缓存
sudo yum makecache# 更新
sudo yum -y update
sudo yum -y upgrade
附上阿里源
sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
sudo wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
由于大量软件只有Windows版,所以在CentOS 7安装Windows虚拟机还是有必要的
安装环境
sudo yum -y install kernel-devel kernel-headers gcc
把VMWare上传到虚拟机内某文件夹下,我这边测试14.0.0和CentOS 7 2009没有冲突,VMWare Workstation在Redhat系中经常会出现版本冲突,比如16.1.2就很难在CentOS 7上安装,所以要做好研究(最新测试16.2.0-18760230.x86_64.bundle貌似可以!)
把14.0.0的bundle文件传入虚拟机,进入目录执行
sudo chmod +x vmware-workstation-full-14.0.0-6661328.x86_64.bundle
sudo ./vmware-workstation-full-14.0.0-6661328.x86_64.bundle
安装完14.0.0后,必须重启!
重启后打开,成功
最新版本https://www.vmware.com/go/getworkstation-linux
sudo chmod +x VMware-Workstation-Full-17.0.0-20800274.x86_64.bundle
sudo ./VMware-Workstation-Full-17.0.0-20800274.x86_64.bundle
下载vmware-host-modules,注意切换成自己的VMWare版本
GitHub - mkubecek/vmware-host-modules at workstation-17.0.0
传入服务器,解压编译安装, 如果有问题,重启, 不成功也可以打开软件试试, 有机会自动安装
unzip vmware-host-modules-workstation-17.0.0.zip
cd vmware-host-modules-workstation-17.0.0
sudo make
sudo make install
卸载openjdk
sudo yum -y remove *openjdk*
下载rpm版jdk1.8,进入目录执行
sudo rpm -ivh jdk-8u311-linux-x64.rpm
sudo curl -fsSL https://rpm.nodesource.com/setup_14.x | sudo bash -
sudo yum -y install nodejs
配置Node.js源
# npm官方源
npm config set registry https://registry.npmjs.org
# npm淘宝源
npm config set registry https://registry.npm.taobao.org
# 安装yarn 并设置为淘宝源
sudo npm install -g yarn
yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g
# 安装cnpm 并设置为淘宝源
sudo npm install -g cnpm -registry=https://registry.npm.taobao.org
# 安装vue脚手架3
sudo cnpm install -g @vue/cli@3
sudo yum -y install subversion
sudo yum -y install git
检查是否安装了mariadb,如果没有,就可以安装mysql,如果有,需要先卸载
rpm -qa | grep mariadb
sudo yum -y remove mariadb-*
# 下载并安装 mysql yum
sudo wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
sudo yum -y install mysql57-community-release-el7-10.noarch.rpm# 安装 mysql-server
sudo yum -y install mysql-community-server# 启动 mysql-serer
sudo systemctl start mysqld.service# 查看是否启动成功,即是否存在 3306 端口
netstat -tnlp | grep 3306# 查询 root 密码,登录到 mysql
sudo grep "password" /var/log/mysqld.log
sudo mysql -uroot -p# 修改root登录密码为root
# 降低密码规则级别
set global validate_password_policy=LOW;
# 降低密码长度
set global validate_password_length=1;
# 修改root密码为root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';
#刷新,退出flush privileges;
quit;#开机自启
sudo systemctl enable mysqld
如果执行sudo yum -y install mysql-server 报以下错误
Failing package is: mysql-community-client-5.7.40-1.el7.x86_64
GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
执行:
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
再次进行服务安装:
sudo yum -y install mysql-server
# 下载rpm包
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# 安装
sudo yum -y install postgresql11 postgresql11-server postgresql11-libs
# 初始化数据库
sudo /usr/pgsql-11/bin/postgresql-11-setup initdb
# 设置开机自启动PostgreSQL和启动服务
sudo systemctl enable postgresql-11
sudo systemctl start postgresql-11
sudo systemctl status postgresql-11# 设置密码
sudo passwd postgres# 登录数据库,这里切换账号postgres
su - postgres
psql#进入后修改密码
ALTER USER postgres WITH PASSWORD 'postgres';
# 退出
exit;切换回自己用户
su - 自己用户名# 修改认证文件/var/lib/pgsql/data/pg_hba.conf,登陆使用密码。
# 把这个配置文件中的ipv4认证METHOD的ident修改为md5,ip改为0.0.0.0/0,可以实现用账户和密码来访问数据库,重启生效
sudo vim /var/lib/pgsql/11/data/pg_hba.conf
sudo systemctl restart postgresql-11
(1)下载redis的tar.gz包
(2) 新增/usr/local/redis文件夹,并将redis的tar.gz文件放入
(3)安装gcc,进入目录,解压tar包,进入目录,执行编译,指定目录安装
sudo yum install -y gcc
cd /usr/local/redis
sudo tar -xvzf redis-6.2.6.tar.gz
cd /usr/local/redis/redis-6.2.6
sudo make
sudo make install PREFIX=/usr/local/redis
(4)后台启动
// 复制配置文件
sudo cp /usr/local/redis/redis-6.2.6/redis.conf /usr/local/redis/bin/
// 修改 redis.conf 文件,把 daemonize no 改为 daemonize yes
// 去掉bind 的127.0.0.1绑定
// protected-mode改为no
cd /usr/local/redis/bin/
sudo vim redis.conf
(5)设置开机启动
sudo vim /etc/systemd/system/redis.service
复制粘贴以下内容
[Unit]
Description=redis-server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/redis/bin/redis-server /usr/local/redis/bin/redis.conf
PrivateTmp=true
[Install]
WantedBy=multi-user.target
开机启动
// 设置开机启动
sudo systemctl daemon-reload
sudo systemctl start redis.service
sudo systemctl enable redis.service
//创建 redis 命令软链接
sudo ln -s /usr/local/redis/bin/redis-cli /usr/bin/redis
sudo yum -y install epel-release
sudo yum -y install redis
修改配置文件
sudo vim /etc/redis.conf
重启
sudo systemctl restart redis
sudo systemctl enable redis
下载nginx的tar.gz包,新增/usr/local/nginx,并将nginx的tar.gz文件放入
安装pcre、pcre-devel、openssl
sudo yum install -y pcre pcre-devel
sudo yum install -y openssl openssl-devel
进入目录,解压tar包,进入目录,执行编译
cd /usr/local/nginx
sudo tar -xvzf nginx-1.18.0.tar.gz
cd /usr/local/nginx/nginx-1.18.0
sudo ./configure
sudo make
sudo make install PREFIX=/usr/local/nginx
开机自启动
sudo vim /etc/systemd/system/nginx.service
复制粘贴以下内容
[Unit]
Description=nginx server daemon
Documentation=man:nginx(8)
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
操作
sudo systemctl daemon-reload
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
sudo systemctl status nginx.service
sudo yum -y install nginx
修改配置文件
sudo vim /etc/nginx/nginx.conf
重启
sudo systemctl restart nginx
sudo systemctl enable nginx
官网下载Linux版本的软件:百度网盘 客户端下载 (baidu.com)
CentOS7的软件包格式为rpm。安装:
# 安装依赖
sudo yum -y install libXScrnSaver
sudo yum -y install libstdc++.so.6cd /usr/local/lib64
# 下载最新版本的libstdc.so_.6.0.26
sudo wget http://www.vuln.cn/wp-content/uploads/2019/08/libstdc.so_.6.0.26.zip
sudo unzip libstdc.so_.6.0.26.zip# 将下载的最新版本拷贝到 /usr/lib64
sudo cp libstdc++.so.6.0.26 /usr/lib64
cd /usr/lib64
# 删除/usr/lib64原来的软连接libstdc++.so.6,删除之前先备份一份
sudo rm libstdc++.so.6# 链接新的版本
sudo ln -s libstdc++.so.6.0.26 libstdc++.so.6# 查看新版本,成功
strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX# 安装百度网盘
sudo rpm -ivh baidunetdisk-3.5.0.x86_64.rpm
最新版本
sudo rpm -ivh baidunetdisk_4.17.7_x86_64.rpm
如果打不开,需要将
libcrypto.so.10、libcups.so.2、libgssapi_krb5.so.2、libk5crypto.so.3、libkrb5.so.3、libkrb5support.so.0、libssl.so.10放到/opt/baidunetdisk下面
sudo mv ./so/* /opt/baidunetdisk/
具体见Fedora32 成功运行百度网盘 baidunetdisk 附方法和包【fedora吧】_百度贴吧
WPS Office 2019 for Linux-支持多版本下载_WPS官方网站
CentOS的软件包格式为rpm。安装:
官网下载Linux版本的软件:注意WPS 2019好像在CentOS 7中有问题,安装后无法打开,经测试
10.1.0版本好像没问题,但是不能浏览pdf,不过这个也无所谓,pdf可以用浏览器。或者CentOS自带的阅读器打开,或者用Okular
# 安装依赖
sudo yum -y install mesa-libGLU# 安装wps
sudo rpm -ivh wps-office-10.1.0.6757-1.x86_64.arpm.rpm
安装okular
sudo yum -y install okular
wps有可能会报缺字体,缺的字体如下,双击安装
百度网盘 请输入提取码 提取码:lexo
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'
sudo yum check-update
sudo yum install -y code
参考Centos7安装播放器(mplayer & vlc)_写回的博客-CSDN博客
sudo yum -y install epel-release
sudo yum localinstall -y rpmforge-release-0.5.3-1.el6.rf.x86_64.rpmsudo wget http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
sudo rpm -ivh nux-dextop-release-0-5.el7.nux.noarch.rpm
sudo yum localinstall -y nux-dextop-release-0-5.el7.nux.noarch.rpmsudo yum -y install vlc
sudo yum -y install smplayer
github下载electerm, 最新版貌似不行, 改用1.16.21版本可以
https://github.com/electerm/electerm/releases/download/v1.16.21/electerm-1.16.21-linux-x86_64.rpm
sudo rpm -ivh electerm-1.16.21-linux-x86_64.rpm
sudo yum -y install filezilla
安装edge需要gblic 2.18,但是CentOS 7安装2.18后重启会黑屏,目前全网无解,官方支持的只到2.17,所以,不要试图在CentOS 7上去安装gblic 2.18
目前最新edge,chrome都不行,edge94, Chrome 94可行
历史版本仓库如下
Index of /yumrepos/edge/ (microsoft.com)
chrome浏览器,chrome插件,谷歌浏览器下载,谈笑有鸿儒 (chromedownloads.net)
找到94版本下载,安装如下
sudo yum install -y libappindicator-gtk3
sudo yum install -y liberation-fontssudo yum install -y libatomic
sudo rpm -ivh google-chrome-stable_current_x86_64_94.0.4606.81.rpm
sudo rpm -ivh microsoft-edge-dev-94.0.982.2-1.x86_64.rpm
貌似最新版本可以了
下载 Microsoft Edge
sudo yum -y install vulkan-1.1.97.0-1.el7.x86_64
# 最新版本
sudo rpm -ivh microsoft-edge-stable-110.0.1587.63-1.x86_64.rpm