rpm-software-management / dnf5

Next-generation RPM package management system
Other
259 stars 87 forks source link

Check free disk space #1244

Open tpgxyz opened 6 years ago

tpgxyz commented 6 years ago

I had to update lots of packages, which was about to 1 GiB of downloaded files. Unfortunately during rpm upgrade, process failed due to run out of free disk space. I have feeling that dnf does not take into count unpackaged size of rpms. Anyways in case when downloaded rpm + unpackaged size of rpm is close to available free disk space, a dnf should not allow to upgrade system with a message for user.

abucodonosor commented 6 years ago

dnf_transaction_check_free_space() doesn't seems to have any check for 'real_size_on disk' so calcualtion is wrong and we hit later disk full.

download_size = rpm_download_size in this function..

So let say we have 100MB free space and install 99MB in rpm size package.

now the free_space vs downlaod_size check passes however we are now with 1MB left trying to install something will be >99MB unpacked on disk.

100MB-99MB_RPM_size( rpm go to cache ) = 1MB real free space left ..

jan-kolarik commented 7 months ago

A new approach for implementing this feature in dnf5 needs to be designed. There is an API prepared in the RpmProblem class that connects to rpm's rpmProblemGetDiskNeed method, but it's not yet utilized AFAICS.