How to keep the Yum installed RPM package in Linux

Source: Internet
Author: User

On Linux, with Yum installed, the downloaded RPM package is removed after the default installation is complete, and if you want Yum to install the software, you will need to modify the Keepcache parameter in the/etc/yum.conf configuration file.

[[email protected] ~]# cat /etc/yum.conf [main]cachedir=/var/cache/yum/$basearch/$releasever 【安装包保存位置】keepcache=0 【默认0是不保存安装包,改为1即可】debuglevel=2logfile=/var/log/yum.logexactarch=1obsoletes=1gpgcheck=1plugins=1installonly_limit=5bugtracker_url=http://bugs.centos.org/set_project.php?project_id=16&ref=http://bugs.centos.org/bug_report_page.php?category=yumdistroverpkg=centos-release

Use VIM or sed to modify

[[email protected] ~]# sed -n ‘s#keepcache=0#keepcache=1#gp‘ /etc/yum.conf keepcache=1 【最好先不要用-i参数直接修改源文件,先输出看修改是否正确,或者先备份yum.conf配置文件】[[email protected] ~]# sed -i ‘s#keepcache=0#keepcache=1#g‘ /etc/yum.conf  【-i修改源文件配置】[[email protected] ~]# grep "keepcache" /etc/yum.conf【检查是否已修改】keepcache=1

If you do not understand sed, use vim to modify
vim /etc/yum.conf

How to keep the Yum installed RPM package in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.