31

If one of the users in our group tries to login to his desktop computer, he gets a popup "Authentication required to refresh system repositories". When I type in my administrator password in this popup, the popup does not disappear. It seems that only a hard reboot solves the problem temporarily, because after a few days the same popup appears again. When I login as a user with sudo privileges, though, everything works fine. The operating system is Ubuntu 19.10.

The user has no scripts running on startup, other than loading his bashrc and setting his environment variables.

I already searched the internet, but I have been unable to find a solution (I have done the most recent upgrades). I would really appreciate your help.

3
  • What do you mean by "When I (root) try to authenticate, nothing happens." - please describe in detail.
    – Hannu
    Dec 4, 2019 at 16:20
  • Welcome to Ask Ubuntu. Please edit your question and add the new information. Is this a desktop or server installation? Does the user have any applications or scripts that runs on login? When you login, are you using the username root or are you using an username with sudo privileges?
    – user68186
    Dec 4, 2019 at 16:22
  • Thanks Hannu and user68186, I've edited the question to answer your comments.
    – bruschino
    Dec 5, 2019 at 5:23

6 Answers 6

25

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
3
  • 3
    This answer looks great, but the OP is logging in locally (the same happens on my computer). Is there a way to adapt this answer for local users that aren't in the sudo group?
    – dcorking
    Mar 1, 2020 at 9:57
  • 4
    I would expect this to work for all users given the Identity=unix-user:*. I had a similar problem (along with the almost identical color profile issue) for local logins on Ubuntu 20.04 LTS. This fixed the problem for me. There's also an article that gives more detail, and even though it talks about xrdp seems to cover local logins (since it worked for me).
    – Phasmal
    Jul 10, 2020 at 22:04
  • I did it, nothing changes Sep 14, 2020 at 12:26
4

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

3

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.

1
  • The only workaround so far.
    – ks1322
    Nov 5, 2021 at 9:57
1

The basics

To "refresh system repositories"

sudo apt update

To install the updates found with the above

sudo apt upgrade

If you have logged in as root (e.g. have done sudo -i) then then sudo can be skipped in the above commands.


There will be updates available very much depending on which software you do install. For example www.freecad.org "daily", will give you a new freecad almost daily.

Whether these ACTUALLY requires a reboot depends entirely on WHAT there was to update; In practice, I find that to be the case (almost) only as the kernel was included in the update. Anything else may be something Ansible is responsible for.

Base Ubuntu will provide new versions of installed packages quite often; when you get NOTIFIED depends on the settings you have in

-> System settings (Cogwheel and Wrench icon in 16.04 launch bar)
-> Software & updates
-> Updates (tab)
-> Automatically check for updates: Daily, Every two days, ..., Never

As always: If you Never update, the system may stay stable for long, but only until some hacker find your machine to be vulnerable due to something you didn't update.

1
  • 4
    Thank you for your answer. I am using ansible to synchronize the tasks among all desktop computers and I have just updated last week. I am using the tasks "apt: update_cache", "apt: upgrade: dist" and "do-release-upgrade". This does not seem to solve the problem, at least for long. Or, to put it in other words, it is really annoying to do this every week, because this requires a restart every time. There are generally calculations running on the workstations which take a long time and which would die if I needed to upgrade every week.
    – bruschino
    Dec 5, 2019 at 5:27
1

I stumbled upon a workaround, which seems to work for our system, so that we do not need to update every week:

https://c-nergy.be/blog/?p=14051

(cf. Section "Fixing the issue the proper way...")

I have tried this a couple of days ago and we have not encountered any problems since then. I will keep you posted how the situation evolves.

1
  • 1
    I get this even when not logging in remotely, on my local desktop
    – teknopaul
    May 6, 2020 at 8:24
-1

I created a user account for a friend to try Ubuntu with no password and forced a password change upon login. I switched to the user account and then canceled since they were unavailable and this problem occurred. I think this issue might be due to the user password.

1
  • 1
    Hi @Greg, this issue is related primary to remote desktop connection to linux. It is very unlikely that the events you describe are caused by this problem. In case you would like to cancel your solution to this topic, you can safely delete this post and the points you lost with a negative rating will be returned to you.
    – Atiris
    Feb 2, 2021 at 6:56

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.