Update problem with pkg

Richardszu

Dabbler
Joined
Jan 21, 2022
Messages
49
Hi there,
I would like to update the pkg upgrade -f packages in the console or in SSH with TrueNas Core -12.0-U8.1 but I get this error message:
root@truenas[~]# pkg upgrade -f Updating local repository catalog... pkg: file:///usr/ports/packages/meta.txz: No such file or directory repository local has no meta file, using default settings pkg: file:///usr/ports/packages/packagesite.txz: No such file or directory Unable to update local repository Error updating repository!
I searched with Google and on the forum but, I did not find anything to solve this problem?
On the other hand when I do: pkg info I have a list that scrolls on the screen:
Example:
xtail-2.1
zopfli-1.0.3_1
zsh-5.8
Has anyone had this problem? And how to solve it?
Thanks for your help Richard :)
 

c77dk

Patron
Joined
Nov 27, 2019
Messages
468
Are you doing this directly in TrueNAS CORE CLI? Not in a jail? If so: don't

The long version: TrueNAS is an appliance, not meant to be altered, and trying to do so might break the system.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
The only supported way of updating any version of TrueNAS is through the UI. No user serviceable parts in that place where you are looking.
 

Richardszu

Dabbler
Joined
Jan 21, 2022
Messages
49
Thanks for your answers @c77dk @Patrick M. Hausen,
If I understand correctly, apart from updating TrueNas from the web interface, I can't modify anything directly in the CLI? But, then, how do I send with my backup script an email with a log attachment. Is it possible ?
Have a nice day Richard
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Configure outgoing mail and an appropriate alias for the root user in the UI. Test if mail works. Then from your script invoke something like this:
Code:
date=$(/bin/date)

(   echo "Subject: Backup Log ${date}"
    echo "From: mytruenas@mydomain.com"
    echo ""
    cat /where/ever/your/logfile/is
) | /usr/sbin/sendmail -i root
 

Richardszu

Dabbler
Joined
Jan 21, 2022
Messages
49
Thanks @Patrick M. Hausen I just tested it and it works great.
I've been looking for several weeks how to do with Bash I even wanted to install the PKG Mutt? Now I understood not to modify the systems files I ignored it and it was the updates that did the job. :mad:
I'm a beginner, that didn't escape you! I've been using TrueNas Core for about 6 months while waiting to switch to TrueNas Scale! It will be another great adventure. :wink:
A big thank you to you and for this sharing, have a great day Richard :smile:
 
Top