软件包管理
[root@rocky8 yum.repos.d]# cat base-for-rocky8.repo [BaseOS] name=BaseOS baseurl=file:///mnt/cdrom/BaseOS https://mirrors.aliyun.com/rockylinux/$releasever/BaseOS/x86_64/os/ http://mirrors.163.com/rocky/$releasever/BaseOS/x86_64/os/ https://mirrors.nju.edu.cn/rocky/$releasever/BaseOS/x86_64/os/ https://mirrors.sjtug.sjtu.edu.cn/rocky/$releasever/BaseOS/x86_64/os/ http://mirrors.sdu.edu.cn/rocky/$releasever/BaseOS/x86_64/os/ gpgcheck=0 [AppStream] name=AppStream baseurl=file:///cdrom/AppStream https://mirrors.aliyun.com/rockylinux/$releasever/AppStream/x86_64/os/ http://mirrors.163.com/rocky/$releasever/AppStream/x86_64/os/ https://mirrors.nju.edu.cn/rocky/$releasever/AppStream/x86_64/os/ https://mirrors.sjtug.sjtu.edu.cn/rocky/$releasever/AppStream/x86_64/os/ http://mirrors.sdu.edu.cn/rocky/$releasever/AppStream/x86_64/os/ gpgcheck=0 [extras] name=extras baseurl=https://mirrors.aliyun.com/rockylinux/$releasever/extras/$basearch/os http://mirrors.163.com/rocky/$releasever/extras/$basearch/os https://mirrors.nju.edu.cn/rocky/$releasever/extras/$basearch/os https://mirrors.sjtug.sjtu.edu.cn/rocky/$releasever/extras/$basearch/os http://mirrors.sdu.edu.cn/rocky/$releasever/extras/$basearch/os gpgcheck=0 enabled=1 [PowerTools] name=CentOS-$releasever - PowerTools baseurl=https://mirrors.aliyun.com/rockylinux/$releasever/PowerTools/$basearch/os/ http://mirrors.163.com/rocky/$releasever/PowerTools/$basearch/os/ http://mirrors.sdu.edu.cn/rocky/$releasever/PowerTools/$basearch/os/ https://mirrors.sjtug.sjtu.edu.cn/rocky/$releasever/PowerTools/$basearch/os/ http://mirrors.sdu.edu.cn/rocky/$releasever/PowerTools/$basearch/os/ gpgcheck=0 enabled=1 [epel] name=EPEL baseurl=https://mirror.tuna.tsinghua.edu.cn/epel/$releasever/Everything/$basearch https://mirrors.cloud.tencent.com/epel/$releasever/Everything/$basearch https://mirrors.huaweicloud.com/epel/$releasever/Everything/$basearch https://mirrors.aliyun.com/epel/$releasever/Everything/$basearch gpgcheck=0 enabled=1
[root@localhost yum.repos.d]# cat base-for-centos7.repo [base] name=CentOS baseurl=https://mirror.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/ https://mirrors.huaweicloud.com/centos/$releasever/os/$basearch/ https://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/ https://mirrors.aliyun.com/centos/$releasever/os/$basearch/ gpgcheck=0 [extras] name=extras baseurl=https://mirror.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch https://mirrors.huaweicloud.com/centos/$releasever/extras/$basearch https://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch https://mirrors.aliyun.com/centos/$releasever/extras/$basearch gpgcheck=0 enabled=1 [epel] name=EPEL baseurl=https://mirror.tuna.tsinghua.edu.cn/epel/$releasever/$basearch https://mirrors.cloud.tencent.com/epel/$releasever/$basearch/ https://mirrors.huaweicloud.com/epel/$releasever/$basearch https://mirrors.cloud.tencent.com/epel/$releasever/$basearch http://mirrors.aliyun.com/epel/$releasever/$basearch gpgcheck=0 enabled=1
nginx.org/en/download.html
nginx.org/en/linux_packages.html
[nginx-stable] name=nginx stable repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=1 enabled=1 gpgkey=https://nginx.org/keys/nginx_signing.key module_hotfixes=true
yum repolist -v
[root@localhost yum.repos.d]# yum list nginx 可安装的软件包 nginx.x86_64 1:1.20.2-1.el7.ngx nginx-stable
[root@localhost yum.repos.d]# yum list nginx 可安装的软件包 nginx.x86_64 1:1.20.1-9.el7 epel
yum install nginx --downloadonly --downloaddir=/data6 下载到/data6,
源码
[root@rocky8 src]# wget http://nginx.org/download/nginx-1.20.2.tar.gz
[root@rocky8 nginx-1.20.2]# pwd /usr/local/src/nginx-1.20.2 [root@rocky8 nginx-1.20.2]# tree src/
[root@rocky8 nginx-1.20.2]# find src/ -name *.c | xargs cat |wc -l #源码行数 183943
依赖库
[root@rocky8 nginx-1.20.2]# ldd /usr/bin/ls linux-vdso.so.1 (0x00007ffe2f295000) libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fbe38beb000) libcap.so.2 => /lib64/libcap.so.2 (0x00007fbe389e5000) libc.so.6 => /lib64/libc.so.6 (0x00007fbe38620000) libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007fbe3839c000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fbe38198000) /lib64/ld-linux-x86-64.so.2 (0x00007fbe39038000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fbe37f78000)
文件和包关系
[root@rocky8 nginx-1.20.2]# rpm -qf /etc/passwd setup-2.12.2-6.el8.noarch [root@rocky8 nginx-1.20.2]# rpm -ql setup