0

For me, I know three ways to install software in ubuntu. First is "apt-get install", next is "dpkg", the last is "./configure, sudo make ,sudo make install". But could anyone tell me the differences of these three ways?

Anand S Kumar
  • 88,551
  • 18
  • 188
  • 176
DavidHsu
  • 3
  • 2

1 Answers1

1

apt-get

apt-get install will download and install software from the repositories you currently have enabled. These, by default, usually include your distro's (Ubuntu in this case) online software repositories.

However, you may have various third-party repos added to your list of repositories that it will also check.

The advantages to this method is that it is easy to upgrade and remove software packages with a single command and all of your software comes from trusted sources.

The major disadvantage is that certain software you may want to install may not be available through your distro's repositories.

dpkg

dpkg -i is similar to apt-get install except that instead of looking for software online, it requires the DEB package you wish to install to already be located in an accessible location in the file system.

The advantage to this method is that once the package is installed, it can be removed via apt-get, just like a package that you used apt-get to install. Also, DEB files for software you want may be available online via downloadable DEB files, but not in any repository.

The disadvantages are that most software installed via this method cannot be updated automatically, you must download and install any updated manually the same way you installed the initial package, and packages downloaded as individual DEB files can be dangerous and are inherently less trustworthy compared to those downloaded via a trusted repository.

sudo make install

sudo make install is often the last recourse for people who want software that is unavailable in a prepackaged format for their system. This is the most dangerous way to install software. When you run this command, the Make script has access to your entire file system and can add or remove files anywhere it thinks is necessary. This might just work, but there's also a chance that files will end up in places that are inappropriate for your distro.

When the maintainers of your distro package software for use via your distro's repositories, they will often tweak the build scripts to place files in different places or look for dependencies in different places.

sudo make install is recommended for experts only. The only time you'd want to do this is when you absolutely need the bleeding edge version of a software package or when you have no other choice.

The disadvantages are numerous. This is an inherently unsafe operation, so make sure you trust the software package. Whereas apt-get and dpkg will check for dependencies, you need to make sure you have the dependencies for software when you're building it yourself. Also, if the software you're trying to install conflicts with an installed package, you will get no warning, whereas apt-get and dpkg will warn you of conflicts. Finally, you can't use apt-get or dpkg to uninstall programs installed via sudo make install. If you want to uninstall one of these programs, you'd better hope the person who made it included an uninstall target in their build script. If not, you'll have to manually hunt for and remove all the files the build script added to your system.