D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Upgrades


On 07/02/17 09:00, Neil via list wrote:
> I have been using Linux for many years, but I still get puzzled about
> updates to the software. Perhaps someone could help.
> Is it any wonder that I am confused? If anyone could help me here I
> would be very grateful. Others on the list may also find it useful.

Well the other replies have you got you pretty well covered here but if
I may add my two pennies worth... Firstly though, you didn't specify
*exactly* what system you're using - I know you use Ubuntu but which
version specifically? It makes a considerable difference as 16.04 for
example will usually have much more recent packages available than 14.04
in the standard Canonical provided repos.

By way of illustration, I'll tell you what I do (this is on my main
system, a surprisingly conservative Ubuntu 14.04 workstation): I
completely ignore the GUI tools, just for a start. The built-in
graphical tool isn't powerful enough, doesn't check for updates
frequently enough, doesn't expose enough of the internals, doesn't
provide enough logging or verbose error messages, doesn't allow easy
addition/removal of PPAs, doesn't handle standalone packages
elegantly... in short it's pretty useless. That's for me though - for
the majority of users it works just fine as a system update tool I guess

Every single day pretty much the first thing I do after unlocking my
system (it's never turned off) is run an aliased command that does:

sudo apt update && sudo apt dist-upgrade

Notice the lack of "-get" in the command: modern usage of apt mostly
omits that part. If you try running "sudo apt-get update" and "sudo apt
update" one after the other in a terminal you'll spot the difference
immediately. There's no harm in sticking with the 'old' -get usage but
there's also no point in sticking with it either.

The effect of this command is to completely refresh ALL of my package
lists and completely upgrade ALL packages on my entire system, no ifs
buts or maybes. It still asks me for confirmation before downloading and
applying the packages and if there are any errors or glitches I can read
the verbose full output and decide what to do - this almost never
happens. I could pass "-y" to the dist-upgrade command to automatically
apply the updates as well but for obvious reasons I don't recommend that.

Is it overkill to do a complete package refresh and system-wide upgrade
every single day as a matter of course? No! It takes a few seconds and
on most days there aren't any updates anyway. Also it means I'm never
behind on bug fixes and security updates.

Some other handy commands are:

apt-cache policy $PACKAGE-NAME

This will give you the status and source of any given $PACKAGE-NAME.

apt-cache policy | grep http | awk '{print $2 $3}' | sort -u

This provides a neat sorted list of whatever apt sources you have
configured including PPAs. Apt surprisingly doesn't have a native way of
cleanly displaying this unlike yum/dnf/zypper/etc.

Speaking of PPAs, there is no harm in using them: in fact, they are
probably one of the chief draws of using Ubuntu vs Debian. Just be aware
that not all PPAs are created equal. Official or semi-official PPAs are
well curated, frequently updated and very useful indeed to get software
that Canonical either doesn't ship at all or only provides old/rubbish
versions of. Libreoffice is a classic example - Ubuntu usually only
provide relatively antiquated (but stable to be fair) versions. I
already have the 5.3 version you mention on my system which I of course
obtained via the official libreoffice PPA. Funnily enough due to a
rookie packaging error they made with the latest release by borking a
Debian control file debcompareop line it currently spews a whole bunch
of errors under apt and this is kind of my point: by using a terminal I
get to see those (completely ignorable) error messages and act on them
if I see fit whereas the GUI software tool would probably hide them at
best, or silently error out perhaps.

If you *must* use a GUI tool to interact with system software on a
Debian based system, do yourself a favour and install the good old
fashioned synaptic tool. It's a bit uglier but far, far more powerful
than the Ubuntu software thing which honestly, I'd just completely avoid
if at all possible: it's not doing you any favours and isn't actually
making your life easier in any way.

The last points you asked about are standalone DEB files: avoid these at
all cost unless you are building your own or don't have any other
choice. Otherwise, choosing to manually update something like
libreoffice or indeed any other software via "dpkg -i $PACKAGE-NAME" is
absolute madness when you could be using a PPA under apt. Seriously,
just don't do this, ever.

Snapd is also a solution looking for a problem - we've been down this
road with abstracted multi-system installers before and even with the
sandboxing layer snapd provides it's no more use than any of the other
failed systems we've had already. RedHat are currently pushing their
FlatPak alternative which is the same old tosh by a different name and
neither are substantially different from just using Docker to run an
application. Lots of complexity and admin overhead for very, very little
advantage to an average user - in fact, no advantage whatsoever. Unless
you have a specific need for this (DevOps, Sysadmin, etc) stay well,
well away from all of these non-standard install mechanisms.

Hope that clears things up a little maybe and gives you at least one
rock solid option going forward: as ever, I recommend using the terminal
as the UNIX gods intended. It's the fastest, most powerful and flexible
and easiest to debug if anything goes wrong. apt update && apt
dist-upgrade every single day first thing and all will be well with the

The Mailing List for the Devon & Cornwall LUG
FAQ: http://www.dcglug.org.uk/listfaq