Skip to content

Binary packages

.deb files

Binary packages on Ubuntu are often provided as .deb files (short for Debian). .deb is the Debian package format and the most common way of installing programs in Ubuntu.

To install a binary package (.deb file), you can use apt.

<font color="#5EA702">sudo apt</font> install ./package_file.deb

If the package has any dependencies that are not currently installed, install those dependencies:

<font color="#5EA702">sudo apt</font> --fix-broken install

For example, let's install a terminal browser browsh

First download the .deb file to the /tmp folder

$ cd /tmp
19:58:14 with <font color="#FDEB61">abc</font> in <font color="#37E6E8">/tmp</font> <font color="#98E242">➜</font>

$ wget https://github.com/browsh-org/browsh/releases/download/v1.8.2/browsh_1.8.2_linux_amd64.deb

Saving to: ‘browsh_1.8.2_linux_amd64.deb’
browsh_1.8.2_linux_amd64.deb  100%[============================>]   3.54M  9.69MB/s    in 0.4s    
2023-06-19 14:39:11 (9.69 MB/s) - ‘browsh_1.8.2_linux_amd64.deb’ saved [3711462/3711462]

Install browsh with apt

$ sudo apt install ./browsh_1.8.2_linux_amd64.deb browsh_1.8.2_linux_amd64.deb

(Reading database ... 43419 files and directories currently installed.)
Preparing to unpack browsh_1.8.2_linux_amd64.deb ...
Unpacking browsh (1.8.2) ...
dpkg: dependency problems prevent configuration of browsh:
 browsh depends on firefox | firefox-esr; however:
  Package firefox is not installed.
  Package firefox-esr is not installed.

dpkg: error processing package browsh (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 browsh

Finally we will install missing dependent packages

$ sudo apt --fix-broken install -y
...
update-alternatives: using /usr/bin/firefox to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
Please restart all running instances of firefox, or you will experience problems.
Setting up browsh (1.8.2) ...
Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.40.0+dfsg-3ubuntu0.4) .

Compiled executables

When you download an executable and want to make it available system-wide (so that you can run it from any location in the terminal), you need to put it into a directory that's listed in your system's PATH.

There are several folders that are already included in the PATH

  • /home/abc/bin/
  • /home/abc/.local/bin/

For example, let's install EJSON - a small library to manage encrypted secrets using asymmetric encryption.

Download archeive file from the ejson releases

$ cd /tmp 
08:01:30 with <font color="#FDEB61">abc</font> in <font color="#37E6E8">/tmp</font> <font color="#98E242">➜</font>

$ wget  wget https://github.com/Shopify/ejson/releases/download/v1.4.0/ejson_1.4.0_linux_386.tar.gz 

ejson_1.4.0_linux_386.tar.gz                          100%[================================>]   1.36M  2.33MB/s    in 0.6s    
2023-06-19 15:27:29 (2.33 MB/s) - ‘ejson_1.4.0_linux_386.tar.gz’ saved [1425818/1425818]

Extract the binary file from tar archeive

$ tar -xzf ejson_1.4.0_linux_386.tar.gz
08:01:31 with <font color="#FDEB61">abc</font> in <font color="#37E6E8">/tmp</font> <font color="#98E242">➜</font>

Add executable permissions to a file

$ chmod +x ejson
08:01:31 with <font color="#FDEB61">abc</font> in <font color="#37E6E8">/tmp</font> <font color="#98E242">➜</font>

Move the binary to the folder, which is listed in the $PATH environmental variable.

$ mv ejson /home/abc/bin/
08:01:32 with <font color="#FDEB61">abc</font> in <font color="#37E6E8">/tmp</font> <font color="#98E242">➜</font>

Now we can use ejson

$ ejson keygen

Public Key:
fd8f94024c1aa87slc4b8235a3a0ed8a5b494e10f61cf4c65aa119824b562f57
Private Key:
082d650b5671b96b599b7dbs213acb8e53dc47ff9211010249c48478d427cc20