文章目录
- 一、实验介绍
- 1、内容描述
- 2、实验目的
- 二、配置Yum源
- 步骤1:进入yum repo目录
- 步骤2:更改openEuler_x86_64.repo文件
- 步骤3:刷新列出软件列表
- 三、使用RPM命令管理软件
- 1、RPM查询命令
- 步骤1:执行以下命令,通过yum和rpm方式查询openjdk包名称
- 步骤2:查询openjdk是否安装
- 2、RPM安装命令
- 步骤1:执行以下命令,下载openjdk和zziplib安装包
- 步骤2:rpm安装openjdk 1.8,结果无法解决软件包的依赖关系
- 步骤3:使用yum安装openjdk
- 步骤4:验证openjdk安装成功
- 步骤5:使用rpm安装zziplib
- 3、RPM升级命令
- 步骤1:执行以下命令,升级openjdk
- 步骤2:执行以下命令,升级zziplib
- 4、RPM常用参数
- 步骤1:查询已安装的软件包中的文件列表和完整目录
- 步骤2:查询软件包的详细信息
- 5、RPM卸载命令
- 步骤1:执行以下命令,显示已安装zziplib
- 步骤2:卸载zziplib
- 步骤3:再次输入“rpm -qa | grep zziplib”有报错提示未安装,说明zziplib已经卸载
- 四、DNF管理软件包(选)
- 1、DNF管理软件包操作
- 步骤1:使用工具将openEuler-20.03-LTS-everything-x86_64-dvd.iso上传至openEuler01虚拟机的/root目录下,然后执行如下命令挂载ISO
- 步骤2:执行以下命令,查看dnf配置文件内容
- 步骤3:添加软件源
- 步骤4:使用命令vim /etc/yum.repos.d/mnt_.repo打开编辑文件,在最后添加以下代码
- 步骤5:执行以下命令,验证启用和禁用软件源
- 步骤6:搜索openjdk软件包
- 步骤7:列出软件包清单,已安装软件包清单和可用软件包清单
- 步骤8:显示RPM包信息
- 步骤9:执行以下命令,显示管理软件包组
- 步骤10:显示已安装的软件包组信息
- 步骤11:检查并更新
- 五、安装个人网盘应用
- 1、实验介绍
- 2、实验流程
- 3、安装依赖组件
- 步骤1:执行以下命令,安装依赖和基础工具
- 4、安装Apache服务器
- 步骤1:执行以下命令,安装Apache web服务器
- 步骤2:启动Apache网络服务
- 5、安装PHP
- 步骤1:执行以下命令,重置并安装PHP
- 步骤2:安装PHP所需模块
- 步骤3:安装cMake
- 步骤4:软件包安装libzip
- 步骤5:安装php-zip
- 步骤6:使用vim命令打开/etc/php.ini文件,在[PHP]下面添加以下代码
- 步骤7:启动php-fpm
- 步骤8:验证PHP安装版本
- 步骤9:验证PHP安装模块
- 6、安装Nextcloud应用
- 步骤1:执行以下命令,进入/home目录,下载Nextcloud软件包
- 步骤2:解压Nextcloud软件包
- 步骤3:拷贝文件夹至apache web服务器的根目录
- 步骤4:创建数据文件夹
- 步骤5:更改Apache对nextCloud文件夹的读写权限
- 步骤6:重启Apache
- 步骤7:关闭防火墙
- 步骤8:临时关闭SElinux
- 7、验证结果
- 步骤1:在本地浏览器中访问:http://ip/nextcloud
- 步骤2:输入自定义的管理员用户名和密码,点击`安装完成`
- 步骤3:稍作等待,系统初始化完毕,点击右上角的关闭按钮,进入网盘主界面。
一、实验介绍
1、内容描述
本实验帮助学员掌握openEuler软件管理的操作,主要包含rpm操作命令、软件源码安装的操作命令、yum操作命令和systemd/systemctl管理服务的操作命令。本实验指导书共包含5个实验,从使用华为openEuler实验环境开始,逐一介绍了yum源配置、RPM命令和软件管理等内容。
✔ 实验一为使用本地openEuler实验环境;
✔ 实验二为配置Yum源;
✔ 实验三为使用RPM命令管理软件;
✔ 实验四为DNF管理软件包;
✔ 实验五为安装个人网盘应用。
2、实验目的
✔ 掌握openEuler系统的软件管理方法;
✔ 掌握rpm与dnf的区别;
✔ 掌握dnf配置;
✔ 掌握软件的安装、卸载、升级。
二、配置Yum源
步骤1:进入yum repo目录
[root@localhost test]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
总用量 4.0K
-rw-r--r--. 1 root root 519 3月 24 2020 openEuler_x86_64.repo
[root@localhost yum.repos.d]#
步骤2:更改openEuler_x86_64.repo文件
文件内容如下:
#generic-repos is licensed under the Mulan PSL v2.
#You can use this software according to the terms and conditions of the Mulan PSL v2.
#You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
#PURPOSE.
#See the Mulan PSL v2 for more details.
[OS]
name=OS
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
[everything]
name=everything
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/everything/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/everything/$basearch/RPM-GPG-KEY-openEuler
[EPOL]
name=EPOL
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/EPOL/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
[debuginfo]
name=debuginfo
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/debuginfo/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/debuginfo/$basearch/RPM-GPG-KEY-openEuler
[source]
name=source
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/source/
enabled=1
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/source/RPM-GPG-KEY-openEuler
[update]
name=update
baseurl=http://repo.openeuler.org/openEuler-20.03-LTS/update/$basearch/
enabled=0
gpgcheck=1
gpgkey=http://repo.openeuler.org/openEuler-20.03-LTS/OS/$basearch/RPM-GPG-KEY-openEuler
步骤3:刷新列出软件列表
[root@localhost yum.repos.d]# yum list all
OS 5.9 MB/s | 2.7 MB 00:00
everything 6.7 MB/s | 9.1 MB 00:01
EPOL 3.9 MB/s | 911 kB 00:00
debuginfo 4.8 MB/s | 2.8 MB 00:00
source 3.7 MB/s | 816 kB 00:00
Installed Packages
CUnit.x86_64 2.1.3-21.oe1 @anaconda
GConf2.x86_64 3.2.6-24.oe1 @anaconda
GeoIP.x86_64 1.6.12-5.oe1 @anaconda
GeoIP-GeoLite-data.noarch 2018.06-3.oe1 @anaconda
ModemManager-glib.x86_64 1.8.0-7.oe1 @anaconda
NetworkManager.x86_64 1:1.16.0-7.oe1 @anaconda
NetworkManager-config-server.noarch 1:1.16.0-7.oe1 @anaconda
NetworkManager-libnm.x86_64 1:1.16.0-7.oe1 @anaconda
PackageKit.x86_64 1.1.12-8.oe1 @anaconda
abattis-cantarell-fonts.noarch 0.111-2.oe1 @anaconda
acl.x86_64 2.2.53-7.oe1 @anaconda
adcli.x86_64 0.8.2-6.oe1 @anaconda
adobe-mappings-cmap.noarch 20190730-2.oe1 @anaconda
adobe-mappings-cmap-lang.noarch 20190730-2.oe1 @anaconda
adobe-mappings-pdf.noarch 20190401-1.oe1 @anaconda
adwaita-icon-theme.noarch 3.32.0-1.oe1 @anaconda
alsa-lib.x86_64 1.1.6-6.oe1 @anaconda
apr.x86_64 1.6.5-4.oe1 @anaconda
apr-util.x86_64 1.6.1-11.oe1 @anaconda
asciidoc.noarch 8.6.10-3.oe1 @anaconda
at.x86_64 3.1.23-5.oe1 @anaconda
at-spi2-atk.x86_64 2.30.0-2.oe1 @anaconda
at-spi2-core.x86_64 2.34.0-1.oe1 @anaconda
.
.
.
.
.
.
yum-metadata-parser-help.x86_64 1.1.4-24.oe1 everything
zbar.x86_64 0.20.1-4.oe1 EPOL
zbar-devel.x86_64 0.20.1-4.oe1 EPOL
zbar-help.x86_64 0.20.1-4.oe1 EPOL
zd1211-firmware.noarch 1.5-5.oe1 everything
zd1211-firmware.src 1.5-5.oe1 source
zd1211-firmware-help.noarch 1.5-5.oe1 everything
zenity.src 3.30.0-2.oe1 source
zenity.x86_64 3.30.0-2.oe1 OS
zenity.x86_64 3.30.0-2.oe1 everything
zenity-debuginfo.x86_64 3.30.0-2.oe1 debuginfo
zenity-debugsource.x86_64 3.30.0-2.oe1 debuginfo
zenity-help.noarch 3.30.0-2.oe1 everything
zerofree.src 1.1.1-3.oe1 source
zerofree.x86_64 1.1.1-3.oe1 everything
zerofree-debuginfo.x86_64 1.1.1-3.oe1 debuginfo
zerofree-debugsource.x86_64 1.1.1-3.oe1 debuginfo
zerofree-help.x86_64 1.1.1-3.oe1 everything
zeromq.x86_64 4.1.7-2.oe1 EPOL
zeromq-devel.x86_64 4.1.7-2.oe1 EPOL
zeromq-help.x86_64 4.1.7-2.oe1 EPOL
zip.src 3.0-25.oe1 source
zip-debuginfo.x86_64 3.0-25.oe1 debuginfo
zip-debugsource.x86_64 3.0-25.oe1 debuginfo
zip-help.noarch 3.0-25.oe1 OS
zip-help.noarch 3.0-25.oe1 everything
zlib.src 1.2.11-17.oe1 source
zlib-debuginfo.x86_64 1.2.11-17.oe1 debuginfo
zlib-debugsource.x86_64 1.2.11-17.oe1 debuginfo
zlib-devel.x86_64 1.2.11-17.oe1 OS
zlib-devel.x86_64 1.2.11-17.oe1 everything
zlib-help.noarch 1.2.11-17.oe1 OS
zlib-help.noarch 1.2.11-17.oe1 everything
zopfli.src 1.0.1-8.oe1 source
zopfli.x86_64 1.0.1-8.oe1 everything
zopfli-debuginfo.x86_64 1.0.1-8.oe1 debuginfo
zopfli-debugsource.x86_64 1.0.1-8.oe1 debuginfo
zsh.src 5.7.1-4.oe1 source
zsh-debuginfo.x86_64 5.7.1-4.oe1 debuginfo
zsh-debugsource.x86_64 5.7.1-4.oe1 debuginfo
zsh-help.noarch 5.7.1-4.oe1 everything
zstd.src 1.3.6-3.oe1 source
zstd-debuginfo.x86_64 1.3.6-3.oe1 debuginfo
zstd-debugsource.x86_64 1.3.6-3.oe1 debuginfo
zstd-devel.x86_64 1.3.6-3.oe1 OS
zstd-devel.x86_64 1.3.6-3.oe1 everything
zstd-help.noarch 1.3.6-3.oe1 OS
zstd-help.noarch 1.3.6-3.oe1 everything
zvbi.x86_64 0.2.35-7.oe1 EPOL
zvbi-devel.x86_64 0.2.35-7.oe1 EPOL
zvbi-help.x86_64 0.2.35-7.oe1 EPOL
zziplib.src 0.13.69-5.oe1 source
zziplib.x86_64 0.13.69-5.oe1 OS
zziplib.x86_64 0.13.69-5.oe1 everything
zziplib-debuginfo.x86_64 0.13.69-5.oe1 debuginfo
zziplib-debugsource.x86_64 0.13.69-5.oe1 debuginfo
zziplib-devel.x86_64 0.13.69-5.oe1 everything
zziplib-help.noarch 0.13.69-5.oe1 OS
zziplib-help.noarch 0.13.69-5.oe1 everything
[root@localhost yum.repos.d]#
[root@localhost ~]# yum makecache
OS 45 kB/s | 3.8 kB 00:00
everything 53 kB/s | 3.8 kB 00:00
EPOL 47 kB/s | 2.9 kB 00:00
debuginfo 70 kB/s | 3.8 kB 00:00
source 55 kB/s | 2.9 kB 00:00
Metadata cache created.
[root@localhost ~]# yum repolist
repo id repo name
EPOL EPOL
OS OS
debuginfo debuginfo
everything everything
source source
[root@localhost ~]#
三、使用RPM命令管理软件
1、RPM查询命令
步骤1:执行以下命令,通过yum和rpm方式查询openjdk包名称
[root@localhost yum.repos.d]# cd
[root@localhost ~]# yum list all | grep 1.8.0-openjdk
java-1.8.0-openjdk.src 1:1.8.0.242.b08-1.h5.oe1 source
java-1.8.0-openjdk.x86_64 1:1.8.0.242.b08-1.h5.oe1 OS
java-1.8.0-openjdk.x86_64 1:1.8.0.242.b08-1.h5.oe1 everything
java-1.8.0-openjdk-debuginfo.x86_64 1:1.8.0.242.b08-1.h5.oe1 debuginfo
java-1.8.0-openjdk-debugsource.x86_64 1:1.8.0.242.b08-1.h5.oe1 debuginfo
java-1.8.0-openjdk-demo.x86_64 1:1.8.0.242.b08-1.h5.oe1 everything
java-1.8.0-openjdk-devel.x86_64 1:1.8.0.242.b08-1.h5.oe1 OS
java-1.8.0-openjdk-devel.x86_64 1:1.8.0.242.b08-1.h5.oe1 everything
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.242.b08-1.h5.oe1 OS
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.242.b08-1.h5.oe1 everything
java-1.8.0-openjdk-javadoc.noarch 1:1.8.0.242.b08-1.h5.oe1 everything
java-1.8.0-openjdk-src.x86_64 1:1.8.0.242.b08-1.h5.oe1 everything
[root@localhost ~]#
步骤2:查询openjdk是否安装
[root@localhost ~]# rpm -q java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.x86_64.rpm
错误:打开 java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.x86_64.rpm 失败: 没有那个文件或目录
[root@localhost ~]#
2、RPM安装命令
步骤1:执行以下命令,下载openjdk和zziplib安装包
[root@localhost ~]# ll
总用量 0
[root@localhost ~]# wget https://repo.openeuler.org/openEuler-20.03-LTS/everything/x86_64/Packages/java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.x86_64.rpm
--2022-12-29 15:10:31-- https://repo.openeuler.org/openEuler-20.03-LTS/everything/x86_64/Packages/java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.x86_64.rpm
正在解析主机 repo.openeuler.org (repo.openeuler.org)... 49.0.230.196
正在连接 repo.openeuler.org (repo.openeuler.org)|49.0.230.196|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:398792 (389K) [application/x-redhat-package-manager]
正在保存至: “java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.x86_64.rpm”
java-1.8.0-openjdk-1.8.0.242. 100%[=================================================>] 389.45K --.-KB/s 用时 0.07s
2022-12-29 15:10:31 (5.11 MB/s) - 已保存 “java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.x86_64.rpm” [398792/398792])
[root@localhost ~]# wget https://repo.openeuler.org/openEuler-20.03-LTS/everything/x86_64/Packages/zziplib-0.13.69-5.oe1.x86_64.rpm
--2022-12-29 15:10:37-- https://repo.openeuler.org/openEuler-20.03-LTS/everything/x86_64/Packages/zziplib-0.13.69-5.oe1.x86_64.rpm
正在解析主机 repo.openeuler.org (repo.openeuler.org)... 49.0.230.196
正在连接 repo.openeuler.org (repo.openeuler.org)|49.0.230.196|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:100460 (98K) [application/x-redhat-package-manager]
正在保存至: “zziplib-0.13.69-5.oe1.x86_64.rpm”
zziplib-0.13.69-5.oe1.x86_64. 100%[=================================================>] 98.11K --.-KB/s 用时 0.04s
2022-12-29 15:10:37 (2.62 MB/s) - 已保存 “zziplib-0.13.69-5.oe1.x86_64.rpm” [100460/100460])
[root@localhost ~]# ll
总用量 492K
-rw-------. 1 root root 390K 3月 26 2020 java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.x86_64.rpm
-rw-------. 1 root root 99K 3月 26 2020 zziplib-0.13.69-5.oe1.x86_64.rpm
[root@localhost ~]#
步骤2:rpm安装openjdk 1.8,结果无法解决软件包的依赖关系
[root@localhost ~]# rpm -ivh java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1. x86_64.rpm
错误:打开 java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1. 失败: 没有那个文件或目录
错误:打开 x86_64.rpm 失败: 没有那个文件或目录
[root@localhost ~]#
步骤3:使用yum安装openjdk
[root@localhost ~]# yum -y install java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.x86_64.rpm
Last metadata expiration check: 0:07:42 ago on 2022年12月29日 星期四 15时04分11秒.
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing:
java-1.8.0-openjdk x86_64 1:1.8.0.242.b08-1.h5.oe1 @commandline 389 k
Installing dependencies:
copy-jdk-configs noarch 3.7-3.oe1 OS 23 k
java-1.8.0-openjdk-headless x86_64 1:1.8.0.242.b08-1.h5.oe1 OS 33 M
javapackages-filesystem noarch 5.3.0-2.oe1 OS 10 k
lksctp-tools x86_64 1.0.16-11.oe1 OS 59 k
lua-posix x86_64 33.3.1-12.oe1 OS 168 k
xorg-x11-fonts-others noarch 7.5-24.oe1 OS 7.4 M
Transaction Summary
========================================================================================================================
Install 7 Packages
Total size: 41 M
Total download size: 40 M
Installed size: 118 M
Downloading Packages:
(1/6): javapackages-filesystem-5.3.0-2.oe1.noarch.rpm 205 kB/s | 10 kB 00:00
(2/6): copy-jdk-configs-3.7-3.oe1.noarch.rpm 397 kB/s | 23 kB 00:00
(3/6): lksctp-tools-1.0.16-11.oe1.x86_64.rpm 1.4 MB/s | 59 kB 00:00
(4/6): lua-posix-33.3.1-12.oe1.x86_64.rpm 611 kB/s | 168 kB 00:00
(5/6): xorg-x11-fonts-others-7.5-24.oe1.noarch.rpm 211 kB/s | 7.4 MB 00:35
(6/6): java-1.8.0-openjdk-headless-1.8.0.242.b08-1.h5.oe1.x86_64.rpm 294 kB/s | 33 MB 01:53
------------------------------------------------------------------------------------------------------------------------
Total 363 kB/s | 40 MB 01:53
警告:/var/cache/dnf/OS-4d13fabbb2aeb21e/packages/copy-jdk-configs-3.7-3.oe1.noarch.rpm: 头V3 RSA/SHA1 Signature, 密钥 ID b25e7f66: NOKEY
OS 34 kB/s | 2.1 kB 00:00
Importing GPG key 0xB25E7F66:
Userid : "private OBS (key without passphrase) <defaultkey@localobs>"
Fingerprint: 12EA 74AC 9DF4 8D46 C69C A0BE D557 065E B25E 7F66
From : http://repo.openeuler.org/openEuler-20.03-LTS/OS/x86_64/RPM-GPG-KEY-openEuler
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Running scriptlet: copy-jdk-configs-3.7-3.oe1.noarch 1/1
Running scriptlet: java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.oe1.x86_64 1/1
Preparing : 1/1
Installing : xorg-x11-fonts-others-7.5-24.oe1.noarch 1/7
Running scriptlet: xorg-x11-fonts-others-7.5-24.oe1.noarch 1/7
Installing : lua-posix-33.3.1-12.oe1.x86_64 2/7
Installing : copy-jdk-configs-3.7-3.oe1.noarch 3/7
Running scriptlet: lksctp-tools-1.0.16-11.oe1.x86_64 4/7
Installing : lksctp-tools-1.0.16-11.oe1.x86_64 4/7
Running scriptlet: lksctp-tools-1.0.16-11.oe1.x86_64 4/7
Installing : javapackages-filesystem-5.3.0-2.oe1.noarch 5/7
Installing : java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.oe1.x86_64 6/7
Running scriptlet: java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.oe1.x86_64 6/7
Installing : java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.oe1.x86_64 7/7
Running scriptlet: java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.oe1.x86_64 7/7
Running scriptlet: copy-jdk-configs-3.7-3.oe1.noarch 7/7
Running scriptlet: java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.oe1.x86_64 7/7
Verifying : copy-jdk-configs-3.7-3.oe1.noarch 1/7
Verifying : java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.oe1.x86_64 2/7
Verifying : javapackages-filesystem-5.3.0-2.oe1.noarch 3/7
Verifying : lksctp-tools-1.0.16-11.oe1.x86_64 4/7
Verifying : lua-posix-33.3.1-12.oe1.x86_64 5/7
Verifying : xorg-x11-fonts-others-7.5-24.oe1.noarch 6/7
Verifying : java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.oe1.x86_64 7/7
Installed:
java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.oe1.x86_64 copy-jdk-configs-3.7-3.oe1.noarch
java-1.8.0-openjdk-headless-1:1.8.0.242.b08-1.h5.oe1.x86_64 javapackages-filesystem-5.3.0-2.oe1.noarch
lksctp-tools-1.0.16-11.oe1.x86_64 lua-posix-33.3.1-12.oe1.x86_64
xorg-x11-fonts-others-7.5-24.oe1.noarch
Complete!
[root@localhost ~]#
步骤4:验证openjdk安装成功
[root@localhost ~]# java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
[root@localhost ~]#
步骤5:使用rpm安装zziplib
[root@localhost ~]# rpm -ivh zziplib-0.13.69-5.oe1.x86_64.rpm
Verifying... ################################# [100%]
准备中... ################################# [100%]
正在升级/安装...
1:zziplib-0.13.69-5.oe1 ################################# [100%]
[root@localhost ~]#
3、RPM升级命令
步骤1:执行以下命令,升级openjdk
[root@localhost ~]# rpm -Uvh java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.x86_64.rpm
Verifying... ################################# [100%]
准备中... ################################# [100%]
软件包 java-1.8.0-openjdk-1:1.8.0.242.b08-1.h5.oe1.x86_64 已经安装
[root@localhost ~]#
步骤2:执行以下命令,升级zziplib
[root@localhost ~]# rpm -Uvh zziplib-0.13.69-5.oe1.x86_64.rpm
Verifying... ################################# [100%]
准备中... ################################# [100%]
软件包 zziplib-0.13.69-5.oe1.x86_64 已经安装
[root@localhost ~]#
4、RPM常用参数
步骤1:查询已安装的软件包中的文件列表和完整目录
[root@localhost ~]# rpm -ql python3-libxml2-2.9.8-9.oe1.x86_64
/usr/lib64/python3.7/site-packages/__pycache__/drv_libxml2.cpython-37.opt-1.pyc
/usr/lib64/python3.7/site-packages/__pycache__/drv_libxml2.cpython-37.pyc
/usr/lib64/python3.7/site-packages/__pycache__/libxml2.cpython-37.opt-1.pyc
/usr/lib64/python3.7/site-packages/__pycache__/libxml2.cpython-37.pyc
/usr/lib64/python3.7/site-packages/drv_libxml2.py
/usr/lib64/python3.7/site-packages/libxml2.py
/usr/lib64/python3.7/site-packages/libxml2mod.so
/usr/share/doc/python3-libxml2
/usr/share/doc/python3-libxml2/TODO
/usr/share/doc/python3-libxml2/apibuild.py
/usr/share/doc/python3-libxml2/index.py
/usr/share/doc/python3-libxml2/libxml2class.txt
/usr/share/doc/python3-libxml2/python.html
[root@localhost ~]#
步骤2:查询软件包的详细信息
[root@localhost ~]# rpm -qi python3-libxml2-2.9.8-9.oe1.x86_64
Name : python3-libxml2
Version : 2.9.8
Release : 9.oe1
Architecture: x86_64
Install Date: 2022年12月28日 星期三 10时47分47秒
Group : Development/Libraries
Size : 1337388
License : MIT
Signature : RSA/SHA1, 2020年03月24日 星期二 03时15分34秒, Key ID d557065eb25e7f66
Source RPM : libxml2-2.9.8-9.oe1.src.rpm
Build Date : 2020年03月24日 星期二 03时08分40秒
Build Host : obs-worker-100-0002.novalocal
Packager : http://openeuler.org
Vendor : http://openeuler.org
URL : http://xmlsoft.org/
Summary : Python 3 bindings for the libxml2 library
Description :
The libxml2-python3 package contains a Python 3 module that permits
applications written in the Python programming language, version 3, to use the
interface supplied by the libxml2 library to manipulate XML files.
This library allows to manipulate XML files. It includes support
to read, modify and write XML and HTML files. There is DTDs support
this includes parsing and validation even with complex DTDs, either
at parse time or later once the document has been modified.
[root@localhost ~]#
5、RPM卸载命令
步骤1:执行以下命令,显示已安装zziplib
[root@localhost ~]# rpm -qa | grep zziplib
zziplib-0.13.69-5.oe1.x86_64
[root@localhost ~]#
步骤2:卸载zziplib
[root@localhost ~]# rpm -e zziplib-0.13.69-5.oe1.x86_64
[root@localhost ~]#
步骤3:再次输入“rpm -qa | grep zziplib”有报错提示未安装,说明zziplib已经卸载
[root@localhost ~]# rpm -qa | grep zziplib
[root@localhost ~]#
四、DNF管理软件包(选)
1、DNF管理软件包操作
步骤1:使用工具将openEuler-20.03-LTS-everything-x86_64-dvd.iso上传至openEuler01虚拟机的/root目录下,然后执行如下命令挂载ISO
[root@localhost /]# wget http://192.168.xxx.xxx/openEuler-20.03-LTS-everything-x86_64-dvd.iso
--2022-12-29 15:23:21-- http://192.168.xxx.xxx/openEuler-20.03-LTS-everything-x86_64-dvd.iso
正在连接 192.168.xxx.xxx:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:12051687424 (11G) [application/octet-stream]
正在保存至: “openEuler-20.03-LTS-everything-x86_64-dvd.iso”
openEuler-20.03-LTS-everythin 100%[=================================================>] 11.22G 57.7MB/s 用时 2m 50s
2022-12-29 15:26:11 (67.4 MB/s) - 已保存 “openEuler-20.03-LTS-everything-x86_64-dvd.iso” [12051687424/12051687424])
[root@localhost /]#
[root@localhost ~]# ll
总用量 12G
-rw-------. 1 root root 1.4K 12月 28 10:52 anaconda-ks.cfg
drwx------. 2 root root 4.0K 12月 29 15:41 mnt
-rw-------. 1 root root 12G 11月 30 22:48 openEuler-20.03-LTS-everything-x86_64-dvd.iso
[root@localhost ~]# mount -o loop /root/openEuler-20.03-LTS-everything-x86_64-dvd.iso /root/mnt/
mount: /root/mnt: WARNING: source write-protected, mounted read-only.
[root@localhost ~]# cd mnt
[root@localhost mnt]# ll
总用量 2.2M
dr-xr-xr-x. 2 root root 2.0K 3月 25 2020 docs
dr-xr-xr-x. 3 root root 2.0K 3月 25 2020 EFI
dr-xr-xr-x. 3 root root 2.0K 3月 25 2020 images
dr-xr-xr-x. 2 root root 2.0K 3月 25 2020 isolinux
dr-xr-xr-x. 2 root root 2.0K 3月 25 2020 ks
dr-xr-xr-x. 2 root root 2.1M 3月 25 2020 Packages
dr-xr-xr-x. 2 root root 4.0K 3月 25 2020 repodata
-r--r--r--. 1 root root 2.1K 3月 25 2020 RPM-GPG-KEY-openEuler
-r--r--r--. 1 root root 2.2K 3月 25 2020 TRANS.TBL
[root@localhost mnt]#
步骤2:执行以下命令,查看dnf配置文件内容
[root@localhost ~]# cat /etc/dnf/dnf.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
步骤3:添加软件源
[root@localhost ~]# dnf config-manager --add-repo file:///root/mnt/
添加仓库自:file:///root/mnt/
步骤4:使用命令vim /etc/yum.repos.d/mnt_.repo打开编辑文件,在最后添加以下代码
gpgcheck=1
gpgkey=file:///root/mnt/RPM-GPG-KEY-openEuler
步骤5:执行以下命令,验证启用和禁用软件源
[root@openEuler ~]# dnf repolist
[root@openEuler ~]# dnf config-manager --set-disable mnt_
[root@openEuler ~]# dnf repolist
[root@openEuler ~]# dnf config-manager --set-enable mnt_
[root@openEuler ~]# dnf repolist
步骤6:搜索openjdk软件包
[root@localhost ~]# dnf search openjdk
Last metadata expiration check: 0:00:54 ago on 2022年12月29日 星期四 15时59分25秒.
=========================================== Name & Summary Matched: openjdk ============================================
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos 8
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle 8
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment 8
java-1.8.0-openjdk.src : OpenJDK Runtime Environment 8
java-1.8.0-openjdk-javadoc.noarch : OpenJDK 8 API documentation
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment 8
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Headless Runtime Environment 8
java-1.8.0-openjdk-debugsource.x86_64 : Debug sources for package java-1.8.0-openjdk
java-1.8.0-openjdk-debuginfo.x86_64 : Debug information for package java-1.8.0-openjdk
=============================================== Summary Matched: openjdk ===============================================
openEuler-latest-release.x86_64 : System information like kernelversion, openeulerversion, gccversion, openjdkversion
: and compile time
openEuler-latest-release.src : System information like kernelversion, openeulerversion, gccversion, openjdkversion and
: compile time
[root@localhost ~]#
步骤7:列出软件包清单,已安装软件包清单和可用软件包清单
[root@localhost ~]# dnf list all
Last metadata expiration check: 0:03:13 ago on 2022年12月29日 星期四 15时59分25秒.
Installed Packages
CUnit.x86_64 2.1.3-21.oe1 @anaconda
GConf2.x86_64 3.2.6-24.oe1 @anaconda
GeoIP.x86_64 1.6.12-5.oe1 @anaconda
GeoIP-GeoLite-data.noarch 2018.06-3.oe1 @anaconda
ModemManager-glib.x86_64 1.8.0-7.oe1 @anaconda
NetworkManager.x86_64 1:1.16.0-7.oe1 @anaconda
NetworkManager-config-server.noarch 1:1.16.0-7.oe1 @anaconda
NetworkManager-libnm.x86_64 1:1.16.0-7.oe1 @anaconda
.
.
.
.
.
.
zvbi-devel.x86_64 0.2.35-7.oe1 EPOL
zvbi-help.x86_64 0.2.35-7.oe1 EPOL
zziplib.src 0.13.69-5.oe1 source
zziplib.x86_64 0.13.69-5.oe1 OS
zziplib.x86_64 0.13.69-5.oe1 everything
zziplib-debuginfo.x86_64 0.13.69-5.oe1 debuginfo
zziplib-debugsource.x86_64 0.13.69-5.oe1 debuginfo
zziplib-devel.x86_64 0.13.69-5.oe1 everything
zziplib-help.noarch 0.13.69-5.oe1 OS
zziplib-help.noarch 0.13.69-5.oe1 everything
[root@localhost ~]# dnf list installed
Installed Packages
CUnit.x86_64 2.1.3-21.oe1 @anaconda
GConf2.x86_64 3.2.6-24.oe1 @anaconda
GeoIP.x86_64 1.6.12-5.oe1 @anaconda
GeoIP-GeoLite-data.noarch 2018.06-3.oe1 @anaconda
ModemManager-glib.x86_64 1.8.0-7.oe1 @anaconda
NetworkManager.x86_64 1:1.16.0-7.oe1 @anaconda
NetworkManager-config-server.noarch 1:1.16.0-7.oe1 @anaconda
NetworkManager-libnm.x86_64 1:1.16.0-7.oe1 @anaconda
PackageKit.x86_64 1.1.12-8.oe1 @anaconda
.
.
.
.
.
.
xorg-x11-fonts.noarch 7.5-24.oe1 @anaconda
xorg-x11-server-utils.x86_64 7.7-28.oe1 @anaconda
xz.x86_64 5.2.4-10.oe1 @anaconda
xz-libs.x86_64 5.2.4-10.oe1 @anaconda
yajl.x86_64 2.1.0-12.oe1 @anaconda
yum.noarch 4.2.15-8.oe1 @anaconda
zip.x86_64 3.0-25.oe1 @anaconda
zlib.x86_64 1.2.11-17.oe1 @anaconda
zsh.x86_64 5.7.1-4.oe1 @anaconda
zstd.x86_64 1.3.6-3.oe1 @anaconda
[root@localhost ~]#
[root@localhost ~]# dnf list available
Last metadata expiration check: 0:05:12 ago on 2022年12月29日 星期四 16时03分09秒.
Available Packages
CUnit.src 2.1.3-21.oe1 source
CUnit-debuginfo.x86_64 2.1.3-21.oe1 debuginfo
CUnit-debugsource.x86_64 2.1.3-21.oe1 debuginfo
CUnit-devel.x86_64 2.1.3-21.oe1 everything
CUnit-help.noarch 2.1.3-21.oe1 everything
Cython.src 0.29.14-1.oe1 source
Cython-debuginfo.x86_64 0.29.14-1.oe1 debuginfo
Cython-debugsource.x86_64 0.29.14-1.oe1 debuginfo
.
.
.
.
.
.
zstd-help.noarch 1.3.6-3.oe1 OS
zvbi.x86_64 0.2.35-7.oe1 EPOL
zvbi-devel.x86_64 0.2.35-7.oe1 EPOL
zvbi-help.x86_64 0.2.35-7.oe1 EPOL
zziplib.src 0.13.69-5.oe1 source
zziplib.x86_64 0.13.69-5.oe1 OS
zziplib-debuginfo.x86_64 0.13.69-5.oe1 debuginfo
zziplib-debugsource.x86_64 0.13.69-5.oe1 debuginfo
zziplib-devel.x86_64 0.13.69-5.oe1 everything
zziplib-help.noarch 0.13.69-5.oe1 OS
[root@localhost ~]#
步骤8:显示RPM包信息
[root@localhost ~]# dnf info java-1.8.0-openjdk.x86_64
Last metadata expiration check: 0:07:51 ago on 2022年12月29日 星期四 16时03分09秒.
Available Packages
Name : java-1.8.0-openjdk
Epoch : 1
Version : 1.8.0.242.b08
Release : 1.h5.oe1
Architecture : x86_64
Size : 389 k
Source : java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.src.rpm
Repository : OS
Summary : OpenJDK Runtime Environment 8
URL : http://openjdk.java.net
License : ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG
: and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib
Description : The OpenJDK runtime environment.
Name : java-1.8.0-openjdk
Epoch : 1
Version : 1.8.0.242.b08
Release : 1.h5.oe1
Architecture : x86_64
Size : 389 k
Source : java-1.8.0-openjdk-1.8.0.242.b08-1.h5.oe1.src.rpm
Repository : everything
Summary : OpenJDK Runtime Environment 8
URL : http://openjdk.java.net
License : ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG
: and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib
Description : The OpenJDK runtime environment.
[root@localhost ~]#
步骤9:执行以下命令,显示管理软件包组
[root@localhost ~]# dnf groups summary
Last metadata expiration check: 0:11:45 ago on 2022年12月29日 星期四 16时03分09秒.
Installed Groups: 9
[root@localhost ~]# dnf group list
Last metadata expiration check: 0:11:50 ago on 2022年12月29日 星期四 16时03分09秒.
Available Environment Groups:
最小安装
虚拟化主机
Installed Environment Groups:
服务器
Installed Groups:
容器管理
开发工具
无图形终端系统管理工具
传统 UNIX 兼容性
网络服务器
科学记数法支持
安全性工具
系统工具
智能卡支持
[root@localhost ~]#
步骤10:显示已安装的软件包组信息
[root@localhost ~]# dnf group --installed –v
Invalid groups sub-command, use: summary, list, info, remove, install, upgrade, mark.
[root@localhost ~]#
步骤11:检查并更新
[root@localhost ~]# dnf check-update
Last metadata expiration check: 0:13:02 ago on 2022年12月29日 星期四 16时03分09秒.
Obsoleting Packages
linux-firmware.noarch 20190815-4.oe1 @anaconda
linux-firmware.noarch 20190815-4.oe1 @anaconda
linux-firmware.noarch 20190815-4.oe1 OS
linux-firmware.noarch 20190815-4.oe1 @anaconda
linux-firmware.noarch 20190815-4.oe1 everything
linux-firmware.noarch 20190815-4.oe1 @anaconda
[root@localhost ~]#
五、安装个人网盘应用
1、实验介绍
Nextcloud是一款非常热门的开源个人网盘应用,本实验通过编译安装依赖组件、dnf安装软件包等方式,在openEuler服务器上安装部署Nextcloud应用并完成验证。
2、实验流程
3、安装依赖组件
步骤1:执行以下命令,安装依赖和基础工具
[root@localhost ~]# dnf install -y unzip curl wget bash-completion policycoreutils-python-utils mlocate bzip2
Last metadata expiration check: 0:24:00 ago on 2022年12月29日 星期四 16时03分09秒.
Package unzip-6.0-45.oe1.x86_64 is already installed.
Package curl-7.66.0-2.oe1.x86_64 is already installed.
Package wget-1.20.3-1.oe1.x86_64 is already installed.
Package bash-completion-1:2.8-9.oe1.noarch is already installed.
Package policycoreutils-python-utils-2.8-14.oe1.noarch is already installed.
Package mlocate-0.26-24.oe1.x86_64 is already installed.
Package bzip2-1.0.8-3.oe1.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
[root@localhost ~]#
注意:若安装过程中有报错,请重新执行整条安装命令。
4、安装Apache服务器
步骤1:执行以下命令,安装Apache web服务器
[root@localhost ~]# dnf install -y httpd
Last metadata expiration check: 0:27:17 ago on 2022年12月29日 星期四 16时03分09秒.
Package httpd-2.4.34-15.oe1.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!
步骤2:启动Apache网络服务
[root@localhost ~]# systemctl enable httpd.service
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
[root@localhost ~]# systemctl start httpd.service
[root@localhost ~]#
5、安装PHP
步骤1:执行以下命令,重置并安装PHP
[root@localhost ~]# dnf install -y php php-devel
Last metadata expiration check: 0:29:28 ago on 2022年12月29日 星期四 16时03分09秒.
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing:
php x86_64 7.2.10-3.oe1 everything 1.4 M
php-devel x86_64 7.2.10-3.oe1 everything 657 k
Installing dependencies:
pcre-devel x86_64 8.43-5.oe1 OS 417 k
php-cli x86_64 7.2.10-3.oe1 everything 2.8 M
php-common x86_64 7.2.10-3.oe1 everything 478 k
Transaction Summary
========================================================================================================================
Install 5 Packages
Total download size: 5.7 M
Installed size: 26 M
Downloading Packages:
(1/5): pcre-devel-8.43-5.oe1.x86_64.rpm 132 kB/s | 417 kB 00:03
(2/5): php-common-7.2.10-3.oe1.x86_64.rpm 186 kB/s | 478 kB 00:02
(3/5): php-devel-7.2.10-3.oe1.x86_64.rpm 171 kB/s | 657 kB 00:03
(4/5): php-7.2.10-3.oe1.x86_64.rpm 125 kB/s | 1.4 MB 00:11
(5/5): php-cli-7.2.10-3.oe1.x86_64.rpm 197 kB/s | 2.8 MB 00:14
------------------------------------------------------------------------------------------------------------------------
Total 400 kB/s | 5.7 MB 00:14
警告:/var/cache/dnf/OS-4d13fabbb2aeb21e/packages/pcre-devel-8.43-5.oe1.x86_64.rpm: 头V3 RSA/SHA1 Signature, 密钥 ID b25e7f66: NOKEY
OS 30 kB/s | 2.1 kB 00:00
Importing GPG key 0xB25E7F66:
Userid : "private OBS (key without passphrase) <defaultkey@localobs>"
Fingerprint: 12EA 74AC 9DF4 8D46 C69C A0BE D557 065E B25E 7F66
From : http://repo.openeuler.org/openEuler-20.03-LTS/OS/x86_64/RPM-GPG-KEY-openEuler
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : php-common-7.2.10-3.oe1.x86_64 1/5
Installing : php-cli-7.2.10-3.oe1.x86_64 2/5
Installing : pcre-devel-8.43-5.oe1.x86_64 3/5
Installing : php-devel-7.2.10-3.oe1.x86_64 4/5
Installing : php-7.2.10-3.oe1.x86_64 5/5
Running scriptlet: php-7.2.10-3.oe1.x86_64 5/5
Verifying : pcre-devel-8.43-5.oe1.x86_64 1/5
Verifying : php-7.2.10-3.oe1.x86_64 2/5
Verifying : php-cli-7.2.10-3.oe1.x86_64 3/5
Verifying : php-common-7.2.10-3.oe1.x86_64 4/5
Verifying : php-devel-7.2.10-3.oe1.x86_64 5/5
Installed:
php-7.2.10-3.oe1.x86_64 php-devel-7.2.10-3.oe1.x86_64 pcre-devel-8.43-5.oe1.x86_64 php-cli-7.2.10-3.oe1.x86_64
php-common-7.2.10-3.oe1.x86_64
Complete!
步骤2:安装PHP所需模块
[root@localhost ~]# dnf install -y php php-gd php-mbstring php-intl php-mysqlnd php-opcache php-json php-pgsql php-fpm php-dom
Last metadata expiration check: 0:30:31 ago on 2022年12月29日 星期四 16时03分09秒.
Package php-7.2.10-3.oe1.x86_64 is already installed.
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing:
php-fpm x86_64 7.2.10-3.oe1 everything 1.4 M
php-gd x86_64 7.2.10-3.oe1 everything 33 k
php-intl x86_64 7.2.10-3.oe1 everything 135 k
php-json x86_64 7.2.10-3.oe1 everything 25 k
php-mbstring x86_64 7.2.10-3.oe1 everything 416 k
php-mysqlnd x86_64 7.2.10-3.oe1 everything 128 k
php-opcache x86_64 7.2.10-3.oe1 everything 176 k
php-pgsql x86_64 7.2.10-3.oe1 everything 63 k
php-xml x86_64 7.2.10-3.oe1 everything 120 k
Installing dependencies:
postgresql-libs x86_64 10.5-12.oe1 OS 249 k
nginx-filesystem noarch 1:1.16.1-2.oe1 everything 8.8 k
oniguruma x86_64 6.9.0-2.oe1 everything 149 k
php-pdo x86_64 7.2.10-3.oe1 everything 68 k
Transaction Summary
========================================================================================================================
Install 13 Packages
Total download size: 3.0 M
Installed size: 9.3 M
Downloading Packages:
(1/13): nginx-filesystem-1.16.1-2.oe1.noarch.rpm 153 kB/s | 8.8 kB 00:00
(2/13): oniguruma-6.9.0-2.oe1.x86_64.rpm 1.5 MB/s | 149 kB 00:00
(3/13): php-gd-7.2.10-3.oe1.x86_64.rpm 1.6 MB/s | 33 kB 00:00
(4/13): postgresql-libs-10.5-12.oe1.x86_64.rpm 301 kB/s | 249 kB 00:00
(5/13): php-json-7.2.10-3.oe1.x86_64.rpm 296 kB/s | 25 kB 00:00
(6/13): php-intl-7.2.10-3.oe1.x86_64.rpm 59 kB/s | 135 kB 00:02
(7/13): php-mbstring-7.2.10-3.oe1.x86_64.rpm 152 kB/s | 416 kB 00:02
(8/13): php-mysqlnd-7.2.10-3.oe1.x86_64.rpm 105 kB/s | 128 kB 00:01
(9/13): php-pdo-7.2.10-3.oe1.x86_64.rpm 112 kB/s | 68 kB 00:00
(10/13): php-pgsql-7.2.10-3.oe1.x86_64.rpm 220 kB/s | 63 kB 00:00
(11/13): php-opcache-7.2.10-3.oe1.x86_64.rpm 183 kB/s | 176 kB 00:00
(12/13): php-xml-7.2.10-3.oe1.x86_64.rpm 333 kB/s | 120 kB 00:00
(13/13): php-fpm-7.2.10-3.oe1.x86_64.rpm 202 kB/s | 1.4 MB 00:07
------------------------------------------------------------------------------------------------------------------------
Total 415 kB/s | 3.0 MB 00:07
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : php-pdo-7.2.10-3.oe1.x86_64 1/13
Installing : oniguruma-6.9.0-2.oe1.x86_64 2/13
Running scriptlet: nginx-filesystem-1:1.16.1-2.oe1.noarch 3/13
Installing : nginx-filesystem-1:1.16.1-2.oe1.noarch 3/13
Installing : postgresql-libs-10.5-12.oe1.x86_64 4/13
Running scriptlet: postgresql-libs-10.5-12.oe1.x86_64 4/13
Installing : php-pgsql-7.2.10-3.oe1.x86_64 5/13
Installing : php-fpm-7.2.10-3.oe1.x86_64 6/13
Running scriptlet: php-fpm-7.2.10-3.oe1.x86_64 6/13
Installing : php-mbstring-7.2.10-3.oe1.x86_64 7/13
Installing : php-mysqlnd-7.2.10-3.oe1.x86_64 8/13
Installing : php-xml-7.2.10-3.oe1.x86_64 9/13
Installing : php-opcache-7.2.10-3.oe1.x86_64 10/13
Installing : php-json-7.2.10-3.oe1.x86_64 11/13
Installing : php-intl-7.2.10-3.oe1.x86_64 12/13
Installing : php-gd-7.2.10-3.oe1.x86_64 13/13
Running scriptlet: php-gd-7.2.10-3.oe1.x86_64 13/13
Verifying : postgresql-libs-10.5-12.oe1.x86_64 1/13
Verifying : nginx-filesystem-1:1.16.1-2.oe1.noarch 2/13
Verifying : oniguruma-6.9.0-2.oe1.x86_64 3/13
Verifying : php-fpm-7.2.10-3.oe1.x86_64 4/13
Verifying : php-gd-7.2.10-3.oe1.x86_64 5/13
Verifying : php-intl-7.2.10-3.oe1.x86_64 6/13
Verifying : php-json-7.2.10-3.oe1.x86_64 7/13
Verifying : php-mbstring-7.2.10-3.oe1.x86_64 8/13
Verifying : php-mysqlnd-7.2.10-3.oe1.x86_64 9/13
Verifying : php-opcache-7.2.10-3.oe1.x86_64 10/13
Verifying : php-pdo-7.2.10-3.oe1.x86_64 11/13
Verifying : php-pgsql-7.2.10-3.oe1.x86_64 12/13
Verifying : php-xml-7.2.10-3.oe1.x86_64 13/13
Installed:
php-fpm-7.2.10-3.oe1.x86_64 php-gd-7.2.10-3.oe1.x86_64 php-intl-7.2.10-3.oe1.x86_64
php-json-7.2.10-3.oe1.x86_64 php-mbstring-7.2.10-3.oe1.x86_64 php-mysqlnd-7.2.10-3.oe1.x86_64
php-opcache-7.2.10-3.oe1.x86_64 php-pgsql-7.2.10-3.oe1.x86_64 php-xml-7.2.10-3.oe1.x86_64
postgresql-libs-10.5-12.oe1.x86_64 nginx-filesystem-1:1.16.1-2.oe1.noarch oniguruma-6.9.0-2.oe1.x86_64
php-pdo-7.2.10-3.oe1.x86_64
Complete!
步骤3:安装cMake
[root@localhost ~]# dnf -y install cmake
Last metadata expiration check: 0:35:16 ago on 2022年12月29日 星期四 16时03分09秒.
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing:
cmake x86_64 3.12.1-5.oe1 OS 7.3 M
Installing dependencies:
cmake-data noarch 3.12.1-5.oe1 OS 1.3 M
cmake-filesystem x86_64 3.12.1-5.oe1 OS 11 k
cmake-rpm-macros noarch 3.12.1-5.oe1 OS 10 k
jsoncpp x86_64 1.8.4-6.oe1 OS 77 k
libuv x86_64 1:1.23.0-2.oe1 OS 73 k
rhash x86_64 1.3.5-5.oe1 OS 115 k
Transaction Summary
========================================================================================================================
Install 7 Packages
Total download size: 8.9 M
Installed size: 28 M
Downloading Packages:
(1/7): cmake-filesystem-3.12.1-5.oe1.x86_64.rpm 182 kB/s | 11 kB 00:00
(2/7): cmake-rpm-macros-3.12.1-5.oe1.noarch.rpm 599 kB/s | 10 kB 00:00
(3/7): jsoncpp-1.8.4-6.oe1.x86_64.rpm 186 kB/s | 77 kB 00:00
(4/7): libuv-1.23.0-2.oe1.x86_64.rpm 111 kB/s | 73 kB 00:00
(5/7): rhash-1.3.5-5.oe1.x86_64.rpm 149 kB/s | 115 kB 00:00
(6/7): cmake-data-3.12.1-5.oe1.noarch.rpm 159 kB/s | 1.3 MB 00:08
(7/7): cmake-3.12.1-5.oe1.x86_64.rpm 315 kB/s | 7.3 MB 00:23
------------------------------------------------------------------------------------------------------------------------
Total 385 kB/s | 8.9 MB 00:23
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : cmake-rpm-macros-3.12.1-5.oe1.noarch 1/7
Installing : cmake-filesystem-3.12.1-5.oe1.x86_64 2/7
Installing : rhash-1.3.5-5.oe1.x86_64 3/7
Running scriptlet: rhash-1.3.5-5.oe1.x86_64 3/7
Installing : libuv-1:1.23.0-2.oe1.x86_64 4/7
Installing : jsoncpp-1.8.4-6.oe1.x86_64 5/7
Running scriptlet: jsoncpp-1.8.4-6.oe1.x86_64 5/7
Installing : cmake-data-3.12.1-5.oe1.noarch 6/7
Installing : cmake-3.12.1-5.oe1.x86_64 7/7
Running scriptlet: cmake-3.12.1-5.oe1.x86_64 7/7
Verifying : cmake-3.12.1-5.oe1.x86_64 1/7
Verifying : cmake-data-3.12.1-5.oe1.noarch 2/7
Verifying : cmake-filesystem-3.12.1-5.oe1.x86_64 3/7
Verifying : cmake-rpm-macros-3.12.1-5.oe1.noarch 4/7
Verifying : jsoncpp-1.8.4-6.oe1.x86_64 5/7
Verifying : libuv-1:1.23.0-2.oe1.x86_64 6/7
Verifying : rhash-1.3.5-5.oe1.x86_64 7/7
Installed:
cmake-3.12.1-5.oe1.x86_64 cmake-data-3.12.1-5.oe1.noarch cmake-filesystem-3.12.1-5.oe1.x86_64
cmake-rpm-macros-3.12.1-5.oe1.noarch jsoncpp-1.8.4-6.oe1.x86_64 libuv-1:1.23.0-2.oe1.x86_64
rhash-1.3.5-5.oe1.x86_64
Complete!
步骤4:软件包安装libzip
[root@localhost ~]# dnf -y install zlib-devel
[root@localhost ~]# wget https://nih.at/libzip/libzip-1.2.0.tar.gz
[root@localhost ~]# tar -zxvf libzip-1.2.0.tar.gz
[root@localhost ~]# cd libzip-1.2.0
[root@localhost libzip-1.2.0]# ./configure
[root@localhost libzip-1.2.0]# make -j2 && make install
步骤5:安装php-zip
[root@localhost libzip-1.2.0]# cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h
[root@localhost libzip-1.2.0]# cd
[root@localhost ~]# wget http://pecl.php.net/get/zip-1.19.0.tgz
[root@localhost ~]# tar -zxvf zip-1.19.0.tgz
[root@localhost ~]# cd zip-1.19.0
[root@localhost zip-1.19.0]# /usr/bin/phpize
[root@localhost zip-1.19.0]# ./configure --with-php-config=/usr/bin/php-config
[root@localhost zip-1.19.0]# make && make install
步骤6:使用vim命令打开/etc/php.ini文件,在[PHP]下面添加以下代码
extension=zip.so
步骤7:启动php-fpm
[root@localhost zip-1.19.0]# cd
[root@localhost ~]# systemctl start php-fpm
[root@localhost ~]# systemctl status php-fpm
● php-fpm.service - The PHP FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2022-12-29 16:46:26 CST; 16s ago
Main PID: 33834 (php-fpm)
Status: "Processes active: 0, idle: 5, Requests: 0, slow: 0, Traffic: 0req/sec"
Tasks: 6
Memory: 35.0M
CGroup: /system.slice/php-fpm.service
├─33834 php-fpm: master process (/etc/php-fpm.conf)
├─33835 php-fpm: pool www
├─33836 php-fpm: pool www
├─33837 php-fpm: pool www
├─33838 php-fpm: pool www
└─33839 php-fpm: pool www
12月 29 16:46:26 localhost.localdomain systemd[1]: Starting The PHP FastCGI Process Manager...
12月 29 16:46:26 localhost.localdomain systemd[1]: Started The PHP FastCGI Process Manager.
[root@localhost ~]#
步骤8:验证PHP安装版本
[root@localhost ~]# php -v
PHP 7.2.10 (cli) (built: Mar 23 2020 20:08:27) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10, Copyright (c) 1999-2018, by Zend Technologies
[root@localhost ~]#
步骤9:验证PHP安装模块
[root@localhost ~]# php -m
[PHP Modules]
bz2
calendar
Core
ctype
curl
date
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_pgsql
pdo_sqlite
pgsql
Phar
readline
Reflection
session
SimpleXML
sockets
SPL
sqlite3
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib
[Zend Modules]
Zend OPcache
[root@localhost ~]#
6、安装Nextcloud应用
步骤1:执行以下命令,进入/home目录,下载Nextcloud软件包
[root@localhost ~]# wget https://download.nextcloud.com/server/releases/nextcloud-20.0.14.tar.bz2
步骤2:解压Nextcloud软件包
[root@localhost ~]# tar -jxvpf nextcloud-20.0.14.tar.bz2
步骤3:拷贝文件夹至apache web服务器的根目录
[root@localhost ~]# cp -R nextcloud/ /var/www/html/
步骤4:创建数据文件夹
[root@localhost ~]# mkdir /var/www/html/nextcloud/data
步骤5:更改Apache对nextCloud文件夹的读写权限
[root@localhost ~]# chown -R apache:apache /var/www/html/nextcloud
步骤6:重启Apache
[root@localhost ~]# systemctl restart httpd.service
[root@localhost ~]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/httpd.service.d
└─php-fpm.conf
Active: active (running) since Thu 2022-12-29 17:00:07 CST; 10s ago
Docs: man:httpd.service(8)
Main PID: 36786 (httpd)
Status: "Running, listening on: port 443, port 80"
Tasks: 214
Memory: 16.9M
CGroup: /system.slice/httpd.service
├─36786 /usr/sbin/httpd -DFOREGROUND
├─36790 /usr/sbin/httpd -DFOREGROUND
├─36791 /usr/sbin/httpd -DFOREGROUND
├─36792 /usr/sbin/httpd -DFOREGROUND
├─36793 /usr/sbin/httpd -DFOREGROUND
└─36794 /usr/sbin/httpd -DFOREGROUND
12月 29 17:00:07 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
12月 29 17:00:07 localhost.localdomain httpd[36786]: AH00558: httpd: Could not reliably determine the server's fully qu>
12月 29 17:00:07 localhost.localdomain httpd[36786]: Server configured, listening on: port 443, port 80
12月 29 17:00:07 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
[root@localhost ~]#
步骤7:关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2022-12-29 17:00:52 CST; 9s ago
Docs: man:firewalld(1)
Process: 2248 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
Main PID: 2248 (code=exited, status=0/SUCCESS)
12月 29 15:52:34 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
12月 29 15:52:36 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
12月 29 17:00:52 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
12月 29 17:00:52 localhost.localdomain systemd[1]: firewalld.service: Succeeded.
12月 29 17:00:52 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
[root@localhost ~]#
步骤8:临时关闭SElinux
[root@localhost ~]# setenforce 0
7、验证结果
步骤1:在本地浏览器中访问:http://ip/nextcloud
步骤2:输入自定义的管理员用户名和密码,点击安装完成
注意:若遇到页面长时间在加载的情况,可以使用浏览器停止加载页面
,然后刷新页面。
步骤3:稍作等待,系统初始化完毕,点击右上角的关闭按钮,进入网盘主界面。