[Rpm-maint] [rpm-software-management/rpm] Size check is too strict (#1232)

Miroslav Suchý notifications at github.com
Tue May 19 12:29:58 UTC 2020


With VM in OpenStack or in AWS, it happens quite often that the rpm tells me:
 ```
    installing package FOO needs 220MB on the / filesystem
```
It quite often happens to me with `linux-firmware` which is big and needs nearly 300 MB unpacked, which is on 3GB of cloud image a lot.

This statement is nearly always false because it is counted with a worse case scenario, where all files in the new package are different. Which is rarely true. Usually, it is quite opposite - very few files changes. In such cases the calculation is incorrect.

Here is a reproducer:

1) download packages from http://miroslav.suchy.cz/fedora/rpm-size-reproducer/
Both packages install two files in `/var/tmp/`. Both install `/var/tmp/big-file` which is 830 MB big (made out of zeros, so the compressed rpm is very small). Version one contains /var/tmp/one.txt and version two contains /var/tmp/two.txt. Both are small text files with different content.
2) 
```
sudo rpm -Uvh /home/mirek/rpmbuild/RPMS/x86_64/big-file-1-1.x86_64.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:big-file-1-1                     ################################# [100%]
```
3) Now run something like:
```
dd if=/dev/zero of=/var/tmp/foo1
```
tune this so you do not consume whole disk space, and leave few hundred of free space. In my case:
```
$ df -h /var/tmp/
Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/fedora-root   50G   47G  197M 100% /
```
4) Now try to upgrade:
```
$ sudo rpm -Uvh /home/mirek/rpmbuild/RPMS/x86_64/big-file-2-1.x86_64.rpm 
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
        installing package big-file-2-1.x86_64 needs 674MB on the / filesystem
```
This is obviously incorrect as `/var/tmp/big-file` does not change. Definitely not the size.

5)  Let's try to ignore size-check:
```
$ sudo rpm -Uvh /home/mirek/rpmbuild/RPMS/x86_64/big-file-2-1.x86_64.rpm --ignoresize
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:big-file-2-1                     ################################# [ 50%]
Cleaning up / removing...
   2:big-file-1-1                     ################################# [100%]
```

Version: `rpm-4.15.1-3.fc32.1.x86_64`


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1232
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200519/ef9d4b5d/attachment.html>


More information about the Rpm-maint mailing list