# pkg, txz and portmaster / pkg



## Helmut (Sep 30, 2021)

Hi,

since the suffix was changed from txz to pkg I have issues upgrading packages. I have my own repo and create packages using `pkg create -ao`

and then copy it to my ftp server. When I use pkg to upgrade it already fails to retrieve packagesite.txz:


```
[helmut@BSDHelmut ~]$ sudo pkg upgrade bind916-9.16.20
Updating MyRepo repository catalogue...
MyRepo repository is up to date.
All repositories are up to date.
pkg: No packages available to upgrade matching 'bind916-9.16.20' have been found in the repositories
[helmut@BSDHelmut ~]$
```


```
[helmut@BSDHelmut ~]$ sudo tail -5 /var/log/xferlog
Sep 30 12:29:58 BSDHelmut vsftpd[68452]: [ftp] FTP command: Client "192.168.124.35", "RETR packagesite.txz"
Sep 30 12:29:58 BSDHelmut vsftpd[68452]: [ftp] FTP response: Client "192.168.124.35", "150 Opening BINARY mode data connection for packagesite.txz (166960 bytes)."
Sep 30 12:29:58 BSDHelmut vsftpd[68452]: [ftp] FTP response: Client "192.168.124.35", "426 Failure writing network stream."
Thu Sep 30 12:29:58 2021 1 192.168.124.35 0 /pub/FreeBSD/ports/FreeBSD:12:amd64/packagesite.txz b _ o a [EMAIL]helmut@BSDHelmut.charlieroot.de[/EMAIL] ftp 0 * i
Sep 30 12:29:58 BSDHelmut vsftpd[68452]: [ftp] FAIL DOWNLOAD: Client "192.168.124.35", "/pub/FreeBSD/ports/FreeBSD:12:amd64/packagesite.txz", 0.00Kbyte/sec
[helmut@BSDHelmut ~]$
```


```
[helmut@BSDHelmut ~]$ sudo ls -la /var/vsftpd/home/anonymous/pub/FreeBSD/ports/FreeBSD:12:amd64/packagesite*
-rw-rw-r--  1 root  wheel  166960 Sep 30 11:43 /var/vsftpd/home/anonymous/pub/FreeBSD/ports/FreeBSD:12:amd64/packagesite.pkg
lrw-rw-r--  1 root  wheel      15 Sep 30 11:43 /var/vsftpd/home/anonymous/pub/FreeBSD/ports/FreeBSD:12:amd64/packagesite.txz -> packagesite.pkg
[helmut@BSDHelmut ~]$
```


```
[helmut@BSDHelmut ~]$ ftp ftp.charlieroot.de:/pub/FreeBSD/ports/FreeBSD:12:amd64/packagesite.txz
Connected to BSDHelmut.charlieroot.de.
220 Welcome to my ftp site!
331 Please specify the password.
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
200 Switching to Binary mode.
250 Directory successfully changed.
local: packagesite.txz remote: packagesite.txz
229 Entering Extended Passive Mode (|||50391|)
150 Opening BINARY mode data connection for packagesite.txz (166960 bytes).
100% |********************************************************************************************************|   163 KiB    3.88 MiB/s    00:00 ETA
226 Transfer complete.
166960 bytes received in 00:00 (3.84 MiB/s)
221 Goodbye.
[helmut@BSDHelmut ~]$
```

How can I fix that?

Thank you!


----------



## SirDice (Sep 30, 2021)

Helmut said:


> I have my own repo and create packages using `pkg create -ao`


I would suggest using Poudriere or Synth to create the repositories.


----------



## Helmut (Sep 30, 2021)

SirDice said:


> I would suggest using Poudriere or Synth to create the repositories.


a) I'm doing this for my private server at home and I doubt it's worth to set up poudriere
b) Will it fix the pkg / txz suffix issue?


----------



## zirias@ (Sep 30, 2021)

Helmut said:


> a) I'm doing this for my private server at home and I doubt it's worth to set up poudriere


Why? It's not like this was overly complicated to do, and it automates "everything"


Helmut said:


> b) Will it fix the pkg / txz suffix issue?


I'd assume so based on my experience with a repo built by poudriere, the transition went smooth (unnoticed) for me.


----------



## SirDice (Sep 30, 2021)

Helmut said:


> I'm doing this for my private server at home and I doubt it's worth to set up poudriere


The added benefit here is that you don't have to do all the work by hand as you're doing now. So you can just start the process and go to bed without having to babysit it. 



Zirias said:


> I'd assume so based on my experience with a repo built by poudriere, the transition went smooth (unnoticed) for me.


Yep, same here. No problems whatsoever. I didn't even notice the change until later on.


----------



## Helmut (Sep 30, 2021)

Zirias said:


> Why? It's not like this was overly complicated to do, and it automates "everything"



Because I spend 1 hour or so a week with that server. It's a hobby. I tried to set up Poudriere two or three times and failed. It took me hours over hours. I don't have time to do that. All I need this for is for some flavors for my mail relay / webserver. Why do I need Poudriere to overcome an issue with pkg? Don't get me wrong but...


----------



## Helmut (Sep 30, 2021)

Helmut said:


> ```
> [helmut@BSDHelmut ~]$ sudo pkg upgrade bind916-9.16.20
> Updating MyRepo repository catalogue...
> MyRepo repository is up to date.
> ...


[...]


Helmut said:


> How can I fix that?




```
[helmut@BSDHelmut ~]$ sudo pkg upgrade bind916
Updating MyRepo repository catalogue...
MyRepo repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

Installed packages to be UPGRADED:
        bind916: 9.16.20 -> 9.16.21

Number of packages to be upgraded: 1

3 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching bind916-9.16.21.pkg: 100%    3 MiB   3.4MB/s    00:01
Checking integrity... done (0 conflicting)
[1/1] Upgrading bind916 from 9.16.20 to 9.16.21...
[1/1] Extracting bind916-9.16.21: 100%
You may need to manually remove /usr/local/etc/namedb/named.conf if it is no longer needed.
[helmut@BSDHelmut ~]$
```

Sorry for the noise.


----------



## richardtoohey2 (Sep 30, 2021)

Helmut said:


> I tried to set up Poudriere two or three times and failed.


You are not alone.  I'll try again, but there's a bit of a learning/mindset bump to get there.


----------



## sidetone (Sep 30, 2021)

pkg_create(3)

```
pkg_create_set_format() will define the compresion format to use.  By
     default "txz" except if specified otherwise in pkg.conf(5).  It returns
     false if the compression format is unknown and fallback the the default
     format.
```

pkg(5)

```
The default location of this file is /usr/local/etc/pkg.conf.
```


```
REPOSITORY CONFIGURATION
     To use a repository you will need at least one repository configuration
     file.

     Repository configuration files are searched for in order of the
     directories listed in the REPOS_DIR array, which defaults to /etc/pkg/
     and /usr/local/etc/pkg/repos/.

     Filenames are arbitrary, but should end in ‘.conf’.  For example
     /usr/local/etc/pkg/repos/myrepo.conf.
```


```
/etc/pkg/FreeBSD.conf.  Rather than editing that file directly, create
     /usr/local/etc/pkg/repos/FreeBSD.conf
```

Can the suffix be changed manually?

I don't use Podriere or Synth either. A solution with those would be ok. It'd be nice to see a solution for it to use both suffixes without using those tools.


----------

