8.Linux系统中的软件管理

1.Linux中软件包的类型

1.DEB         #UBlinux DEBlinux 2.RPM         #redhat centOS fadora 3.bz2|gz|xz                     #1.需要源码安装需要编译             #2.绿色软件,直接可用             #ntfs3g_ntfsprogs2017.3.23.tgz                 需要编译 “configure”             #Firefoxlatestx86_64.tar.bz2                      绿色 “注意在rhel8中只能使用绿色软件,源码编译软件和rpm软件”

2.软件包的名称结构

[dhcpserver] [4.3.630] . [el8] . [x86_64] . [rpm] 1.软件名称 2.软件版本 3.软件的授权协议版本 4.软件架构 5.软件类型后缀

 3.rpm命令管理软件包

rpm ivh                   ##安装参数组合 i install v verbose h hash

4.本地软件仓库的搭建 

# 系统软件仓库的作用 # 在系统中对软件进行管理 #rpm 命令是不能解决依赖关系的 # 如果需要软件在安装过程中自动解决依赖关系 ,需要大家系统软件仓库 ##搭建方法## 1.在系统中加载安装系统时使用的安装镜像 mount /xxxx/rhel8.2xxxxxxxx.iso /xxxx

本地软件仓库搭建
 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

实验二
(真机)
  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/

[BaseOS]
name = BaseOS
baseurl =http://172.25.254.19/westos/BaseOS/
gpgcheck = 0

dnf install httpd -y

5.dnf 软件管理命令

# 安装管理包 # dnf         repolist ##列出仓库信息         clean all ##清除系统中已经加载的仓库缓存信息 / var / cache / dnf

 

#下载安装包# 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 list kolourpaint

 

文章知识点与官方知识档案匹配,可进一步学习相关知识CS入门技能树Linux入门初识Linux24898 人正在系统学习中

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年9月11日
下一篇 2021年9月11日

相关推荐