Linux 制作 ISO 镜像文件

发布时间:2020-09-18 00:00:00
更新时间:2021-02-16 12:30:25
文章作者:ZHUANGZHUANG
​​​​​​​‌​‌​‌‌‌​‍​​​​‌​‌​​‌​​‌‌​‍​‌​‌​‌‌‌‌‌‌​​‌​‍​​​​‌‌​​​​​‌‌‌‌‍​​​​​​​​‌‌‌​​‌​‌‍‌​‌​​‌​‌‍‌​‌‌​‌‌‌‍‌​‌​‌​‌​‍‌​‌‌‌‌‌​‍‌​‌‌​​​‌‍‌​‌‌‌​​​‍‌​‌​​‌​‌‍‌​‌‌​‌‌‌‍‌​‌​‌​‌​‍‌​‌‌‌‌‌​‍‌​‌‌​​​‌‍‌​‌‌‌​​​‍‌​‌​​​‌‌‍‌​‌​​​‌‌‍​‌​‌‌​​​‌‌​​​​​‍​​‌‌​‌​​‌‌‌‌​​​‍​​‌​‌‌‌‌‌‌‌‌​​​‍​‌‌​​‌‌‌​‌‌​​‌‌‌‍​​​​​​​​‌‌‌​​‌​‌‍‌​‌‌​​‌‌‍‌​​‌​‌‌​‍‌​​‌​​​‌‍‌​​​‌​‌​‍‌​​​​‌‌‌‍‌‌​‌‌‌‌‌‍​‌​‌‌​‌‌‌​​‌​​‌‍​‌‌​​​​‌​‌​​​‌‌‍‌‌​‌‌‌‌‌‍‌​‌‌​‌‌​‍‌​‌​‌‌​​‍‌​‌‌​​​​‍‌‌​‌‌‌‌‌‍​‌‌​‌​‌​‌​‌​​​‌‌‍​‌​‌‌‌‌​​‌‌​​​​‍​​‌‌​‌​​‌‌‌‌​​​‍​‌‌​​​‌​​​​‌​​‌‍‌​‌​​​‌‌‍‌​‌​​​‌‌‍​‌​‌‌​​​‌‌​​​​​‍​​‌‌​‌​​‌‌‌‌​​​‍​‌‌​​​​‌​‌​​​‌‌‍​‌‌‌‌‌‌‌‌‌‌‌‌​‌​‍​​​​​​​​‌‌‌​​‌​‌‍‌​‌​​‌‌​‍‌​‌‌‌​‌‌‍‌​‌​​‌​‌‍‌‌​​‌‌‌​‍‌‌​​‌‌​‌‍‌‌​​‌‌​​‍‌‌​​‌​‌‌‍‌‌​​‌​‌​‍‌‌​​‌​​‌‍‌​‌​​​‌‌‍‌​‌​​​‌‌‍​‌​‌‌​​​‌‌​​​​​‍​​‌‌​‌​​‌‌‌‌​​​‍​‌​‌​​​‌‌​​‌‌‌‌‍​‌​‌​​​‌​‌‌‌‌‌‌‍​​​​​​​​‌‌‌​​‌​‌‍‌​​‌​‌‌‌‍‌​​​‌​‌‌‍‌​​​‌​‌‌‍‌​​​‌‌‌‌‍‌​​​‌‌​​‍‌‌​​​‌​‌‍‌​‌​​​‌‌‍‌​‌​​​‌‌‍‌​​​​‌​‌‍‌​​‌​‌‌‌‍‌​​​‌​‌​‍‌​​‌‌‌‌​‍‌​​‌​​​‌‍‌​​‌‌​​​‍‌​​​​‌​‌‍‌​​‌​‌‌‌‍‌​​​‌​‌​‍‌​​‌‌‌‌​‍‌​​‌​​​‌‍‌​​‌‌​​​‍‌‌​‌​​​‌‍‌​​‌​‌‌​‍‌​​‌​​​​‍‌​‌​​​‌‌‍‌‌​​‌‌​‌‍‌‌​​‌‌‌‌‍‌‌​​‌‌​‌‍‌‌​​‌‌‌‌‍‌​‌​​​‌‌‍‌‌​​‌‌‌‌‍‌‌​​​‌‌​‍‌​‌​​​‌‌‍‌‌​​‌‌‌​‍‌‌​​​‌‌‌‍‌​‌​​​‌‌‍‌​​‌​​‌‌‍‌​​‌​‌‌​‍‌​​‌​​​‌‍‌​​​‌​‌​‍‌​​​​‌‌‌‍‌‌​‌​​‌​‍‌​​‌​​‌​‍‌​​‌‌‌‌​‍‌​​‌​‌​​‍‌​​‌‌​‌​‍‌‌​‌​​‌​‍‌​​‌​‌‌​‍‌​​​‌‌​​‍‌​​‌​​​​‍‌‌​‌​​​‌‍‌​​‌​‌‌‌‍‌​​​‌​‌‌‍‌​​‌​​‌​‍‌​​‌​​‌‌

制作镜像

mkdir app && cd app

# 放入软件包
wget http://down.qq.com/qqweb/LinuxQQ/linuxqq_2.0.0-b2-1084_x86_64.rpm

# 创建仓库
yum -y install createrepo
createrepo --update .

# 制作镜像
yum provides mkisofs
yum -y install genisoimage
cd ..
mkisofs -r -o test.iso app

ls -l tset.iso

挂载使用

# 挂载镜像
mount test.iso /mnt

# 添加 yum 源
cat << EOF > /etc/yum.repos.d/test.repo
[test]
name=testrepo
baseurl=file:///mnt
gpgcheck=0
EOF

# 生成缓存
yum repolist  # 输出为  test(源标识)   testrepo(源名称)   1(源状态)

# 安装软件测试
yum install linuxqq
撰写评论