"Authentication required to refresh system repositories" in Ubuntu 19.10

Solution 1:

This happens when using xRDP (remote sessions or Hyper-V enhanced sessions) into Ubuntu. The remote sessions are more restrictive than local sessions for the same user, and this fixes it.

For Ubuntu 19.10, do this in a terminal

sudo bash
cd /etc/polkit-1/localauthority/50-local.d
nano 46-allow-update-repo.pkla

and then put this inside the file

[Allow Package Management all Users]
Identity=unix-user:*
Action=org.freedesktop.packagekit.system-sources-refresh
ResultAny=yes
ResultInactive=yes
ResultActive=yes

Solution 2:

Not a solution to the root cause, but I have the same problem and can avoid the hard reboot by clicking maybe a hundred times on cancel in this box (I didn't actually counted). The box ends up disappearing.

Solution 3:

On Debian my way of fixing was by adding the user to the adm and sudo group.

sudo usermod -a -G adm <username>
sudo usermod -a -G sudo <username>

After adding the to these groups it showed my username instead of Administrator