Re-enable 'dpkg' in shell

neeff

Cadet
Joined
Sep 1, 2023
Messages
1
First of all, I know it's not recommended installing things by terminal and it may break everything up
I understand and won't come here crying if everything is messy
I'm wondering how I can re-enable dpkg in terminal to install a .deb file
apt-get is working since I gave 'chmod +x /etc/apt/*' but the same haven't happened with dpkg
Everytime I try to use dpkg i get "zsh: permission denied: dpkg" and I haven't found a way to bypass this.
I tried giving /etc/dpkg/* +x but it doesnt work.
Does anybody know how I could re-enable dpkg?
Ps: I re-enabled apt-get and put some sources on sources.list but it's not quite working, that's why I want to use dpkg
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Sorry I can't help.

But, this will probably come up continuously because Linux people expect it to be Linux, not a firmware OS based on Linux.

So, whoever does solve the problem, should probably write a TrueNAS Resource doc on how it is done. And by SCALE version, since Bluefin might be different from Cobia. Plus, include the stock disclaimers, (that @neeff already understands & wrote above).
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I am looking into something like this for my personal curiosity but I'm not holding my breath that I can do exactly what I desire and keep it during a software update, that is the real tricky part. Right now I use a script to check for the existence of an executable file, if it's not there I put it there via the script automatically. That is not the same as installing software. What I'm saying is if you can find the software you are running as an executable that has no dependencies, you should be good.

Is there a reason you cannot use a jail/VM/Docker Container to get the task done or do you really need the package installed on the base system? I don't need an answer, maybe you just want the challenge.
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
Yeah probably not a good idea to put execute bit on /etc/ directory. It's just a bunch of config files.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Yeah probably not a good idea to put execute bit on /etc/ directory. It's just a bunch of config files.
...except that iX thought it was a great idea to put CORE's console menu in there as an executable (/etc/netcli).

Now, of course the simple answer is what I mentioned above--the dpkg binary is located at /usr/bin/dpkg. But that leads to an uncomfortable question: if OP thought that chmod +x /etc/dpkg/* would do anything to help him, is he capable of preventing system damage from inappropriate use (which almost all use is on SCALE) of dpkg?
 

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
...except that iX thought it was a great idea to put CORE's console menu in there as an executable (/etc/netcli).
Wow, that's a curious one indeed.

But that leads to an uncomfortable question: if OP thought that chmod +x /etc/dpkg/* would do anything to help him, is he capable of preventing system damage from inappropriate use (which almost all use is on SCALE) of dpkg?
You're right. It seems like he lacks basic understanding of POSIX and just blindly copy/paste commands he finds on the internet, which is quite dangerous given that he is probably executing all these under super user.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
...except that iX thought it was a great idea to put CORE's console menu in there as an executable (/etc/netcli).
Historically /etc was where system administration commands were located before the introduction of /sbin. Somewhere between SunOS and Solaris 2/System V.4 IIRC. 4.4BSD adopted the change.

That does not mean I would recommend doing so today. And even FreeNAS is not that old. :wink:
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
I am looking into something like this for my personal curiosity but I'm not holding my breath that I can do exactly what I desire and keep it during a software update, that is the real tricky part. Right now I use a script to check for the existence of an executable file, if it's not there I put it there via the script automatically. That is not the same as installing software. What I'm saying is if you can find the software you are running as an executable that has no dependencies, you should be good.

Is there a reason you cannot use a jail/VM/Docker Container to get the task done or do you really need the package installed on the base system? I don't need an answer, maybe you just want the challenge.
Why don't you just put the software in a dataset or subfolder of one? It won't go away. Just use the full path to it, or, add it to your $PATH. Or maybe you did use dpkg to install it.

I added mosh-server via this manner, just got the binary. I wish mosh was installed by Truenas for admin folks!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Why don't you just put the software in a dataset or subfolder of one? It won't go away. Just use the full path to it, or, add it to your $PATH. Or maybe you did use dpkg to install it.
I wish things were that easy. Adding an executable is easy but doing an installation is quite another. If I can't install it then why copy it anywhere? Or I'm missing something.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Install on some suitable Debian system and just copy the binaries and libraries to a suitable location on your data pool. PATH and LD_LIBRARY_PATH help run software from non-standard locations.
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608
I wish things were that easy. Adding an executable is easy but doing an installation is quite another. If I can't install it then why copy it anywhere? Or I'm missing something.
You can easily extract binaries from a deb file you download, copy from another system, look for binaries like my mosh example, mosh themselves have downloadable binaries and that's the way I went for that one. I don't know what you installed, but another example, needed bc. I downloaded the deb and extracted bc from it.

A deb file is just an archive file.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
On scale, there's an executable install-dev-tools that unlocks everything (and also installs basic development packages - used by developers, not to be used on production systems). Starting in DragonFish, we will begin making parts of the root filesystem readonly, and this will basically be one of ways to unlock it. Actual unlocking in dragonfish will be via /usr/local/libexec/disable-rootfs-protection (which also sets a flag that we can see in the debug that rootfs has been modified so that we can proactively close tickets that have modified base installs).

Do note that if you modify the base OS in any way, we will ask you to reproduce any bugs on a pristine install. We're having an increasing number of bug tickets with non-standard installs (including patched middleware), which can become a waste of developer time if we aren't properly notified ahead of time.
 
Last edited:

Whattteva

Wizard
Joined
Mar 5, 2013
Messages
1,824
You can easily extract binaries from a deb file you download, copy from another system, look for binaries like my mosh example, mosh themselves have downloadable binaries and that's the way I went for that one. I don't know what you installed, but another example, needed bc. I downloaded the deb and extracted bc from it.

A deb file is just an archive file.
That's interesting. mosh and tmux are installed by default on CORE. It looks like on SCALE, only tmux is installed by default.
 

sfatula

Guru
Joined
Jul 5, 2022
Messages
608

Kaplah

Cadet
Joined
Dec 6, 2020
Messages
4
I can think of a few legitimate reasons to enable apt and dpkg. While there is the possibility of damage to the systems those of us running Truenas scale at home may be doing something similar to what I am. Personally I'm trying to get Auto Ripping Machine running so I can crank through my wife's massive DVD/CD/ BRD collection and store them. I need the ability to install GPU drivers for transcode.

If this isn't necessary for the Plex / ARM apps please point me to better install instructions. From my own research here's what I've found:

1) I need the nvidia driver installed on the truenas scale host.
2) https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

All of this process needs apt and dpkg. If this isn't true a better set of instructions for these docker apps would be greatly appreciated.
 

Evan Richardson

Explorer
Joined
Dec 11, 2015
Messages
76
I can think of a few legitimate reasons to enable apt and dpkg. While there is the possibility of damage to the systems those of us running Truenas scale at home may be doing something similar to what I am. Personally I'm trying to get Auto Ripping Machine running so I can crank through my wife's massive DVD/CD/ BRD collection and store them. I need the ability to install GPU drivers for transcode.

If this isn't necessary for the Plex / ARM apps please point me to better install instructions. From my own research here's what I've found:

1) I need the nvidia driver installed on the truenas scale host.
2) https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

All of this process needs apt and dpkg. If this isn't true a better set of instructions for these docker apps would be greatly appreciated.

there are dozens and dozens of programs out there. create a vm, pass through the gpu, or use a container and pass through the gpu, etc. There are a bajillion ways to get a DVD ripping tool installed on truenas without needing apt/dpkg
 
Top