CentOS-Base.repoファイルを置き換えるためにcentos.isoを変更できますか?

CentOS-Base.repoファイルを置き換えるためにcentos.isoを変更できますか?

centos isoイメージを使用してCentOSオペレーティングシステムを作成するときにディレクトリに/etc/yum.repos.d/CentOS-Base.repoデフォルトCentOS-Base.repo

これで、私のカスタムCentOS-Base.repoリポジトリファイルに置き換えることができます。

要件があります。つまり、CentoS-Base.repoISOのコンテンツを変更できますか?これにより、CentOS-Base.repoOSをインストールした後に交換する必要はありません。

ベストアンサー1

はい、カスタムcentos.isoを作成できますが、必要なのはカスタムkickstartプロファイルを使用してcentosをインストールすることです。

クイックスタートインストールCentOS のインストールを自動化およびカスタマイズし、同じ初期 centos.iso で目的のタスクを実行する方法です。

ksファイルを提供するWebサーバーのみが必要です。

非常に簡単な例を提供するために、ここにデフォルトのCentOS7キックスタートファイルがあります。

CentOS7-ks.cfg

# ebal, Sat, 07 Apr 2018 18:28:19 +0300

#version=CentOS-7

# Install OS instead of upgrade
install

# Text or Graphical mode ?
text

# Packages are on:
cdrom

# System keyboard
keyboard us

# System language
lang en_US.UTF-8

# TimeZone with NTP
timezone Eurpe/Athens --ntpservers=gr.pool.ntp.org

# SELinux - By default, selinux is enforcing
selinux --permissive

# Sets the system's root password to the password argument.
rootpw --plaintext password

# accept the End User License Agreement - rhel 7
## eula--agreed

# Do not Run the Setup Agent on first boot
firstboot --disabled

# Power Off the system when the install is complete
## poweroff
# Reboot the system when the install is complete
reboot


# Partition Table
autopart --nohome --type=plain --fstype=ext4

bootloader --location=mbr

# Partition clearing information
clearpart --all --initlabel 
zerombr

%packages --excludedocs
@core
# Remove
-aic94xx-firmware
-alsa-*
-iwl*-firmware
-ivtv-firmware
-libertas-*-firmware
-btrfs-progs
-ModemManager-glib
-NetworkManager*
-wpa_supplicant
# Install
openssh-clients
%end

# Disable Kdump
%addon com_redhat_kdump --disable

次にcentos.isoからcentosをインストールするときは、Tabキーを押して次のように入力します。

inst.ks=http://10.10.10.11/mnt/CentOS7-ks.cfg

個人的な目的でWebサーバーをインストールしたくない場合は、CentOS7-ks.cfgファイルがあるディレクトリで一時的にPythonを使用できます。

python3 -m http.server

おすすめ記事