[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: aptitude safe-upgrade vs apt-get upgrade.



On Sun, 25 Oct 2020 12:12:19 -0500
Ram Ramesh <rramesh2400@gmail.com> wrote:

> Hi,
> 
>    I am trying to upgrade the current setup and I am unable to 
> understand the differences between aptitude vs. apt-get usage.
> When I do apt-get -s upgrade, I get
> > myth2 [rramesh] 100 > sudo apt-get -s upgrade
> > Reading package lists... Done
> > Building dependency tree
> > Reading state information... Done
> > Calculating upgrade... Done
> > The following packages have been kept back:
> >   gstreamer1.0-gl gstreamer1.0-plugins-bad gstreamer1.0-plugins-base
> >   gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly
> > libasound2-plugins libavcodec58 libavformat58 libavresample4
> > libavutil56 libchromaprint1 libgstreamer-gl1.0-0
> > libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0
> > libswresample3 libswscale5 linux-image-amd64
> >   mythtv-frontend
> > 0 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.  
> Clearly nothing is  going to be done. However aptitude -s
> safe-upgrade shows that it will install these.
> > myth2 [rramesh] 101 > sudo aptitude -s safe-upgrade
> > Resolving dependencies...
> > The following NEW packages will be installed:
> >   libcdio19{a} libfaac0{a} libfdk-aac2{a} libilbc2{a} libkvazaar4{a}
> >   liblrdf0{a} libmfx1{a} libopenh264-5{a} libx264-157{a}
> > libx265-176{a} linux-image-4.19.0-12-amd64{a}
> > The following packages will be REMOVED:
> >   libcdio18{u} libcrystalhd3{u} libssh-gcrypt-4{u} libvpx5{u}
> >   libx264-155{u} libx265-165{u}
> > The following packages will be upgraded:
> >   gstreamer1.0-gl gstreamer1.0-plugins-bad gstreamer1.0-plugins-base
> >   gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly
> > libasound2-plugins libavcodec58 libavformat58 libavresample4
> > libavutil56 libchromaprint1 libgstreamer-gl1.0-0
> > libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0
> > libswresample3 libswscale5 linux-image-amd64
> > 17 packages upgraded, 11 newly installed, 6 to remove and 1 not
> > upgraded. Need to get 72.9 MB of archives. After unpacking 270 MB
> > will be used.
> >
> > Note: Using 'Simulate' mode.
> > Do you want to continue? [Y/n/?]
> > Would download/install/remove packages.  
> This makes me wonder if it is better to use aptitude over apt-get.
> Why these differences?  What is the correct way to maintain a working
> system and still keep the system up to date.

To begin with, which distribution is it? In general, with Stable, it
pretty much doesn't matter which tool is used. The kind of problems you
have indicate Unstable or Testing.

First, apt is pretty much apt-get, with different syntax and a few
extra features. Aptitude can generally do a better job of resolving
'difficult' dependencies, but if used with a great many packages (>100)
is likely to be very slow. With more than about 500 packages to deal
with, it may grind to a halt. Don't use it on an Unstable which hasn't
been upgraded for six months. Don't use it for a version upgrade of
Stable, unless the release notes for the upgrade explicitly recommend
it.

Synaptic, the GUI tool, is a front end to apt-get. All the apt tools
are a front end to dpkg, which does all the work but does no dependency
checking and is therefore not safe to be used directly.

All of the tools have a 'safe' mode which is guaranteed not to remove
packages. However, many upgrades do require the removal of some
packages, so the safe mode will only get you so far in these cases.

If you are using Stable, there should never be any real problem in
upgrading. With Testing or Unstable, problems do occur, and you need to
be willing to understand and solve them. Generally, if you keep the
system up to date regularly, aptitude will usually do a good job.

With Unstable or Testing, it is often the case that new versions of a
few packages from a large related set become available before the rest.
The new packages will be mostly incompatible with the existing set, so
upgrading them will cause the removal of some of the rest of the set,
along with other applications which depend on them. If you see that
half your applications are about to be removed, say 'no'. If you do
this with apt-get or apt in safe mode, then packages will be 'held
back'. Aptitude full-upgrade will usually give you a number of options,
with decreasing numbers of removals proposed. If you keep declining
options, it will eventually get to 'keep everything as it is', but you
may find one of the options worth doing. 

Generally time will sort this problem out, as the rest of the set is
released. It is usually possible to upgrade some packages which do not
include the problem ones. This can be done with any of the tools, but
on a graphical system I prefer Synaptic. Other methods may involve a lot
of typing.

-- 
Joe


Reply to: