1

Since apt-key is now deprecated, I have exported and copied all of my package keys to the gpg folder and updated the corresponding /sources.list.d/* accordingly by adding the [signed-by=/usr/share/keyrings/<relevent_key_file>.gpg] field.

However, after every reboot, something is effectively undoing this change for Slack by re-adding its key to apt-key and deleting the signed-by from its /sources.list.d/slack.list. I know this because when I perform $ sudo apt-get update, I see the following output:

W: https://packagecloud.io/slacktechnologies/slack/debian/dists/jessie/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

This forces me to re-do all of my work. How do I stop either Slack, or whatever process responsible, from doing this?

1 Answer 1

0

I've been facing this myself, it's indeed annoying. I didn't find a perfect solution, but I did find a workaround: make the slack.list repo file (after adding signed-by entry to it) immutable:

sudo chattr +i /etc/apt/sources.list.d/slack.list 

The biggest inconvenience here is that add-apt-repository fails with an error due to this immutability:

$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test PPA publishes dbgsym, you may need to include 'main/debug' component Repository: 'deb https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu/ lunar main' Description: Toolchain test builds; see https://wiki.ubuntu.com/ToolChain More info: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test Adding repository. Press [ENTER] to continue or Ctrl-c to cancel. Adding deb entry to /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-lunar.list Adding disabled deb-src entry to /etc/apt/sources.list.d/ubuntu-toolchain-r-ubuntu-test-lunar.list Traceback (most recent call last): File "/usr/bin/add-apt-repository", line 362, in <module> sys.exit(0 if addaptrepo.main() else 1) ^^^^^^^^^^^^^^^^^ File "/usr/bin/add-apt-repository", line 355, in main shortcut.add() File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 221, in add self.add_source() File "/usr/lib/python3/dist-packages/softwareproperties/shortcuthandler.py", line 307, in add_source sourceslist.save() File "/usr/lib/python3/dist-packages/softwareproperties/extendedsourceslist.py", line 391, in save with open(filename, "w") as f: ^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 1] Operation not permitted: '/etc/apt/sources.list.d/slack.list' 

So if you have such an error, just make slack.list mutable again, run add-apt-repository, and back to immutable:

sudo chattr -i /etc/apt/sources.list.d/slack.list sudo add-apt-repositor <smth> sudo chattr +i /etc/apt/sources.list.d/slack.list 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.