2

Also what's the safest way to get Ubuntu deb packages?

karel
  • 114,770

3 Answers3

6
  • The safest way is to use Ubuntu Software Center without adding personal archives to your system. You can also download them yourself: http://packages.ubuntu.com/ and use either Ubuntu Software Center or the command dpkg to install them.

  • A bit less safe is downloading DEB files yourself from resources you can trust. Personal archives are safe if you install them from launchpad. You can assume those personal archives have been tested and installed and when bogus all kind of alarms to go off.

  • Very unsafe is to install software from random locations on the web. If a random website offers a way to install software you need to make sure that the website is safe yourself. Installing MySQL by downloading from their site is all fine but installing MySQL from a random other site... I'd be very cautious.

Rinzwind
  • 299,756
1

deb is the extension of the Debian software package format. Debian packages are used in the Debian distribution and distributions based on Debian, such as Ubuntu and others.

Double click a .deb file to open it for installation in the Ubuntu Software Center. Don't install .deb files from sources that you are not sure about.

There are two useful command-line tools for installing .deb files in the terminal. Both of them are shown in the simulated installation form, so you can try them both without installing anything.

  1. apt

     cd /path/to/package.deb  
     apt install --simulate ./package.deb  
    

    This is a simulated install that automatically does package dependency resolution, but it does not always resolve package conflicts correctly. The usefulness of this command is that it can correctly identify missing apt packages. If the simulated installation is successful, you can install the .deb file for real with sudo apt install ./package.deb

    When faced with a package conflict apt chooses the default repository version as it should do to prevent package management disasters later on, but the price for this sensible package management is that it does not always resolve package conflicts correctly from the standpoint of simulating a successful installation of the .deb file.

  2. dpkg

     cd /path/to/package.deb  
     sudo dpkg -i --simulate package.deb  
    

    This is also a simulated install. This form of command is sometimes more successful than sudo apt install --simulate ./package.deb at simulating a successful installation of the .deb file, but it does not provide information about missing dependencies as apt does. If the simulated installation is successful, you can install the .deb file for real with sudo dpkg -i package.deb

karel
  • 114,770
1

Deb packages can be installed in a few ways, the most easy being through the Ubuntu Software Center. By double clicking any Deb file, by default in all supported version of Ubuntu, the Ubuntu Software Center will launch and you will have the ability to install the package. The Software Center, however, is notorious for lagging and being buggy and personally I've found it being unable to install a great number of applications that are supported for my system, leading me to the second method dpkg.

Using the dpkg command you can install Deb packages via the command line. This is, in my experience, the fastest and most successful way of installing Deb packages. The syntax for dpkg:

sudo dpkg -i DEB_PACKAGE // install a Deb package
sudo dpkg -r PACKAGE_NAME // remove a Deb package

See also How do I install a .deb file via the command line?

The safest sites you can download .deb files from is a hard question to answer. You could say that all official Linux/Ubuntu sites are the most safe still I would claim that downloading Google Chrome from google.com is about as safe as it gets.

A good recommended site, as others mentioned, is Launchpad. From there you can not only download Deb packages but also find PPAs. Installing a PPA allow you to update your software via the Software Updater or update your software via the terminal.

When you download from other sources you will have to apply common knowledge. One good method of preventing you from downloading 'bad software' is to simply look for someone on, for example, Ask Ubuntu that recommends the software for a specific purpose and have been given positive response for the answer.

Xweque
  • 1,103