Installing common software for Rocky Linux virtual machine

Still install common software series. The current version of Rocky Linux can be regarded as a replica of CentOS 8. CentOS 8 will stop maintenance this year. If users want to be stable, they will return to CentOS 7 and install Rocky Linux if they want to explore. However, as far as I know, CentOS 7 is still the mainstream of Redhat system.

1.VMWare installation of Rocky Linux

All are installed by default. Note that if you want to use the GUI, you need to download the DVD version on the official website. The minimum version does not have a GUI

2. Install VMWare Tools

sudo yum install open-vm-tools

There seems to be a problem after installing VMWare Tools in Rocky Linux/CentOS 8, that is, the copy of text and several K text files

Yes, compressed packages, large files and folders are invalid. If you really want to transfer these things, you can only use U SB flash disk, SSH tool, or network.

3. Modification time

CentOS time is often inaccurate and needs to be modified. It is best to switch to the root user with the following command

Installing chrony

sudo yum install -y chrony

After installing the tool, start it first

sudo systemctl start chronyd

Set the system to start automatically

sudo systemctl enable chronyd

Edit the configuration file

sudo vim /etc/chrony.conf
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
# pool 2.centos.pool.ntp.org iburst (comment out this line and add the following two lines)
server ntp.aliyun.com iburst
server cn.ntp.org.cn iburst

Reload configuration

sudo systemctl restart chronyd.service
sudo chronyc sources -v

4. Change source using yum

sudo sed -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#baseurl=http://dl.rockylinux.org/$contentdir|baseurl=https://mirrors.sjtug.sjtu.edu.cn/rocky|g' -i.bak /etc/yum.repos.d/Rocky-*.repo

Generate cache

 sudo dnf makecache

to update

sudo yum -y update
sudo yum -y upgrade

5. Install jdk

sudo yum -y install java-1.8.0-openjdk.x86_64

6. Install nodejs

sudo curl -fsSL https://rpm.nodesource.com/setup_14.x | sudo bash -
sudo yum install -y nodejs

Configure nodejs source

# npm official source
npm config set registry https://registry.npmjs.org
# npm Taobao source
npm config set registry https://registry.npm.taobao.org
 
# Install yarn and set it as Taobao source
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
 
# Install cnpm and set it as Taobao source
sudo npm install -g cnpm -registry=https://registry.npm.taobao.org
 
# Install vue scaffold 3
sudo cnpm install -g @vue/cli@3

7. Install SVN

sudo yum -y install subversion

8. Install Git

sudo yum -y install git

9. Install MySQL

Disable MySQL's default AppStream repository

sudo dnf remove @mysql
sudo dnf module reset mysql && sudo dnf module disable mysql

CentOS 8 does not have a MySQL repository, so we will use the centos 7 repository. Create a new repository file

sudo vim /etc/yum.repos.d/mysql-community.repo

Insert the following data into the repository above

[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1
gpgcheck=0

[mysql-connectors-community]
name=MySQL Connectors Community
baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
enabled=1
gpgcheck=0

[mysql-tools-community]
name=MySQL Tools Community
baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
enabled=1
gpgcheck=0

Install MySQL

sudo dnf --enablerepo=mysql57-community install mysql-community-server

Start MySQL

sudo systemctl start mysqld

Set startup

sudo systemctl enable mysqld
sudo systemctl daemon-reload

Obtain the temporary password generated after installing mysql for login

sudo grep 'temporary password' /var/log/mysqld.log

If the following message appears, the password is:   iaJd,l26MNs/

2021-09-25T04:25:40.643274Z 1 [Note] A temporary password is generated for root@localhost: iaJd,l26MNs/

  Log in to MySQL with the above password

sudo mysql -uroot -p

Change the root login password to root

# Reduce password rule level
set global validate_password_policy=LOW;

# Reduce password length
set global validate_password_length=1;

# Change the root password to root
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';

sign out

quit;

10. Install PostgreSQL

Download rpm package

sudo dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

Disable postgresql module

sudo dnf module disable postgresql

If there are options in the process, select all y

Clean up yum cache

sudo dnf clean all

Install PostgreSQL 11 server and client packages

sudo dnf -y install postgresql11-server postgresql11

database initialized

sudo /usr/pgsql-11/bin/postgresql-11-setup initdb
sudo systemctl enable --now postgresql-11

Switch users

sudo su - postgres

Enter pgsql command line

psql

Execute SQL after entering

ALTER USER postgres WITH PASSWORD 'postgres';
# sign out
exit;

11. Install redis

sudo yum -y install redis

Modify profile

sudo vim /etc/redis.conf

restart

sudo service redis restart

12. Install VMWare

There is a conflict. The installation can be successful. There are errors when using it. It can't be used for the time being

Tags: Linux

Posted on Sat, 25 Sep 2021 05:33:33 -0400 by BAM1979