How Can I Automate Update Settings on Linux Mint?

0
9
Asked By CuriousCoder77 On

I'm working on a shell script to harden my Linux Mint 21 installation, and I want to automate some update settings. Specifically, I want to set the refresh interval for updates to daily, enable automatic updates, and enable the removal of obsolete kernels and dependencies. While I know I can easily change these settings in the Update Manager, I'm looking for a way to automate everything. I believe the settings are stored in dconf, so I tried the following bash script:

```bash
#!/bin/bash

# Linux Mint Update Manager Settings Script

# Set the refresh interval to daily (1 day = 1440 minutes)
dconf write /com/linuxmint/updates/refresh-minutes 1440

# Enable automatic updates
dconf write /com/linuxmint/updates/auto-update true

# Enable automatic removal of obsolete kernels
dconf write /com/linuxmint/updates/remove-obsolete-kernels true
```

I used `dconf read` to confirm that the changes were applied, but the Update Manager GUI doesn't reflect these changes. Am I missing something?

4 Answers

Answered By BashNewbie7 On

This seems a bit off-topic for bash discussions. There are better places for these specific automation queries!

Answered By TechWhiz42 On

You might want to consider using `apt-get` for automation instead of the GUI updater. It's more suited for scripting tasks like this and can streamline the whole process for you.

Answered By ScriptGuru91 On

If you’re open to it, I’d suggest using a tool like Ansible instead of writing bash scripts. Ansible is great for automating these kinds of tasks and can save you a lot of time.

Answered By AutomateEverything99 On

You could just add your bash scripts or the update command to cron jobs. That way, they run automatically at scheduled intervals without you needing to touch anything.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.