Make package manager aware of new local repos
This commit is contained in:
parent
845965a120
commit
cdfd73bc80
@ -5,7 +5,7 @@
|
|||||||
# file system
|
# file system
|
||||||
# copy it to a local location
|
# copy it to a local location
|
||||||
if="/dev/sr0"
|
if="/dev/sr0"
|
||||||
of="/ubuntu22.iso" # contents are in iso9660 filesystem. Need to be mounted later
|
of="/fedora.iso" # contents are in iso9660 filesystem. Need to be mounted later
|
||||||
repo_location="/repo" # location mounted on the filesystem
|
repo_location="/repo" # location mounted on the filesystem
|
||||||
sudo mkdir $repo_location
|
sudo mkdir $repo_location
|
||||||
sudo dd if=$if of=$of bs=1M status='progress'
|
sudo dd if=$if of=$of bs=1M status='progress'
|
||||||
@ -19,3 +19,19 @@ EOF
|
|||||||
# verify /etc/stab changes and mount everything
|
# verify /etc/stab changes and mount everything
|
||||||
sudo mount -a
|
sudo mount -a
|
||||||
ls $repo_location
|
ls $repo_location
|
||||||
|
|
||||||
|
# Assumes a fedora family OS but similar changes can be made in debian family
|
||||||
|
# Makes dnf aware of newly available repos
|
||||||
|
sudo cat > /etc/yum.repos.d/base.repo <<EOF
|
||||||
|
[BaseOS]
|
||||||
|
name=BaseOS
|
||||||
|
baseurl=file://$repo_location/BaseOS
|
||||||
|
gpgcheck=0
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sudo cat > /etc/yum.repos.d/appstream.repo <<EOF
|
||||||
|
[AppStream]
|
||||||
|
name=AppStream
|
||||||
|
baseurl=file://$repo_location/AppStream
|
||||||
|
gpgcheck=0
|
||||||
|
EOF
|
||||||
|
@ -2,18 +2,17 @@
|
|||||||
# plug in your variables and run file to create vm via commandline
|
# plug in your variables and run file to create vm via commandline
|
||||||
# got tired of looking up man-pages everytime
|
# got tired of looking up man-pages everytime
|
||||||
|
|
||||||
name=rhel9m1
|
name=rhel9m2
|
||||||
ram=2048
|
ram=2048
|
||||||
vcpu=2
|
vcpu=2
|
||||||
path=/var/lib/libvirt/images/rhel9m1.qcow2
|
path=/var/lib/libvirt/images/rhel9m2.qcow2
|
||||||
size=20
|
size=20
|
||||||
os_variant=rhel9.4
|
os_variant=rhel9.4
|
||||||
path_iso=/home/$USER/Downloads/iso/rhel-9.4-x86_64-boot.iso
|
path_iso=/home/$USER/Downloads/iso/rhel-9.4-x86_64-dvd.iso
|
||||||
|
|
||||||
# you can add the following optional arguments
|
# you can add the following optional arguments
|
||||||
# --graphics none
|
# --graphics none
|
||||||
# kickstart files and such via the --extra-args argument
|
# kickstart files and such via the --extra-args argument
|
||||||
virt-install --name $name --ram $ram --vcpus $vcpu \
|
virt-install --name $name --ram $ram --vcpus $vcpu \
|
||||||
--disk path=$path,size=$size --os-variant $os_variant \
|
--disk path=$path,size=$size --os-variant $os_variant \
|
||||||
--network bridge=virbr0,model=virtio \
|
--location $path_iso
|
||||||
--console pty,target_type=serial --location $path_iso
|
|
||||||
|
Loading…
Reference in New Issue
Block a user