Score:1

Crontab permission not permitted after upgrade

mc flag
ARJ

I have upgraded Ubuntu from 20.04 to 22.04 but the upgrade doesn't seem to have completed successfully. When I try to install a new package, as an example: sudo apt install virtualenv I get the following error:

Do you want to continue? [Y/n] y
Setting up cron (3.0pl1-137ubuntu3) ...
Installing new version of config file /etc/crontab ...
dpkg: error processing package cron (--configure):
 unable to install '/etc/crontab.dpkg-new' as '/etc/crontab': Operation not permitted
Errors were encountered while processing:
 cron
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

Regardless of package this error appears. I have followed other questions and checked permissions in /etc/cron.d, root has access to all, I can even create a new cron job and trigger it however when it comes to installing new packages the error still persists. I have checked systemctl and cron service is active and running just fine.

● cron.service - Regular background program processing daemon
     Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2023-02-15 14:56:10 UTC; 17min ago
       Docs: man:cron(8)
   Main PID: 59355 (cron)
      Tasks: 185 (limit: 18962)
     Memory: 114.7M
        CPU: 317ms
     CGroup: /system.slice/cron.service

What could have gone wrong during the installation for this issue to occur?


Update:

The issue still remains however I've noticed a change after @steelworker and @jos recommendations. Now when I try to install there error is a different error:

Do you want to continue? [Y/n] y
Setting up cron (3.0pl1-137ubuntu3) ...
chown: changing ownership of '/var/spool/cron/crontabs': 
Operation not permitted
dpkg: error processing package cron (--configure):
installed cron package post-installation script subprocess 
returned error exit status 1
Errors were encountered while processing:

When executing sudo ls -la /var/spool/cron/crontabs this is the result:

total 12
drwx-wx--T 2 root crontab 4096 Nov 14  2021 .
drwxr-xr-x 5 root root    4096 Oct 26  2020 ..
-rw------- 1 git  crontab  250 Nov 14  2021 git

and one level up this is returned:

drwxr-xr-x 5 root   root    4096 Oct 26  2020 .
drwxr-xr-x 4 root   root    4096 Oct 26  2020 ..
drwxrwx--T 2 daemon daemon  4096 Oct 26  2020 atjobs
drwxrwx--T 2 daemon daemon  4096 Nov 12  2018 atspool
drwx-wx--T 2 root   crontab 4096 Nov 14  2021 crontabs
ru flag
**Comments have been [moved to chat](https://chat.stackexchange.com/rooms/142936/discussion-on-question-by-arj-crontab-permission-not-permitted-after-upgrade); please do not continue the discussion here.** Before posting a comment below this one, please review the [purposes of comments](/help/privileges/comment). Comments that do not request clarification or suggest improvements usually belong as an [answer](/help/how-to-answer), on [meta], or in [chat]. Comments continuing discussion may be removed.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.