内部に抱える計算機が多くなるとyum-updateの参照先を内部に抱えたくなる.
ちょうどwindows-updateの配布パッケージを社内に持つように.
ここではそんなリポジトリのミラーを作ってみた(ローカルリポジトリ)
参照先 https://www.server-world.info/query?os=CentOS_7&p=localrepo
CentOS79 †
ローカルリポジトリの準備. ここでは「repository.sybyl.local」なホストにCentOS79のデータを集めた.
[root@repository ~]# yum install httpd rsync createrepo
[root@repository ~]# mkdir -p /var/www/html/repos/centos/7/{os,updates,extras}/x86_64
[root@repository ~]# rsync -avz --delete ftp.riken.jp::centos/7/os/x86_64/Packages/ /var/www/html/repos/centos/7/os/x86_64/Packages/
[root@repository ~]# rsync -avz --delete ftp.riken.jp::centos/7/os/x86_64/repodata/ /var/www/html/repos/centos/7/os/x86_64/repodata/
[root@repository ~]# rsync -avz --delete ftp.riken.jp::centos/7/updates/x86_64/Packages/ /var/www/html/repos/centos/7/updates/x86_64/Packages/
[root@repository ~]# rsync -avz --delete ftp.riken.jp::centos/7/updates/x86_64/repodata/ /var/www/html/repos/centos/7/updates/x86_64/repodata/
[root@repository ~]# rsync -avz --delete ftp.riken.jp::centos/7/extras/x86_64/Packages/ /var/www/html/repos/centos/7/extras/x86_64/Packages/
[root@repository ~]# rsync -avz --delete ftp.riken.jp::centos/7/extras/x86_64/repodata/ /var/www/html/repos/centos/7/extras/x86_64/repodata/
(他に自ら追加したpackageがあるならrepodataを作ります. 指定場所に注意)
[root@repository ~]# createrepo /var/www/html/repos/centos/7/os/x86_64
[root@repository ~]# createrepo /var/www/html/repos/centos/7/updates/x86_64
[root@repository ~]# createrepo /var/www/html/repos/centos/7/extras/x86_64
参照させたい計算機のリポジトリ参照先を変更します
| --- /etc/yum.repos.d/CentOS-Base.repo.org 2020-10-23 23:53:59.000000000 +0900
+++ /etc/yum.repos.d/CentOS-Base.repo 2021-08-16 21:05:09.682088141 +0900
@@ -12,24 +12,21 @@
[base]
name=CentOS-$releasever - Base
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
-#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
+baseurl=http://repository.sybyl.local/repos/centos/7/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
-#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
+baseurl=http://repository.sybyl.local/repos/centos/7/updates/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
-#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
+baseurl=http://repository.sybyl.local/repos/centos/7/extras/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
|
これで「yum update/install」らはローカルリポジトリ「repository.sybyl.local」を参照するようになります.
「/etc/yum.repos.d」の「CentOS-Base.repo」以外は消してもいいかも
epelのローカルリポジトリ †
[root@repository ~]# mkdir -p /var/www/html/repos/fedora/epel/7/x86_64
[root@repository ~]# rsync -avz --delete ftp.yz.yamagata-u.ac.jp::pub/Linux/fedora-projects/epel/7/x86_64/Packages/ \
/var/www/html/repos/fedora/epel/7/x86_64/Packages/
[root@repository ~]# createrepo /var/www/html/repos/fedora/epel/7/x86_64
参照させるには「yum install epel-release」の後で、「/etc/yum.repos.d/epel.repo」を修正します
| --- /etc/yum.repos.d/epel.repo.orig 2021-08-19 09:51:00.809507319 +0900
+++ /etc/yum.repos.d/epel.repo 2021-08-19 09:53:47.165927466 +0900
@@ -1,7 +1,6 @@
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
-#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
-metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
+baseurl=http://repository.sybyl.local/repos/centos/7/extras/x86_64
failovermethod=priority
enabled=1
gpgcheck=1
|
ubuntuのローカルリポジトリ †
使っているノードがubuntuなら「apt-mirror」が便利らしいが、ここではCentOSの上で行いたい
っでこうゆうのがあるhttps://github.com/bviktor/debmirror-runner
これを使ってみることにした
[root@repository ~]# yum install epel-release
[root@repository ~]# yum install debmirror
「/bin/debmirror --config-file=/etc/debmirror.conf --section=main --arch=i386,amd64 /var/www/html/Linux/ubuntu --progress」
取得先、取得方法によって download_method や DM_HOST、DM_ROOTには注意.
ubuntuのミラー情報を参考にhttps://www.ubuntulinux.jp/products/JapaneseMirrors
AlmaLinux †
AlmaLinux向けのリポジトリを作ってみた
[root@repository ~]# yum -y install httpd rsync reaterepo
[root@repository ~]# mkdir -p /var/www/repos/almalinux/8/{AppStream,BaseOS,PowerTools,extras}/x86_64
[root@repository ~]# rsync -avz --delete --exclude='repodata' --exclude='kickstart/' \
rsync://ftp.riken.jp/almalinux/8/AppStream/x86_64/ \
/var/www/repos/almalinux/8/AppStream/x86_64/
[root@repository ~]# rsync -avz --delete --exclude='repodata' --exclude='kickstart/' \
rsync://ftp.riken.jp/almalinux/8/BaseOS/x86_64/ \
/var/www/repos/almalinux/8/BaseOS/x86_64/
[root@repository ~]# rsync -avz --delete --exclude='repodata' --exclude='kickstart/' \
rsync://ftp.riken.jp/almalinux/8/PowerTools/x86_64/ \
/var/www/repos/almalinux/8/PowerTools/x86_64/
[root@repository ~]# rsync -avz --delete --exclude='repodata' --exclude='kickstart/' \
rsync://ftp.riken.jp/almalinux/8/extras/x86_64/ \
/var/www/repos/almalinux/8/extras/x86_64/
[root@repository ~]#
孤立LANでpythonアプリを使うには †
必要なファイルをひとつひとつ拾って孤立系マシンにUSBメモリーとかでコピーします
- pyenv
curl -L https://github.com/pyenv/pyenv/archive/refs/tags/1.2.27.tar.gz > pyenv-1.2.27.tar.gz
- anaconda3-5.3.1
curl -L https://repo.continuum.io/archive/Anaconda3-5.3.1-Linux-x86_64.sh > Anaconda3-5.3.1-Linux-x86_64.sh
mkdir -p /var/www/html/repo.continuum.io/archive
cp ~/Anaconda3-5.3.1-Linux-x86_64.sh /var/www/html/repo.continuum.io/archive/
[root@silo ~]# mkdir /apps && cd /apps
[root@silo apps]# tar xf ~/pyenv-1.2.27.tar.gz && mv pyenv-1.2.27 pyenv
[root@silo apps]# cd ~/
[root@silo ~]# export PYENV_ROOT=/apps/pyenv
[root@silo ~]# export PATH=$PYENV_ROOT/bin:$PATH
[root@silo ~]# eval "$(pyenv init - --no-rehash)"
[root@silo ~]# vi /apps/pyenv/plugins/python-build/share/python-build/anaconda3-5.3.1
install_script "Anaconda3-5.3.1-Linux-x86_64.sh" "http://repo.continuum.io/archive/Anaconda3-5.3.1-Linux-x86_64.sh#d4c4256a8f46173b675dd6a62d12f566ed3487f932bab6bb7058f06c124bcc27" "anaconda" verify_py36
↓
install_script "Anaconda3-5.3.1-Linux-x86_64.sh" "http://localhost/repo.continuum.io/archive/Anaconda3-5.3.1-Linux-x86_64.sh#d4c4256a8f46173b675dd6a62d12f566ed3487f932bab6bb7058f06c124bcc27" "anaconda" verify_py36
(チェックサムはsha256sumを使っているみたい)
[root@silo ~]#
[root@silo ~]# pyenv install anaconda3-5.3.1
Downloading Anaconda3-5.3.1-Linux-x86_64.sh.sh...
-> http://localhost/repo.continuum.io/archive/Anaconda3-5.3.1-Linux-x86_64.sh <-- ローカルを見てAnaconda3-5.3.1がインストールされる
Installing Anaconda3-5.3.1-Linux-x86_64.sh...
Installed Anaconda3-5.3.1-Linux-x86_64.sh to /apps/pyenv/versions/anaconda3-5.3.1
[root@silo ~]#
[root@silo ~]# pyenv versions
* system (set by /apps/pyenv/version)
anaconda3-5.3.1
[root@silo ~]# pyenv global anaconda3-5.3.1
[root@silo ~]# pyenv versions
system
* anaconda3-5.3.1 (set by /apps/pyenv/version)
[root@silo ~]# export PATH=$PYENV_ROOT/versions/anaconda3-5.3.1/bin:$PATH
SELinuxは無効で. bzip2パッケージは必要
っで勢いで「conda update conda」とすると孤立LANなので下記の様に言われる
[root@silo ~]# conda update conda
Solving environment: failed
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/noarch/repodata.json.bz2>
Elapsed: -
An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.
ConnectionError(MaxRetryError("HTTPSConnectionPool(host='repo.anaconda.com', port=443): Max retries exceeded with url: /pkgs/main/noarch/repodata.json.bz2 (Caused by NewConnectionError(略
[root@silo ~]#
PyPIパッケージをオフラインでインストールするには †
オンライン環境でファイルを取得する
mkdir SigProfilerExtractor
pip download -d ./SigProfilerExtractor SigProfilerExtractor
これで「SigProfilerExtractor」に必要な関連するwhlファイルが全てダウンロードされる。
これらをUSB-HDDらに詰めてオフライン環境に持っていき
tar xf SigProfilerExtractor.tar
cd SigProfilerExtractor
pip install ./*
で完了となる
PyPIでパッケージの依存関係は「pip show sigProfilerPlotting」で得られる
SigProfilerMatrixGeneratorでレファレンス配列を組み込むには
事前にファイルを取得する
「wget _tp://alexandrovlab-ftp.ucsd.edu/pub/tools/SigProfilerMatrixGenerator/GRCh37.tar.gz」として
その後にオフライン環境にて
source activate SigProfiler
python
from SigProfilerMatrixGenerator import install as genInstall
genInstall.install('GRCh37')
or
genInstall.install('GRCh37', offline_files_path='/apps/src/GRCh37.tar.gz')
オフラインではパッケージを入れるのも一苦労. なのでそのオフラインに whl ファイルを詰め込んだローカルリポジトリを作る.
ただクライアントからの参照先を別途指定する必要がある.
場所「$ HOME/.pip/pip.conf
[global]
trusted-host = <private IP>
extra-index-url = http://<private IP>/pypi
$ R
>> install.packages("devtools")
>> install.packages("reticulate")
>> library("reticulate")
>> use_python("path_to_your_python3")
>> library("devtools")
>> install_github("AlexandrovLab/SigProfilerMatrixGeneratorR")
>> py_config()
>> library("SigProfilerMatrixGeneratorR")
>> matrices <- SigProfilerMatrixGeneratorR("BRCA", "GRCh37", "/Users/ebergstr/Desktop/BRCA/", plot=T, exome=F, bed_file=NULL, chrom_based=F, tsb_stat=F, seqInfo=F, cushion=100)
offline: get SigProfilerMatrixGeneratorR.gz
library(devtools)
source <- devtools:::source_pkg("/tmp/SigProfilerMatrixGeneratorR")
install(source)
library("SigProfilerMatrixGeneratorR")
memo †
anaconda pkgs(20210815)
main | repo.anaconda.com/pkgs/main/{linux-64,noarch} | 22,731/4,144 |
free | repo.anaconda.com/pkgs/free/{linux-64,noarch} | 13,332/31 |
R | repo.anaconda.com/pkgs/r/{linux-64,noarch} | 6,625/5,030 |
MRO | repo.anaconda.com/pkgs/mro/{linux-64,noarch} | 2/0 |
pro | repo.anaconda.com/pkgs/pro/{linux-64,noarch} | 817/2 |
bioconda
bioconda | conda.anaconda.org/bioconda/{linux-64,noarch} | 38,648/29,994 |
bioconductor
https://www.bioconductor.org/about/mirrors/mirror-how-to/
CRAN
http://www.okadajp.org/RWiki/?CRAN%E5%9B%BD%E5%86%85%E3%83%9F%E3%83%A9%E3%83%BC%E3%81%AE%E4%BD%BF%E3%81%84%E6%96%B9
「options(repos="https://cran.ism.ac.jp/")」
ローカルの場合は?
「options(repos="https://qnap/Public/cran/")」?
「rsync -av ftp.yz.yamagata-u.ac.jp::pub/cran/contrib/main/ ./cran/contrib/main/ --include="*.tar.gz" --exclude="*"」