Oct 6, 2010

Cài đặt package mới cho Centos qua DVD iso file !

Bước 1 :
Mount 1 iso file
Chạy lênh (thay thế tên hiện tại với tên thật sự của gói )


# yum install createrepo
# mkdir -p /mnt/iso/{1,2,3}
# mount -o loop /path/to/centos1.iso /mnt/iso/1
Bước 2 : tạo bản ghi thực thi
Dùng
createrepo để sinh ra file XML metadata

# cd /mnt/iso
# createrepo
xoá repo

# yum clean all
Bước 3 : tạo file config
Bạn cần tạo 1 repo config file trong thu muc /etc/yum.repos.d/

# vi /etc/yum.repos.d/iso.repo
them vào đoạn lệnh sau

[My ISO Repository]
baseurl=file:///mnt/iso
enabled=1
save lại và đóng file thay đổi
Bây giờ bạn đã có thể dùng lênh yum để cài đặt hay update gói

# yum install package-name

No comments:

Post a Comment