[Linux Mint] Linux System Maintenance Question
Hello,
I wanted to know some things regarding the maintenance of a Linux Mint system. More specifically, I do perform the updates for the operating system, but I wanted to know if there is anything else aside from those updates to properly maintain the system?
Best regards, Khandhai
6 réponses
Hello,
It would be good from time to time to clean up the system (every 1 or 2 months, for example).
From the terminal, type the following commands:
sudo apt autoremove
This command removes all packages that have become unnecessary due to software installations/uninstallations; furthermore, it removes kernels installed during updates that have become unnecessary and are slowing down the completion of updates. It keeps only the 2 most recent kernels.
sudo apt clean
This command clears the apt download cache, which over time can contain many packages downloaded during updates.
Also, remember to create an image of your system with timeshift before upgrading from one version to a higher version. For example, upgrading from Mint 22 to Mint 22.1. This image will allow you to revert to the previous system in case something goes wrong during the upgrade.
Hello,
In addition to jns55's response #1, especially if you are using methods other than APT to install software (snap, git, pip, manual installations...).
Before going further, I want to clarify that it is advisable to prefer APT installations whenever possible to ease system maintenance.
apt
If a software is installed via APT (which includes the software center, the apt, apt-get, and aptitude commands), you fall into this category.
I will restate and complete jns55's response #1.
# Update sudo apt update sudo apt upgrade # Clean up unused packages sudo apt autoremove # Clean up APT cache sudo apt clean
Note that when you uninstall a software, there is also a distinction between apt remove and apt purge: any files created in /etc are not deleted by apt remove, unlike apt purge. APT keeps track of this information:
dpkg -l
- Lines starting with "ii" correspond to installed packages.
- Lines starting with "rc" correspond to removed but not purged packages.
You can remove all "rc" packages (remove but configured) with the command:
sudo apt purge $(dpkg -l | grep ^rc | cut -d" " -f3)
You can also use deborphan to remove orphaned packages.
sudo apt purge $(deborphan)
I invite you to repeat this last command until it no longer removes anything, as removing an orphaned package can trigger the appearance of other orphaned packages.
dpkg
If a package has been installed via dpkg but not APT (for example, you retrieved and manually installed a ".deb" file), it is not updated by APT but can be removed by APT. Note that a package installed this way can add APT repositories (see /etc/apt/sources.list.d).
This is the case for Skype, for example. If you install the Skype package, the corresponding repository is added to the APT configuration, and it can then be installed or updated like any package from the official repositories. If you no longer wish to use said repository, it is sufficient to remove the repository in question from /etc/apt/sources.list.d.
Other package managers (snap, pip, ...)
If a software is installed via a third-party package manager other than APT (for example PIP, snap), these systems have their own update and cache management mechanisms. This data is neither updated nor removed by APT.
If this package manager has been used by root, the installed files reside in folders such as /usr/local/lib, /var/snap.
Otherwise, the files in question reside in a hidden folder in the home directory (noted ~, for example /home/toto) of the user who installed them (for example ~/.local/lib/ for PIP).
Manual installations
If you install software other than via a package manager, they inherently evade your package managers and must be managed manually. This is, for example, the case if you retrieve an archive (.zip, .tgz, .tar.bz2, ...) containing software.
Good luck
Hello again,
On Linux Mint, is there a protection system for the apts that we use as a command in the terminal? I remember once trying it with a distribution, and it removed much more… I find that Linux Mint is more than protected against this kind of removal, don't you think?
For other package managers, do they uninstall using commands like dpk or other package managers?
I was wondering, regarding the default sound manager with Linux Mint, if there is a better application than the one installed by default (sound cinnamon org)
Thank you for your time and advice.
In response to #3
On Linux Mint, is there a protection system for the apts that we use as a command in the terminal?
In APT (whether it's Debian, Ubuntu, Mint...), packages are signed. A set of signatures is pre-installed in APT with the system (see *-keyring packages). If a package is not signed by such a key, APT will complain. It is possible to enrich the set of accepted signatures by APT (formerly, we used apt-key).
Using APT via command lines (apt, dpkg, aptitude, apt-get...) or through a graphical interface (discover...) comes to the same thing.
Once, I remember trying it with a distribution, and it removed much more… I find that Linux Mint regarding this removal is more than protected, I think (?)
I don't know what protection you're talking about. When you install a package, it is marked as explicitly installed. The dependencies required for its installation are marked as automatically installed.
Furthermore, when you install Mint for the first time, the installer explicitly installs a certain number of packages.
The apt autoremove command removes all automatically installed packages that are not required by any explicitly installed package. Sometimes certain automatically installed and obsolete packages slip through the cracks. We can then use deborphan.
For other package managers, does it uninstall using commands like denominators dpkg, other package managers?
- dpkg has no intelligence: it just checks if a ".deb" file can be deployed based on the packages already installed in the APT database. If so, it deploys the package and records it as installed in terms of APT.
- A command like apt, apt-get, or aptitude checks for each installed package the appropriate repository, downloads any missing dependencies (and so on recursively), and then orchestrates dpkg to install each package in the appropriate order.
- Any other way of installing software does not involve one of these commands and does not alter the APT database. In other words, they completely escape APT (updates, removals, ...). This includes all software installed via pip, snap, manual downloading of an archive (not a debian package), etc.
I was wondering, regarding the default sound manager with Linux Mint, if there is a better application than the one installed by default (sound cinnamon org)
I don't know "sound cinnamon org" but given the name, I doubt it's a package manager. I think it's more likely to be synaptic or similar software.
Good evening,
To sum it up, I uninstalled a program and it uninstalled more than it should have. So I ended up with bugs and other problems with apt remove.
As for "sound cinnamon org," it's a default application for managing the sound of different applications, sound, etc...
With VLC the sound is low, even at 100%, and with another application the sound is properly at 100% so...
Hello,
To summarize in response to you, I uninstalled a program and it uninstalled more than it should have. So I ended up with bugs and other issues with apt remove.
If uninstalling a program led to the removal of other packages, it means that no other explicitly installed package depended on it. We should check which packages were removed and what the bugs you mentioned are to clarify things...
For "sound cinnamon org," it's a default application for managing the sound of different applications, etc...
Okay, I assume it's some kind of mixer.
With VLC the sound is low, even at 100%, and with another application the sound is properly at 100%, so...
This isn't necessarily a bug. You can adjust the sound for each application with pavucontrol, and probably with "sound cinnamon org."
sudo apt update sudo apt install pavucontrol pavucontrol &
Good luck