What is the command-line equivalent to ‘mintupdate’ for Linux Mint?

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.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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.

Method 2

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.

Method 3

On Mint 19, there’s a mintupdate-cli tool which has the same functions of GUI version mintupdate.
Get the usage with its -h option.

However I didn’t find its manpage (with man mintupdate-cli).
So I can’t find its source codes and authors from the application itself.
While after some searches, looks like it’s part of the mintupdate project:

https://github.com/linuxmint/mintupdate/blob/master/usr/lib/linuxmint/mintUpdate/mintupdate-cli.py


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x