Accidentally deleted freenas-files and others packages

Melrok

Cadet
Joined
Oct 20, 2023
Messages
8
Hello,
I accidentally enabled pkg in /usr/local/etc/pkg/…, and did a pkg install in the top of my installation. I thought I was in my nextcloud jail…
There is my mess:
Code:
Installed packages to be REMOVED:
    freenas-files: 13.0_1685566027
    py39-midcli: 20190509171453
    py39-middlewared: 13.0_1685566027
    samba: 4.15.13_17

New packages to be INSTALLED:
    libargon2: 20190702 [FreeBSD]
    php82: 8.2.11 [FreeBSD]
    php82-exif: 8.2.11 [FreeBSD]
    php82-intl: 8.2.11 [FreeBSD]
    php82-sysvsem: 8.2.11 [FreeBSD]

Installed packages to be UPGRADED:
    boost-libs: 1.72.0_6 -> 1.83.0 [FreeBSD]
    gdb: 11.1_2 -> 13.2_1 [FreeBSD]
    icu: 70.1_1,1 -> 73.2,1 [FreeBSD]
    source-highlight: 3.1.9_1 -> 3.1.9_7 [FreeBSD]

boost-libs didn't upgraded very well but everything seems to work ok.
And now, pkg update don't work anymore :
Code:
Updating FreeBSD repository catalogue...
pkg: No SRV record found for the repo 'FreeBSD'
pkg: An error occured while fetching package
pkg: packagesite URL error for pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly/meta.txz -- pkg+:// implies SRV mirror type
repository FreeBSD has no meta file, using default settings
pkg: packagesite URL error for pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly/packagesite.pkg -- pkg+:// implies SRV mirror type
pkg: packagesite URL error for pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly/packagesite.txz -- pkg+:// implies SRV mirror type
Unable to update repository FreeBSD
Error updating repositories!


Is there a way to revert the changes without reinstalling my whole truenas?
And if I had to reinstall, does it really means reconfigure everything, reinstall all the jails etc?

And why some packages are automatically removed by pkg when it is enabled? Isn't it a bug?
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Is there a way to revert the changes without reinstalling my whole truenas?
I wouldn't bet on it.
And if I had to reinstall, does it really means reconfigure everything, reinstall all the jails etc?
Not at all. Upload a saved copy of your config file and you'll be back up and running. It's quick enough that it probably isn't worth the time to try to fix what you've done to the installation.
And why some packages are automatically removed by pkg when it is enabled? Isn't it a bug?
They aren't automatically removed when you enable pkg; they're removed when you install something else. And since you aren't supposed to be using pkg at all on the base system, no, I wouldn't consider it a bug.
 

Melrok

Cadet
Joined
Oct 20, 2023
Messages
8
Not at all. Upload a saved copy of your config file and you'll be back up and running. It's quick enough that it probably isn't worth the time to try to fix what you've done to the installation.
I searched for a tutorial because I'm afraid of losing my configuration but I don't find any clean explanation (this one was quite reassuring but there's no mention of config file copied).
Where is (or are) this config file? Will it be enough for the system to recognize where to mount the folders in my only pool?
Do I have to use a usb stick like I did for the first installation ?

If someone have a link to a good set-by-step guide that's what I'm looking for, or else we could make one…?

I took an old PC (Intel i5, 8Go RAM), at first I did this server for fun and now I have several friends using my cloud…

hard:
- 250Go SSD for the system
- 500Go HDD for my only pool
* cloud dataset​
- data folder​
- config folder​
- etc, I followed this guide for details​
* some nfs datasets​
* iocage etc.​

jails:
- reverse-proxy (with small sites on it, no mounts)
- nextcloud
* with around 4 mounts to the cloud dataset and 1 to a nfs dataset​
- minecraft (always off)
- a useless jail I have yet to destroy

"Accidentally", huh? :wink:
I was updating php for nextcloud, but restarting apache24 in the jail didn't show the changes so I restarted the jail instead, several times. At some point I forgot to go back to the jail, didn't understood why pkg didn't worked and boom: the accident.
By the way, can someone can explain to me what I should have restarted?
 

exeter_acres

Explorer
Joined
Oct 8, 2020
Messages
54
You should be backing up your config file regularly.. or at minimum before or after making changes... In Truenas core from the sidebar, you click System, Then General, then Save Config.......

I save it to a folder on my windows client...
 

Melrok

Cadet
Joined
Oct 20, 2023
Messages
8
I did the backup but I didn't have to use it. Everything is fine now !

For the record, I did a "fresh" install (last Truenas iso in usb stick, install over the right disk), the installer detected the config file and asked if I wanted to use it.
Every jail is ok, the mounts are the same etc. Just like before I had problems.

Thank you for the help.
 
Top