# Packages: bytes downloaded vs space required



## hruodr (May 18, 2019)

Look below both `pkg install`. The second downloads much less, but requires much more space:

(1) The process will require 13 MiB more space. --- 2 MiB to be downloaded.
(2) The process will require 70 MiB more space. --- 378 KiB to be downloaded.

What is the reason?! 


```
% pkg install dehydrated
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 5 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        dehydrated: 0.6.2_1
        bash: 5.0.3
        curl: 7.64.1_1
        libnghttp2: 1.37.0
        ca_root_nss: 3.44

Number of packages to be installed: 5

The process will require 13 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: N

% pkg install acme-tiny
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 4 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        acme-tiny: 4.0.4
        python27: 2.7.16
        readline: 7.0.5
        libffi: 3.2.1_3

Number of packages to be installed: 4

The process will require 70 MiB more space.
378 KiB to be downloaded.

Proceed with this action? [y/N]: N
```


----------



## k.jacker (May 18, 2019)

```
# pkg fetch dehydrated
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following packages will be fetched:

New packages to be FETCHED:
    dehydrated-0.6.2_1 (27 KiB: 100.00% of the 27 KiB to download)

Number of packages to be fetched: 1

27 KiB to be downloaded.

Proceed with fetching packages? [y/N]: y
Fetching dehydrated-0.6.2_1.txz: 100%   27 KiB  27.5kB/s    00:01
```


```
% mkdir /tmp/dehy
% tar -xzf dehydrated-0.6.2_1.txz -C /tmp/dehy/
tar: Removing leading '/' from member names
% du -hc /tmp/dehy
  0B    /tmp/dehy/usr/local/www/dehydrated
  0B    /tmp/dehy/usr/local/www
64K    /tmp/dehy/usr/local/bin
45K    /tmp/dehy/usr/local/share/doc/dehydrated
45K    /tmp/dehy/usr/local/share/doc
12K    /tmp/dehy/usr/local/share/licenses/dehydrated-0.6.2_1
12K    /tmp/dehy/usr/local/share/licenses
57K    /tmp/dehy/usr/local/share
4,0K    /tmp/dehy/usr/local/etc/periodic/weekly
4,0K    /tmp/dehy/usr/local/etc/periodic
  0B    /tmp/dehy/usr/local/etc/dehydrated/.acme-challenges
20K    /tmp/dehy/usr/local/etc/dehydrated
24K    /tmp/dehy/usr/local/etc
145K    /tmp/dehy/usr/local
145K    /tmp/dehy/usr
157K    /tmp/dehy
157K    total
```

Now read tar(1) and find --xz (.tar + .xz = .txz)


----------



## PMc (May 18, 2019)

hruodr said:


> Look below both `pkg install`. The second downloads much less, but requires much more space:
> 
> (1) The process will require 13 MiB more space. --- 2 MiB to be downloaded.
> (2) The process will require 70 MiB more space. --- 378 KiB to be downloaded.
> ...



The included python27 is already 11 MB:

```
$ ls -la lang_python27/*.txz
-rw-r--r--  1 root  wheel  11220884 Apr  4 13:39 lang_python27/python27-2.7.16.txz
```

So I would suppose that was downloaded earlier and kept in some cache of pkg.


----------

