【Linux】安装软件的同时保存rpm包,以便在无网的环境下离线安装

#保留yum包,将/etc/yum.conf里对应的keepcache参数改为1即可
[root@localhost java]#source /etc/profile #使文件立即生效
[root@localhost java]# vim /etc/yum.conf
keepcache=1
[root@localhost java]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
[root@localhost ~]#cd /var/cache/yum
[root@localhost yum]# ls
x86_64
[root@localhost yum]# tree
.
└── x86_64
    └── 7
        ├── base
        │   ├── 03d0a660eb33174331aee3e077e11d4c017412d761b7f2eaa8555e7898e701e0-primary.sqlite.bz2
        │   ├── 29b154c359eaf12b9e35d0d5c649ebd62ce43333f39f02f33ed7b08c3b927e20-c7-x86_64-comps.xml.gz
        │   ├── cachecookie
        │   ├── gen
        │   │   └── primary_db.sqlite
        │   ├── mirrorlist.txt
        │   ├── packages
        │   │   ├── autogen-libopts-5.18-5.el7.x86_64.rpm
        │   │   ├── dialog-1.2-4.20130523.el7.x86_64.rpm
        │   │   ├── gdb-7.6.1-110.el7.x86_64.rpm
        │   │   ├── lm_sensors-libs-3.4.0-4.20160601gitf9185e5.el7.x86_64.rpm
        │   │   ├── mcelog-144-8.94d853b2ea81.el7.x86_64.rpm
        │   │   ├── ntp-4.2.6p5-28.el7.centos.x86_64.rpm
        │   │   ├── ntpdate-4.2.6p5-28.el7.centos.x86_64.rpm
        │   │   ├── sysstat-10.1.5-13.el7.x86_64.rpm
        │   │   └── tree-1.6.0-10.el7.x86_64.rpm
        │   └── repomd.xml
        ├── extras
        │   ├── 9faf17d19bd69606dfc218252ccb221d02cbcf64b4a1ad679790c22a4f2c38de-primary.sqlite.bz2
        │   ├── cachecookie
        │   ├── gen
        │   │   └── primary_db.sqlite
        │   ├── mirrorlist.txt
        │   ├── packages
        │   └── repomd.xml
        ├── timedhosts
        ├── timedhosts.txt
        └── updates
            ├── bbdd7704a3cb277edefedcd8e4054a751a93a4598349ccaf92fa855ff5647e72-primary.sqlite.bz2
            ├── cachecookie
            ├── gen
            │   └── primary_db.sqlite
            ├── mirrorlist.txt
            ├── packages
            └── repomd.xml
11 directories, 27 files


发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-BlogPHP 1.5.2 Zero

粤ICP备18035038号