How to install sudo package without internet

Hello,

I am not much experienced at Freebsd operations.
We noticed that "sudo" package is not available. When we run >sudo .... , it cant find it.

So we decided to install the "sudo" package. However, this is a server in internal network without external access.
So we need to do it locally.

When I listed the packages, I can see the sudo package at there. I am not sure what actually does it mean.
Code:
# pkg_info -f sudo-1.8.6.p7
Information for sudo-1.8.6.p7:

Packing list:
        Comment: PKG_FORMAT_REVISION:1.1
        Package name: sudo-1.8.6.p7
        Package origin: security/sudo
        CWD to /usr/local

When I try to install, it tries to connect internet without success.
Code:
 # pkg install sudo
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg please wait
pkg: Error fetching [URL]http://pkgbeta.FreeBSD.org/freebsd:9:x86:64/latest/Latest/pkg.txz[/URL]: No address record

How can I perform this installation without internet connectivity?

THanks,
 
Would the following work ? :

- retrieve the sudo package manually
sftp "sudo-1.8.6p7.tar.gz" file to the freebsd server

- run the command at the same directory
pkg_add sudo-1.8.6p7.tar.gz
 
- retrieve the sudo package manually
sftp "sudo-1.8.6p7.tar.gz" file to the freebsd server
I've been known to use something as simple as an USB stick to transfer packages to an air-gapped system.

- run the command at the same directory
pkg_add sudo-1.8.6p7.tar.gz
The old package format was deprecated along with the rest of FreeBSD 9. FreeBSD 10 and onward use a different package format.

It doesn't matter how you manage to get the package, you're still on a version that's been deprecated 3 years ago. Use a supported version.
 
In short, we only point people in the correct direction of how to do things. We will not do the leg work of building you the right package. That is your end of the stick.
 
At this point, the only alternative to upgrading to a supported version and then installing would be to build sudo from source. Which is certainly possible, but (a) a bad investment of effort, since an upgrade is just necessary for sane management, and (b) likely not within your skills, given the question you asked above. I think the advice given by SirDice and Crivens is not only good advice, but also unavoidable.
 
From a technical point of view it's possible to install security/sudo (or any other package, on a unsupported 9.x FreeBSD version) with no internet access, with no package management tool installed (ports-mgmt/pkg), with very little effort.

From a system with internet access fetch on a USB drive:


Plug in, mount the USB drive,
cd /USB_drive
pkg add pkg.txz
pkg add sudo*
 
Back
Top