What's the file extension for packages we install?

7,355

Solution 1

Installation packages have an extension .deb in Ubuntu. You can install a deb package with

sudo dpkg -i <package_filename.deb>

In that case you have to know where your package is. Easier way is to use

sudo apt-get install <package_name>

In that case Ubuntu makes sure it downloads and installs the package from a verified source. It also installs other packages that are required in order for the installed package to work.

The third option is to download some other kind of software (usually source package) in a tar.gz or similar package. You have to unzip it and then look for some README or INSTALL file where instructions for the installation are written. These instructions usually involve compiling

automake
./configure
make

and installing

sudo make install

This is just an example. Manual installations differ from package to package.

Regarding extensions. Executable files do not have to have an extension as in Windows. The file permissions tell whether a file is executable or not. Try "ls -l". If there are x's in the permissions then it is executable unless it is a directory. In that case x means you can change to this directory.

Solution 2

When you install a package with APT, you don't need to specify any extension. All you have to type is the package name, for example

sudo apt-get install gimp

Sometimes the exact package name isn't that obvious. Maybe you know you need gtk-doc but when you put that into apt-get install it's not found, in which case, try pressing tab to complete the name, and if that doesn't work, try apt-cache search gtk-doc and you'll see what you want, so you can...

sudo apt-get install gtk-doc-tools

When not using APT you may see packages with a .deb extension. This is the package format used by Debian-based distributions including Ubuntu (the packages downloaded by APT are in this format). You can install .deb files using the dpkg utility by running this command in the directory where the file is (or with the full path):

sudo dpkg -i <name-of-package>.deb

It may be a good idea to follow this with sudo apt install -f to resolve dependencies. Alternatively, you can use the recently-added APT feature (note that it requires the path, here just ./ because the file is in the current working directory):

sudo apt install ./<name-of-package>.deb

The advantage of using this command is that APT performs dependency resolution.

Other things you want to install might come in the form of .tar.xz or .tar.gz and so on archives. For these, some general instructions are in How do I install a .tar.gz (or .tar.bz2) file?, but the specifics will vary widely, and you will need to read the instructions provided by the package maintainer and possibly do further research in those cases.

Share:
7,355

Related videos on Youtube

Yassir Rabiea
Author by

Yassir Rabiea

Updated on September 18, 2022

Comments

  • Yassir Rabiea
    Yassir Rabiea over 1 year

    I know that there is no specific file extension in Ubuntu (Linux), so if I had an application (package) and I want to install it manually (using terminal), how:

    1. can I find out which file (extension) to use to install (either using apt-get or another method)?
    2. if there is more than one file with the same extension (like inspect.sh and studio.sh) which one of them is used in the installation?
    • Rinzwind
      Rinzwind almost 8 years
      regarding the 2d: always check for a "read me" or "install.*"