關於redhat/centos 8.x中reposync命令與之前7.x系統版本還是略有小小的差異,現在記錄如下:
明顯的兩個參數差異如下:
# -l(小寫的L)只在7的reposync中才有 -l, --plugins Enable yum plugin support. # -g選項,也只有7的reposync中才有 -g, --gpgcheck Remove packages that fail GPG signature checking after downloading. exit status is '1' if at least one package was removed.
還有一個差異,redhat8最小化安裝的,默認沒有createrepo命令,需要安裝createrepo_c , /usr/bin/createrepo -> createrepo_c
當然也可以不使用的createrepo命令的,我們可以使用reposync將meta-data一起同步下來
另外,還有在最小化安裝的redhat 8.x系統中,默認是沒有reposync命令的(實際指向的/usr/libexec/dnf-utils),需要先安裝yum-utils
[root@qq_5201351 ~]# yum install yum-utils -y
至於同步的命令,如下:
# 一次指定一個repoid reposync --repoid=rhel-8-for-x86_64-appstream-rpms --download-path=/rhel/patch -n --downloadcomps --download-metadata # 也可以一次指定多個repoid reposync --repoid=rhel-8-for-x86_64-appstream-rpms \ --repoid=rhel-8-for-x86_64-baseos-rpms \ --download-path=/rhel/patch -n --downloadcomps --download-metadata
說明:-n --newest-only Download only newest packages per-repo.即只下載最新的軟件包
--download-metadata,如果沒有這個選項,只會同步Packages目錄,無repodata,加上會同步repodata,同步過程會很慢很慢
因為每次都會在Packages目錄的同級同步位置創建repodata目錄,當然是還創建臨時目錄,進行完整同步,同步成功后,再替換repodata目錄
尊重別人的勞動成果 轉載請務必注明出處:https://www.cnblogs.com/5201351/p/15798779.html