赞
踩
目录
源码包,含全部源代码,未经编译,安装时需编译;
rpm包(二进制包),事先已经过编译,安装时速度较快;
一,源码包安装
例:安装aparch源码包,源码下载 https://httpd.apache.org/download.cgi#apache24;
- [root@192 Desktop]# tar -zxvf http.4.52.tar.gz
- //缺失依赖包
- [root@192 httpd-2.4.52]# ./configure --prefix=/usr/local/apr
- checking for chosen layout... Apache
- checking for working mkdir -p... yes
- checking for grep that handles long lines and -e... /bin/grep
- checking for egrep... /bin/grep -E
- checking build system type... x86_64-pc-linux-gnu
- checking host system type... x86_64-pc-linux-gnu
- checking target system type... x86_64-pc-linux-gnu
- configure:
- configure: Configuring Apache Portable Runtime library...
- configure:
- checking for APR... no
- configure: error: APR not found. Please read the documentation.
- //可百度解决
- [root@192 httpd-2.4.52]# make
- [root@192 httpd-2.4.52]# make install
- [root@192 httpd-2.4.52]# usr/local/apr/bin/apachectl start
- [root@192 bin]# ps aux | grep 55017
- root 55017 0.0 0.1 76148 2952 ? Ss 22:51 0:00 /usr/local/apr/bin/httpd -k start
- [root@192 httpd-2.4.52]# netstat -tlun | grep 80
- tcp6 0 0 :::80 :::* LISTEN
- [root@192 httpd-2.4.52]# usr/local/apr/bin/apachectl stop
二,RPM工具
RPM包默认安装路径
RPM包校验
RPM数字证书验证
/etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
位置处;三,YUM工具
- [wz@192 Desktop]$ ll /etc/yum.repos.d/
- 总用量 40
- -rw-r--r--. 1 root root 1664 10月 23 2020 CentOS-Base.repo
- -rw-r--r--. 1 root root 1309 10月 23 2020 CentOS-CR.repo
- -rw-r--r--. 1 root root 649 10月 23 2020 CentOS-Debuginfo.repo
- -rw-r--r--. 1 root root 314 10月 23 2020 CentOS-fasttrack.repo
- -rw-r--r--. 1 root root 630 10月 23 2020 CentOS-Media.repo
- -rw-r--r--. 1 root root 1331 10月 23 2020 CentOS-Sources.repo
- -rw-r--r--. 1 root root 8515 10月 23 2020 CentOS-Vault.repo
- -rw-r--r--. 1 root root 616 10月 23 2020 CentOS-x86_64-kernel.repo
- [wz@VM-4-4-centos ~]$ yum list sl.x86_64
- Loaded plugins: fastestmirror, langpacks
- Repository epel is listed more than once in the configuration
- Loading mirror speeds from cached hostfile
- Installed Packages
- sl.x86_64 5.02-1.el7 @epe
- [wz@VM-4-4-centos ~]$ yum info sl.x86_64
- Loaded plugins: fastestmirror, langpacks
- Repository epel is listed more than once in the configuration
- Loading mirror speeds from cached hostfile
- Installed Packages
- Name : sl
- Arch : x86_64
- Version : 5.02
- Release : 1.el7
- Size : 17 k
- Repo : installed
- From repo : epel
- Summary : Joke command for when you type 'sl' instead of 'ls'
- URL : https://github.com/mtoyoda/sl
- License : Copyright only
- Description : The sl (Steam Locomotive) command is a joke which displays a train on your
- : terminal when you accidentally type 'sl' instead of 'ls'.
YUM安装
- yum -y install 包名
- -y,表示自动回复yes,不加需手动回复;
- install,表示安装;
- //库中无epel源,使用以下命令安装
- [wz@192 Desktop]$ yum install -y epel-release
- //安装后,库中就存在对应的源了
- [wz@192 Desktop]$ ll /etc/yum.repos.d/
- 总用量 48
- -rw-r--r--. 1 root root 1664 10月 23 2020 CentOS-Base.repo
- -rw-r--r--. 1 root root 1309 10月 23 2020 CentOS-CR.repo
- -rw-r--r--. 1 root root 649 10月 23 2020 CentOS-Debuginfo.repo
- -rw-r--r--. 1 root root 314 10月 23 2020 CentOS-fasttrack.repo
- -rw-r--r--. 1 root root 630 10月 23 2020 CentOS-Media.repo
- -rw-r--r--. 1 root root 1331 10月 23 2020 CentOS-Sources.repo
- -rw-r--r--. 1 root root 8515 10月 23 2020 CentOS-Vault.repo
- -rw-r--r--. 1 root root 616 10月 23 2020 CentOS-x86_64-kernel.repo
- -rw-r--r--. 1 root root 951 10月 2 2017 epel.repo
- -rw-r--r--. 1 root root 1050 10月 2 2017 epel-testing.repo
- [root@VM-4-4-centos ~]# yum -y install sl
- Loaded plugins: fastestmirror, langpacks
- Repository epel is listed more than once in the configuration
- Loading mirror speeds from cached hostfile
- Resolving Dependencies
- --> Running transaction check
- ---> Package sl.x86_64 0:5.02-1.el7 will be installed
- --> Finished Dependency Resolution
-
- Dependencies Resolved
-
- ==========================================================================================================
- Package Arch Version Repository Size
- ==========================================================================================================
- Installing:
- sl x86_64 5.02-1.el7 epel 14 k
-
- Transaction Summary
- ==========================================================================================================
- Install 1 Package
-
- Total download size: 14 k
- Installed size: 17 k
- Downloading packages:
- sl-5.02-1.el7.x86_64.rpm | 14 kB 00:00:00
- Running transaction check
- Running transaction test
- Transaction test succeeded
- Running transaction
- Installing : sl-5.02-1.el7.x86_64 1/1
- Verifying : sl-5.02-1.el7.x86_64 1/1
-
- Installed:
- sl.x86_64 0:5.02-1.el7
-
- Complete!
- [root@VM-4-4-centos ~]# yum -y update sl
- Loaded plugins: fastestmirror, langpacks
- Repository epel is listed more than once in the configuration
- Loading mirror speeds from cached hostfile
- No packages marked for update
YUM卸载
- yum -y remove 包名,卸载指定软件包;
- 卸载软件包会同时卸载所有与该包有依赖关系的其他软件包,即便依赖包属于系统运行必备的文件,也会无情卸载;
- [root@VM-4-4-centos ~]# yum -y remove sl
- Loaded plugins: fastestmirror, langpacks
- Repository epel is listed more than once in the configuration
- Resolving Dependencies
- --> Running transaction check
- ---> Package sl.x86_64 0:5.02-1.el7 will be erased
- --> Finished Dependency Resolution
-
- Dependencies Resolved
-
- ==========================================================================================================
- Package Arch Version Repository Size
- ==========================================================================================================
- Removing:
- sl x86_64 5.02-1.el7 @epel 17 k
-
- Transaction Summary
- ==========================================================================================================
- Remove 1 Package
-
- Installed size: 17 k
- Downloading packages:
- Running transaction check
- Running transaction test
- Transaction test succeeded
- Running transaction
- Erasing : sl-5.02-1.el7.x86_64 1/1
- Verifying : sl-5.02-1.el7.x86_64 1/1
-
- Removed:
- sl.x86_64 0:5.02-1.el7
-
- Complete!
yum 趣味小游戏
- 牛说,yum -y install cowsay;
- 变字符,yum -y install figlet;
注:验证网络通畅 —— ping www.baidu.com
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。