1

I've had numerous problems in the past where apt-get fails to do something and gives a confusing reason why which doesn't help me solve the problem, but aptitude guesses some alternative action that fixes things.

Should I always use aptitude to avoid these problems in the first place? I'm just trying to understand whether there are drawbacks to the tool or I'm just missing some critical knowledge about using apt-get that makes me prone to errors.

jeversmann
  • 19
  • 2
  • What version of Ubuntu are you running? It'd also be helpful to say what kind of commands and errors you've used, e.g. do you always run sudo apt-get update before trying to install new packages or upgrade? – Arronical Jul 14 '15 at 14:00
  • It's not a problem that's tied to any version; I've had issues on both 12.04 and 14.04. Also, update doesn't have anything to do with it.

    I'm asking about situations you can get into, especially when trying to install a package with a dependency that you have the incorrect version of, where apt-get doesn't know how to make changes and yet aptitude can just solve the problem.

    – jeversmann Jul 16 '15 at 05:21

2 Answers2

2

Read here more detailed information about differences between package managers.

As for apt-get you reffered to new dependencies of a package that gets hold or etc. apt-get has a command (function) which is not always used in common for example to update and upgrade packages:

sudo apt-get update && sudo apt-get upgrade --with-new-pkgs

the command with --with-new-pkgs is very useful sometimes and it means:

   Allow installing new packages when used in conjunction with
   upgrade. This is useful if the update of a installed package
   requires new dependencies to be installed. Instead of holding the
   package back upgrade will upgrade the package and install the new
   dependencies. Note that upgrade with this option will never remove
   packages, only allow adding new ones.
JoKeR
  • 6,972
  • 9
  • 43
  • 65
  • 1
    Good one! :-) Upvoted! I'm going to adapt my answer to include yours... (alternatively, you can do the same and then I'll delete mine. Let me know your preference) – Fabby Jul 17 '15 at 08:40
0

Always use sudo apt-get upgrade until you run into problems.

Then use:

  1. sudo apt-get update && sudo apt-get upgrade

If that still poses problems use:

  1. sudo apt-get update && sudo apt-get upgrade --with-new-pkgs

And only then use:

  1. aptitude and cycle through the proposed solutions and take the best one for you!

Otherwise, one of these days you're going to back yourself into a corner you won't get out of any more …

Also, start making system back-ups if you're not making those yet and keep at least 2 system back-ups.

Fabby
  • 34,259