Results 1 to 9 of 9

Thread: How to reinstall a package in the cache without having to re-download it?

  1. Default How to reinstall a package in the cache without having to re-download it?

    Hi,

    I'm writing a blog post at the moment, wherein I am comparing the various package managers I have a reasonable amount of experience with, including ZYpp and one aspect with respect to which I am comparing them is their speed to reinstall the vim package (a package I choose at random that I knew would be present on all the distros compared), after the package has already been downloaded (so as to eliminate download time as a possible variable influencing the time taken to install the package). The problem is that, running
    Code:
    zypper in -y --force vim
    seems to always re-download the package even when I only just installed (and hence downloaded) the package. I am here to ask is there a way wherein I can get zypper to reinstall the vim package without having to redownload it?

    Thanks for your time,
    Brenton
    Brenton Horne: Linux enthusiast and writer of ​The Hornery.
    Seven favourite distros
    : Arch, Fedora, Gentoo, openSUSE Tumbleweed and Void.

  2. #2

    Default Re: How to reinstall a package in the cache without having to re-download it?

    Quote Originally Posted by fusion809 View Post
    The problem is that, running
    Code:
    zypper in -y --force vim
    seems to always re-download the package even when I only just installed (and hence downloaded) the package. I am here to ask is there a way wherein I can get zypper to reinstall the vim package without having to redownload it?
    If the package is already in the case, zypper will take it from the cache instead of downloading it again.
    Although, if the package has been updated in the meantime, zypper will of course download the new version.

    You can manually install all packages in zypper's cache by running something like:
    Code:
    rpm -Uvh /var/cache/zypp/packages/*/*
    zypper also only runs rpm in the end to actually install packages.

  3. Default Re: How to reinstall a package in the cache without having to re-download it?

    OK, well I was doing this on a VirtualBox VM and I checked its cache and it does not seem like the vim package is being stored there after it is downloaded by zypper. I keep reinstalling it and every single time it re-downloads it before it installs it. I thought it was cached by default. The vim package I am referring to is the one in the openSUSE-Tumbleweed-Oss repo. How do I get zypper to store the package in the cache?

    EDIT: nvm I found the answer in the openSUSE forums, namely here https://forums.opensuse.org/showthre...-package-cache.
    Brenton Horne: Linux enthusiast and writer of ​The Hornery.
    Seven favourite distros
    : Arch, Fedora, Gentoo, openSUSE Tumbleweed and Void.

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,674
    Blog Entries
    15

    Default Re: How to reinstall a package in the cache without having to re-download it?

    Quote Originally Posted by fusion809 View Post
    OK, well I was doing this on a VirtualBox VM and I checked its cache and it does not seem like the vim package is being stored there after it is downloaded by zypper. I keep reinstalling it and every single time it re-downloads it before it installs it. I thought it was cached by default. The vim package I am referring to is the one in the openSUSE-Tumbleweed-Oss repo. How do I get zypper to store the package in the cache?

    EDIT: nvm I found the answer in the openSUSE forums, namely here https://forums.opensuse.org/showthre...-package-cache.
    Hi
    You need to configure in the /etc/zypp/zypp.conf file to your requirements..
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5

    Default Re: How to reinstall a package in the cache without having to re-download it?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    You need to configure in the /etc/zypp/zypp.conf file to your requirements..
    No, this cannot be configured there.

    You have to set keeppackages=1 in the repo config, either with YaST, "zypper mr -k XXX", or by editing the corresponding file in /etc/sysconfig/repos.d/.

    Otherwise zypper deletes a package from the cache after it successfully installed it.

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,674
    Blog Entries
    15

    Default Re: How to reinstall a package in the cache without having to re-download it?

    Quote Originally Posted by wolfi323 View Post
    No, this cannot be configured there.

    You have to set keeppackages=1 in the repo config, either with YaST, "zypper mr -k XXX", or by editing the corresponding file in /etc/sysconfig/repos.d/.

    Otherwise zypper deletes a package from the cache after it successfully installed it.
    Hi
    Ahh ok, think you meant /etc/zypp though I'm spoiled, have a local mirror, so never worried...

    @fusion809 also be aware if running btrfs/snapper that both caching files and running lots of zypper commands will increase snapshots and space used. If not already configured, suggest you adjust the config file or run the snapper cleanup job....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7

    Default Re: How to reinstall a package in the cache without having to re-download it?

    Quote Originally Posted by malcolmlewis View Post
    Ahh ok, think you meant /etc/zypp though
    Yes, /etc/zypp/repos.d/ of course, sorry.

    I was typing /etc/sysconfig/ in another reply and apparently got confused...

  8. #8
    Join Date
    Jun 2009
    Location
    Mangfall, Germany
    Posts
    1,499

    Default Re: How to reinstall a package in the cache without having to re-download it?

    observation

    A780GM-m3<2016Feb17><16:23></etc/zypp/repos.d>grep keeppackages *
    download.opensuse.org-non-oss.repo:keeppackages=0
    google-earth.repo:keeppackages=0
    local-rpm.repo:keeppackages=0
    openSUSE-13.1-Games.repo:keeppackages=0
    openSUSE-13.2-Oss.repo:keeppackages=0
    openSUSE-42.1-0.repo:keeppackages=0
    openSUSE-42.1-Standard-Kernel.repo:keeppackages=0
    openSUSE-Leap-42.1-Frameworks5.repo:keeppackages=0
    openSUSE-Tumbleweed-Oss-not.repo:keeppackages=0
    openSUSE-Tumbleweed-Oss.repo:keeppackages=0
    openSUSE-Tumbleweed-Packman.repo:keeppackages=0
    repo-debug-non-oss.repo:keeppackages=0
    repo-debug.repo:keeppackages=0
    repo-debug-update-non-oss.repo:keeppackages=0
    repo-debug-update.repo:keeppackages=0
    repo-source.repo:keeppackages=0
    repo-update-non-oss.repo:keeppackages=0
    repo-update.repo:keeppackages=0
    SUSE-SLE12-Packman.repo:keeppackages=0
    A780GM-m3<2016Feb17><16:24></etc/zypp/repos.d>

    so I guess its pick and choose which keeppackages are set to 1 for the ones required to be held

    NB: all files are dated 17Feb2016 10:36, time of last update (ymmv)

  9. #9

    Default Re: How to reinstall a package in the cache without having to re-download it?

    Quote Originally Posted by keellambert View Post
    so I guess its pick and choose which keeppackages are set to 1 for the ones required to be held
    Yes, exactly.
    This can (has to) be configured for each repo separately.

    And the default is keeppackages=0.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •