# How to install sudo package without internet



## koray (Dec 24, 2019)

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. 

```
# 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. 

```
# 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,


----------



## SirDice (Dec 24, 2019)

FreeBSD 9 has been End-of-Life since December 2016. Please use a _supported_ version. 

Topics about unsupported FreeBSD versions








						Unsupported FreeBSD Releases
					

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms.




					www.freebsd.org


----------



## koray (Dec 24, 2019)

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


----------



## SirDice (Dec 24, 2019)

koray said:


> - 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. 



koray said:


> - 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.


----------



## Crivens (Dec 24, 2019)

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.


----------



## ralphbsz (Dec 24, 2019)

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.


----------



## T-Daemon (Dec 25, 2019)

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:



			http://pkgbeta.freebsd.org/freebsd:9:x86:64/latest/Latest/pkg.txz
		



			http://pkgbeta.freebsd.org/freebsd:9:x86:64/latest/All/indexinfo-0.2.6.txz
		



			http://pkgbeta.freebsd.org/freebsd:9:x86:64/latest/All/gettext-runtime-0.19.8.1_1.txz
		



			http://pkgbeta.freebsd.org/freebsd:9:x86:64/latest/All/sudo-1.8.19p1.txz
		


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


----------

