Accidentally removed wget, now pkg repository isn't found

profzelonka

Explorer
Joined
Mar 29, 2020
Messages
67
I thought I was running a command in a jail, but instead ran it in the main truenas shell.
Code:
pkg remove wget

It removed wget and wgetpaste (or something like that?)

Now I see this..
Code:
root@freenas[~]# pkg upgrade
Updating local repository catalogue...
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 repository local

I updated to 12.2-release-p3 hoping it would resolve it, nope..

Any ideas?
 

Etorix

Wizard
Joined
Dec 30, 2020
Messages
2,134
I would backup the configuration and reinstall TrueNAS.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
You don't have to reconfigure anything.
 

profzelonka

Explorer
Joined
Mar 29, 2020
Messages
67
There's gotta be a way to get it back.. My server is headless so a reinstall would involve me obtaining a few other things before I can reinstall it to the same usb drive.

Any way to fetch pkg?
 

profzelonka

Explorer
Joined
Mar 29, 2020
Messages
67
Went thru the trouble of reinstalling and.. issue persists. Of course it does - the files are in the pools, not the TrueNAS OS.....

How can I get pkg back on TrueNas??
 

webdawg

Contributor
Joined
May 25, 2016
Messages
112
I think you can download the package from the repo, upload via sftp, and install it that way.
 

Jailer

Not strong, but bad
Joined
Sep 12, 2014
Messages
4,977
You shouldn't be using pkg to install anything on the base OS. If you need to install additional software do it in a jail.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Went thru the trouble of reinstalling and.. issue persists
What issue is it that you think you're seeing? That you can't do pkg upgrade in TrueNAS? That isn't an issue, that's intended behavior, as @Jailer says. If wget is present, the issue is resolved.
 

profzelonka

Explorer
Joined
Mar 29, 2020
Messages
67
Oh, I wasn't aware that pkg upgrade isn't supposed to be run in base OS shell. Resolved then. Thank you.
 

richiie89

Cadet
Joined
Jan 14, 2023
Messages
5
i might be wrong and i might be posting this in wrong thread, so please point me in right direction.
TrueNAS-13.0-U3.1 (3153285d7d)

pkg update
Updating local repository catalogue...
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.pkg: No such file or directory
pkg: file:///usr/ports/packages/packagesite.txz: No such file or directory
Unable to update repository local
Error updating repositories!

What should i do to resolv this?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
What should i do to resolv this?
Not run pkg commands on the base OS, as the second and third posts before yours in this thread make clear.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
You make no mention of trying to do this from within a jail, so I will point out that you are not expected to be able to do this. TrueNAS is an appliance OS and you are not expected to be able to add or remove packages to the base OS. You can save off your configuration and reload the OS to restore your wget.
 
Top