4

Linux Mint has a nice GUI-based Update Manager with selectable update tiers. The defaults are for levels 1 through 3 our of a possible 5 levels. However, I often handle administrative tasks for a number of Linux Mint desktop systems using SSH rather than visiting the physical machines. How do I achieve the same functionality from the command line?

I am already aware of the apt-get update and apt-get upgrade commands, but as far as I know those commands still do not have any functionality equivalent to the five-tier behaviour of Update Manager (/usr/lib/linuxmint/mintUpdate/mintUpdate.py).

Update: When I originally posed this question, I was looking for a Linux Mint 17 solution. I'm now running 18.3 on some of our systems and have been able to provide an answer for those.

3

There was no alternative as mintUpdate.py was GUI (gtk) only until I decided to write one. I described it in my blog - Linux Mint Update CLI You can find there link to gitHub as well. I will publish some screenshots as well.

  • A tool like this is very much needed as part of the standard Linux Mint distribution so that it does not become orphaned as the GUI variant is revised in future releases. Have you considered approaching Clem to see if you can work with the Linux Mint team to integrate a solution? – froage Mar 26 '15 at 20:45
  • Yes, of course, I have done that. Integration is my goal. – Jan Mar 27 '15 at 19:03
  • i had just tried to run sudo apt-get update && sudo apt-get upgrade but it wanted to change /etc/issue* and /etc/lsb-release from "Linux Mint 17.2 Rafaela" to "Ubuntu 14.04.3 LTS" – rjt Jan 8 '16 at 22:55
  • According to the latest comments on your blog post, it doesn't work on Linux Mint 18.2 Sonya. And I see the GitHub project hasn't been committed to since you wrote this answer over two years ago. I agree with @froage it would be great if this were integrated into Linux Mint, but it looks like that never happened. – Wildcard Dec 13 '17 at 7:17
1

This answer applies to Linux Mint 18.2 and onwards, although I've tested it only for 18.3.

A command line tool called mintupdate-tool is now included with the distribution. It's advertised in the 18.2 release notes as "This tool supports all the features available in the UI, including level selection, security updates, kernel updates and blacklisting". That "UI" refers to the Update Manager and that claim is a long way from being true, but it is a big step forward.

There's no man page for this tool, so:

$ mintupdate-tool --help
usage: mintupdate-tool [-h] [-k | -nk] [-s] [-r] [-d] [-y]
                       [--install-recommends] [-l LEVELS]
                       command

positional arguments:
  command               command to run (possible commands are: list, upgrade)

optional arguments:
  -h, --help            show this help message and exit
  -k, --kernel          ignore settings and include all kernel updates
  -nk, --no-kernel      ignore settings and exclude all kernel updates
  -s, --security        ignore settings and include all security updates
  -r, --refresh-cache   refresh the APT cache
  -d, --dry-run         simulation mode, don't upgrade anything
  -y, --yes             automatically answer yes to all questions
  --install-recommends  install recommended packages (use with caution)
  -l LEVELS, --levels LEVELS
                        ignore settings and restrict to this list of levels

The preferences from Update Manager determine the default behaviour. Those preferences are in the active user's dconf data store (schema com.linuxmint.updates), so prefacing the command with plain sudo does not change this. That is important because updates are not possible without root privileges.

Warning: There is no way to exclude security updates if including them is enabled in Update Manager preferences.

Option parsing for “--levels” is a bit sloppy and non-obvious. LEVELS is a string which is searched for the appearance of the digits 1 through 5. It is not a threshold or range. It also doesn't check for invalid characters, so "14", "1-4", "1,4", "4..1", and "two4u14me" all just mean levels 1 and 4 only.

To simply list the available updates that would be installed by default according to the user's Update Manager preferences, you probably want this:

$ mintupdate-tool -r list

You probably don't want the "-r" option in the following commands in order to avoid surprises.

To perform a dry run of what an actual update with this tool would do:

$ mintupdate-tool --dry-run upgrade

To actually do the same update we'd get if we used the Update Manager without modifying the displayed selections:

$ sudo mintupdate-tool upgrade

In my opinion, it is a significant oversight to not include an update type column for the "list" command as it appears in Update Manager and to provide no means to query an update's description or change log. My current example:

$ sudo mintupdate-tool -l 12345 list
4 package         mesa                                          17.2.4-0ubuntu1~16.04.4

That's a level 4 update called "mesa", which is not a package name so I cannot query it with any other command line tools that I know of. I know from Update Manager that this particular update actually includes 9 different packages, but that's cheating.

The source code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.