# /var/cache/pkg



## balanga (Jun 15, 2021)

Looking through /var/cache/pkg/ I see that every pkg has two entries. There is a long filename and a shorter one with a symbolic link to the longer one. How does this come about? And if I copy some of these entries to a local pkg repo, I guess I need to copy both entries, or is there some way of recreating the symbolic when a pkg has been copied?


----------



## mer (Jun 15, 2021)

Part of the answer is:
When you pkg install something, the compressed file is downloaded and stored in /var/cache/pkg and the symlink created.  If you look at the symlink, it should match or be pretty close to the package name that you install.
If you run pkg clean it removes things in /var/cache/pkg.

I'm not sure of the answer to the local pkg repo part.


----------



## grahamperrin@ (Jun 19, 2021)

balanga said:


> … a long filename and a shorter one with a symbolic link to the longer one. …


An example:


```
% cd /var/cache/pkg
% ls -hl plasma5-plasma-browser-integration-5.22.0*
lrwxr-xr-x  1 root  wheel    56B 19 Jun 07:41 plasma5-plasma-browser-integration-5.22.0.txz -> plasma5-plasma-browser-integration-5.22.0~4811b47f77.txz
-rw-r--r--  1 root  wheel   162K 15 Jun 13:53 plasma5-plasma-browser-integration-5.22.0~4811b47f77.txz
% sha256 plasma5-plasma-browser-integration-5.22.0~4811b47f77.txz | grep 4811b47f77
SHA256 (plasma5-plasma-browser-integration-5.22.0~4811b47f77.txz) = 4811b47f77246732888eebabb9a8449a3b9513a96a13fd4e5d5b07ac5b41178a
%
```


----------



## Alain De Vos (Jun 19, 2021)

It seems the link is the package without the hash.
Probably the hash is created during the build.
A result of all the inputs and unique.
It probably allows problems to correlate to git versions.


----------

