本地软件仓库搭建
mkdir /iso
cd /iso
wget http://172.25.254.250/isos/rhel-8.2-x86_64-dvd.iso镜像
ls /iso/
mkdir /westos
ls /westos/
mount /iso/rhel-8.2-x86_64-dvd.iso /westos/
df
cd /etc/yum.repos.d/
rm -fr redhat.repo westos.repo
ls
vim chen.repo
[AppStream]
name = AppStream
baseurl = file:///westos/AppStream
gpgcheck = 1
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[baseOS]
name = baseOS
baseurl = file:///westos/baseOS
gpgcheck = 1
enabled = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
dnf install httpd -y 下载httpd
实验二
(真机)
cd /var/www/html/
systemctl enable --now httpd打开httpd服务
systemctl disable --now firewalld关闭防火墙
ls
rm -fr *
mkdir westos
mount /iso/rhel-8.2-x86_64-dvd.iso /var/www/html/westos/
(虚拟机)
cd /etc/yum.repos.d/
vim westos.repo
[AppStream]
name = AppStream
baseurl =http://172.25.254.19/westos/AppStream/
gpgcheck = 0
[baseOS]
name = baseOS
baseurl =http://172.25.254.19/westos/baseOS/
gpgcheck = 0
dnf install httpd -y
dnf search /bin/ls 不能搜索文件
search 通过软件搜索软件安装包 history ##dnf执行历史 history info ##dnf执行历史详细信息 group list ##列出软件组 group list -- installed ## 列出已安装软件组 group list -- available ## 列出未安装软件组 group list -- hidden ## 列出隐藏软件案组 group install ##安装软件组 group info ##查看软件组信息
#下载安装包# yumdownloader #下载软件包到本机指定位置 yumdownloader httpd #下载仓库中指定软件的安装包到当前目录 yumdownloader -- destdir =/ mnt #下载仓库中指定软件的安装包到指定 / mnt 目录 yumdownloader httpd -- destdir =/ mnt -- resolve # 下载仓库中指定软件安装包和软件依赖性到 / mnt目录
系统之外的安装 联网 ip route add default via 172.25.254.250
echo nameserver 114.114.114.114 > /etc/resolv.conf
yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
安装 epel 配置包
将 repo 配置中的地址替换为阿里云镜像站地址
sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|g' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|g' /etc/yum.repos.d/epel*
dnf install kolourpaint -y
下载安装包及依赖性(虚拟机实验)
cd /mnt
mkdir westos
ls
yumdownloader --resolve --destdir=/mnt/westos kolourpaint
第三方软件仓库搭建
(虚拟机)
dnf install httpd -y
systemctl enable --now httpd
systemctl disable --now firewalld
cp -r westos /var/www/html
dnf install createrepo -y
createrepo -v /var/www/html/westos
(真机)
dnf remove kolourpaint
vim /etc/yum.repos.d/chen.repo
[westos]
name = westos
baseurl = http://172.25.254.119/westos
gpgcheck = 0
dnf list kolourpaint



