Archives for posts with tag: download

You want to download an application/game package for your FreeBSD PC, without internet it is hard on *BSD or, GNU/Linux unless you have the software on discs.

This made me to resolve to write a basic shell script to download a package and its dependencies for a FreeBSD 10 machine. As this is the OS I am using day to day.

However, when I started dwelling deeper I noticed FreeBSD’s pkg already had it covered!  🙂

You need following:

  1. A FreeBSD PC which is connected to internet, the architecture must match that of the target where you want to install the packages.
  2. pkg installed on this internet machine running FreeBSD.
  3. root privileges on this machine
  4.  A storage medium to transfer packages from this machine to another.


With above ready you can then use the following command to download a package and its dependencies.

# mkdir /root/off-pac

# pkg fetch   -d -o  /root/off-pac   vlc

Updating FreeBSD repository catalogue…
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following packages will be fetched:

New packages to be FETCHED:




libdvbpsi-1.2.0 (0.09% of 118 MiB: 104 KiB)
opus-1.1.1_1 (0.20% of 118 MiB: 243 KiB)

The process will require 118 MiB more space.
118 MiB to be downloaded.

Proceed with fetching packages? [y/N]:

That is it!

This will download all packages necessary to install vlc. Now you  need to transfer the directory /root/off-pac to your storage medium and install the application on your FreeBSD PC which is not connected to internet.

This is easier than I was expecting, I wonder what I can do for Debian similarly.

Update[10 March 2016]:

There is a gotcha which I had not covered as I had not faced it ;), the default FreeBSD repository is pointed to the quarterly release branch, that is applications are updated once in three months or so.

But as the RELEASE disc comes with a fixed package set, using applications from the quarterly can cause issues, especially with the dependencies. It is better to stick to the RELEASE repository.

In my example I had tried this on FreeBSD RELEASE 10.2, but some of the libraries were old by the time I started downloading packages from the official quarterly repository.

This is simple to solve as pkg in FreeBSD supports configuring and use of multiple repositories.

How to configure this:

Find out the release URI for the FreeBSD version you want packages for by visiting

In my case the OS was 64 bit and RELEASE 10.2, so I noted the following URI:

Copy the default pkg repository at /etc/pkg/FreeBSD.conf config to /usr/local/etc/pkg/repos/r102.conf

I choose r102.conf, it could be any arbitrary name. But must end with .conf! Choose something meaningful 🙂

cp /etc/pkg/FreeBSD.conf /usr/local/etc/pkg/repos/r102.conf

Now edit the r102.conf file replace the url variable and it would look something like this:

r102: {
url: “pkg+${ABI}/release_2“,
enabled: true,
signature_type: “fingerprints”,
fingerprints: “/usr/share/keys/pkg”,
mirror_type: “srv”

Refresh the repository cache:

pkg update

You can now install applications from this repository:

pkg install-r r102 vlc

Now to fetch packages from this repository, use the -r switch, like:

pkg fetch   -d -o  /root/off-pac  -r r102  vlc

What this does is it downloads vlc from the repository configured in r102. The packages downloaded like this should be compatible with the libraries you might have installed using the RELEASE disc.

Its been long since I posted about the first offline friendly GNU/Linux distro which I discovered- Debian.

I have now come across two more FLOSS operating systems, which a user who lacks broadband connection can use.

The first one is PC-BSD.

PC-BSD has a new way of packaging applications- called the PBI which stands for “Push button Installer ” or the “PC-BSD installer”. A PBI is a self contained package like Mac’s .dmg package or windows MSI(MS Installer).

In my opinion, this is a killer feature of PC-BSD which Linux distros lack.  I am planning to write an entire post about PC-BSD as it has lot of other exciting features.

##More about PBI –

##Where to download pbi’s

This makes it simple to download and transport. There  are may other desirable advantages of such method. However, here I am focusing on ease of download and use.

There is a caveat though, the size of the package increases. But disk space being cheap nowadays, this can be overlooked. [Only if you have enough disk space and you have means to download large packages from someone or somewhere 😉 ]


PC-BSD is not Linux! they are different, though they belong to the same class/family -Unix

Nevertheless they have similarities too as they use many FLOSS applications.

As of version 9.2 they have dropped 32 bit version. But still, if you want you can “convert” your FreeBSD OS to PC-BSD. Refer the wiki for how to do this.

Speaking of disk space, the other one is meant for old PCs with limited resources- SliTaz

As of version 4 they have the small install image(35MB!) and another disk image having all the software.  Sweet! 🙂

I have used the small image on VMs, and I was pretty impressed. It has all the “basic” tools save office software(Openoffice).

Now, I highly  recommend PC-BSD,  As the packing is dead simple and you don’t have to download large software disc. You have to download the individual packages separately.

Next is Slitaz if your machine is old or has less RAM and processing power, and you want to download a software disc which has most of the applications.

Or if you can get large AND many discs(first 3 DVD’s will suffice ) then go with Debian.

You may find downloading and maintaining Debian’s disc set heavy or too large. If yes, then the former two are your options.

A note to those who are new to FLOSS community:

Always check the reviews  and information of distros on [ ] before you try out things. They track and update the changes very regularly.

A post/blog might have outdated information, so rely on the latest news.

Read the system requirement of any OS/software you are planning to use. This saves lot of frustration in case if your hardware is not supported or upto the mark.

If anything confuses you or you are unfamiliar with the new words or terminologies, then search on the web. It helps you to learn new things 🙂

Update on 14 August 2015:

Since March/April I have moved to using FreeBSD 10, it now features a nice package manager – pkg. The installation image provided(DVD1) has all the necessary packages to have a GNOME/KDE desktop. You don’t need internet unless you need some thing else which is not included on the disc.

Ok, quick steps on how to use the DVD1 for installing the applications provided on FreeBSD:

  1. Install FreeBSD, download dvd1, any other image(disc1, bootonly) provided will not have these applications.
  2. Mount the disc on /dist, create /dist as root “mkdir /dist”, it has to be /dist
  3. As root “mount -t cd9660 /dev/cd0 /dist”
  4. Check whether it was mounted by running “mount” or “df -h”
  5. Bootstrap pkg csh/tcsh ” env REPOS_DIR=/dist/packages/repos pkg bootstrap”
  6. or on sh, “export REPOS_DIR=/dist/packages/repos; pkg bootstrap”
  7. After this bootstrapping, you can install the available packages from the disc.

In case you have access to some FreeBSD machine which is connected to internet, you can use = >