目录
1.rpm管理工具
- 使用rpm安装zsh(忽略依赖关系安装)
[root@localhost ~]# rpm -ivh --nodeps zsh-5.5.1-9.el8.x86_64.rpm
- 查询是否已安装
[root@localhost ~]# rpm -q zsh
- 卸载zsh
[root@localhost ~]# rpm -evh zsh
- 查询所有已安装软件
[root@localhost ~]# rpm -qa
- 查询date命令所在软件包
[root@localhost ~]# rpm -qa |grep date
- 查询未安装的zsh的文件信息
[root@localhost ~]# rpm -qi zsh-5.5.1-9.el8.x86_64.rpm
2. YUM/DNF管理工具
- yum本地源配置
挂载:
[root@localhost dev]# mount /dev/sr0 /mnt/
进入配置环境:
[root@localhost mnt]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# vim redhat.repo
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
- yum网络源配置
下载安装包传递到linux
sftp> put Centos-vault-8.5.2111.repo
重加载
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
- 安装httpd软件
[root@localhost ~]# yum install -y httpd
- 查看vim命令属于哪个软件包
[root@localhost ~]# yum provides vim
或:
[root@localhost ~]# ls -l /etc/vimrc
-rw-r--r--. 1 root root 1982 Sep 20 2021 /etc/vimrc
[root@localhost ~]# yum provides /etc/vimrc
- yum卸载httpd
[root@localhost ~]# yum remove -y httpd
- 清理缓存
[root@localhost ~]# yum clean packages all
- 重新创建缓存
[root@localhost ~]# yum makecache
- 安装postgresql模块中的版本13
[root@localhost ~]# yum install @postgresql:13
或:
[root@localhost ~]# yum module install postgresql:13
3. 源代码编译
- 源码安装: httpd
将httpd源码包从Windows传到Linux,并解压到创建的文件/usr/local/httpd.txt/中:
解压:
[root@localhost ~]# tar -xzvf httpd-2.4.54.tar.gz -C /usr/local/httpd.txt/
安装编译环境:
[root@localhost httpd.txt]# yum install -y gcc gcc-c++ libgcc
依赖包apr传输到Linux,并解压到文件httpd.txt/中:
安装依赖包:
[root@localhost httpd.txt]# cd apr-1.7.0
[root@localhost apr-1.7.0]# ls -l
[root@localhost apr-1.7.0]# ./configure --prefix=/usr/local/apr --with-extra-cflags=-Wno-deprecated-declarations
[root@localhost apr-1.7.0]# make
[root@localhost apr-1.7.0]# make install
[root@localhost apr-1.7.0]# cd ../apr-util-1.6.1/
[root@localhost apr-util-1.6.1]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
[root@localhost apr-util-1.6.1]# yum install expat-devel
[root@localhost apr-util-1.6.1]# make -i
[root@localhost apr-util-1.6.1]# make install
[root@localhost httpd-2.4.54]# yum install pcre2-devel -y
[root@localhost httpd-2.4.54]# yum install libtool-ltdl-devel -y
安装httpd :
[root@localhost httpd.txt]# cd httpd-2.4.54/
[root@localhost httpd-2.4.54]# ls -l
[root@localhost httpd-2.4.54]# ./configure --prefix=/usr/local/httpd --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
[root@localhost httpd-2.4.54]# make
[root@localhost httpd-2.4.54]# make install
检查、启动:
[root@localhost httpd-2.4.54]# find / -name "httpd"
[root@localhost httpd-2.4.54]# cd /usr/local/httpd/bin
[root@localhost bin]# ./apachectl start
[root@localhost bin]# ./httpd start
4.查看进程
- 查看root用户带有终端的进程
[root@localhost ~]# ps -ef |grep root
- 显示没有终端的进程
[root@localhost ~]# ps -xf
- 显示所有进程
[root@localhost ~]# ps -a
- 查看1分钟内占用CPU时间前10的进程(使用top命令)
[root@localhost ~]# top -d 60