How can you prevent other important components from being uninstalled when removing packages?
Is there a setting to prevent the removal of packages which are dependencies for other packages?
Probably it makes no sense to set all pre-installed packages to manually installed, or?
Instead of purge, You can use remove. That would adree only the actual Program and remove it. But of Course, You have to check the Packages that will be removed, too.
That's really difficult. No one knows all the packages by name. I understand now why some people recommend reinstalling with every major release, because by then the system is probably broken, and why immutable distributions are becoming more popular.
To me it seems keeping all apps which you no longer need is more safe than removing.
I wouldn't agree here. Yes, checking is important for Dependencies and their Relation. But that doesn't mean that You can break Your System with every Program that You uninstall.
It is better to seperate here 2 Things: System Programs and the Rest. When You have System Programs like Nautilus and Stuff like that, that belongs to the Gnome Desktop and You want remove it, You should definetely check when You uninstall one of these the Dependencies.
But let's take something like Brave or Firefox for Example. When You uninstall them normally, You don't break Your System.
We could open a 3rd Category: Core System Components. To that belong Stuff like the Kernel, Libraries or the Desktop itself. So, gnome or gnome-shell and related Stuff. That is Stuff with that You shouldn't play in any Way except there are very specific Reasons for that make it neccessary.
I make a fresh Install with every Major Release, too. But that is because so I can start with a new blank Sheet of Paper. That the System gets broken when You make an Upgrade can be a Risk. I mean to upgrade all the Packages can lead to Issues when there might be Dependencies that have suddenly a different Version for Example. Or the Desktop Environment Version jumps a couple of Numbers up and would bring new Stuff and Stuff gets abandoned what might be needed from an installed Program etc.
You can handle it maybe with Effort and Time. But I'm more a lazy Guy. So, I save my Data, then make a fresh Install, set it up and copy my Data back. I find that easier.
I'm asking because I found it difficult to uninstall some programs, and even after reversing the "install" to "remove" commands, I still had a lot of leftover files on the system. This was the case with Pinta, which kept crashing in Zorin 17. Since I’d read that adding the Mono runtime to the system might help, I did so - it was quite a few hundreds megabytes, but it didn't help with pinta, so I tried to remove it. Afterward, I still found folders with “Mono” in many places throughout the system.
Since it’s not a graphical app, you can’t uninstall something like that via GNOME Software. But I’m afraid of causing damage by doing things like that - for example, I manually deleted some Mono folders that I came across.
This is why I prefer Synaptic Package Manager. You can see right away if you intend to remove something it will indicate what other packages are going to be removed. If it is going to create major implications, the little box to the left of critical packages turns red.
When an autoremove Command not show it, then You could try something like Bleach Bit or Ubuntu Cleaner.
It can happen that Folders can be left. Sometimes, You can see it in an Uninstall Process. Normally, You get a Note that the Folder will not be deleted because it isn't empty. Or a Folder doesn't get affected when You uninstall something.
For Stuff like that, the mentioned above Programs could help more. Sure: Use them with Caution, too.
Hm, it seems as there were still many packages on my system when I ran apt list -i | grep mono. I tried to remove all mono packages except the fonts with mono in the name. Was this right or does this damage something?
Commandline: apt purge mono-runtime-common
Requested-By: ... (1000)
Purge: libmono-sqlite4.0-cil:amd64 (6.8.0.105+dfsg-3.2), mono-mcs:amd64 (6.8.0.105+dfsg-3.2), libmono-system-transactions4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-http-webhost4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libnunit-cil-dev:amd64 (2.6.4+dfsg-1.1), libmono-system-reactive-core2.2-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-webpages-razor2.0-cil:amd64 (6.8.0.105+dfsg-3.2), mono-runtime:amd64 (6.8.0.105+dfsg-3.2), libmono-system-configuration-install4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-abstractions4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-routing4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-data-linq4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-servicemodel-activation4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-runtime-durableinstancing4.0-cil:amd64 (6.8.0.105+dfsg-3.2), mono-devel:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-mobile4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-microsoft-build-framework4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-windows-forms4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-data-entity4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-parallel4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-componentmodel-dataannotations4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-applicationservices4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-security4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-xaml4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-webpages2.0-cil:amd64 (6.8.0.105+dfsg-3.2), mono-runtime-sgen:amd64 (6.8.0.105+dfsg-3.2), libmono-system-servicemodel-internals0.0-cil:amd64 (6.8.0.105+dfsg-3.2), ca-certificates-mono:amd64 (6.8.0.105+dfsg-3.2), libmono-system-reactive-linq2.2-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-reactive-debugger2.2-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-reactive-windows-forms2.2-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-reactive-providers2.2-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-data-datasetextensions4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-configuration4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-webpages-deployment2.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-runtime-serialization4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-posix4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-identitymodel4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-csharp4.0c-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-messaging-rabbitmq4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-ldap4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-microsoft-csharp4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-management4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-regularexpressions4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-json4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-messaging4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-runtime4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-db2-1.0-cil:amd64 (6.8.0.105+dfsg-3.2), libnunit-console-runner2.6.3-cil:amd64 (2.6.4+dfsg-1.1), libmono-system-reactive-experimental2.2-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-servicemodel4.0a-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-windows-forms-datavisualization4.0a-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-componentmodel-composition4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-deployment4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-reactive-platformservices2.2-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-servicemodel-discovery4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libnunit-mocks2.6.3-cil:amd64 (2.6.4+dfsg-1.1), libmono-system-reactive-runtime-remoting2.2-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-cairo4.0-cil:amd64 (6.8.0.105+dfsg-3.2), mono-4.0-gac:amd64 (6.8.0.105+dfsg-3.2), libmono-system-reactive-observable-aliases0.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-reactive-windows-threading2.2-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-debugger-soft4.0a-cil:amd64 (6.8.0.105+dfsg-3.2), libnunit-framework2.6.3-cil:amd64 (2.6.4+dfsg-1.1), libmono-windowsbase4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-simd4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-i18n4.0-all:amd64 (6.8.0.105+dfsg-3.2), libmono-system-data4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-i18n4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-tasklets4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-relaxng4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-ldap4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-xbuild-tasks4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-reactive-interfaces2.2-cil:amd64 (6.8.0.105+dfsg-3.2), mono-csharp-shell:amd64 (6.8.0.105+dfsg-3.2), libmono-system-dynamic4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-net-http4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-net-http-webrequest4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libnunit-core-interfaces2.6.3-cil:amd64 (2.6.4+dfsg-1.1), libmono-system-design4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-windows4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-sharpzip4.84-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-cecil-private-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-management4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-compilerservices-symbolwriter4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-enterpriseservices4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-accessibility4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-json-microsoft4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-corlib4.5-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-drawing4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-extensions4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-workflow-componentmodel4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-codecontracts4.0-cil:amd64 (6.8.0.105+dfsg-3.2), mono-xbuild:amd64 (6.8.0.105+dfsg-3.2), libmono-system-drawing-design4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-i18n-other4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-i18n-rare4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-core4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-ldap-protocols4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-microsoft-build-utilities-v4.0-4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-i18n-mideast4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-microsoft-build-engine4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-extensions-design4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-microsoft-visualc10.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-identitymodel-selectors4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-workflow-runtime4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-http4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-webbrowser4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-services4.0-cil:amd64 (6.8.0.105+dfsg-3.2), mono-runtime-common:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-dynamicdata4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-numerics-vectors4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-cscompmgd0.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-razor2.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-cil-dev:amd64 (6.8.0.105+dfsg-3.2), libmono-rabbitmq4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-net-http-formatting4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-web-mvc3.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-io-compression-filesystem4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-xml-linq4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-http4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-workflow-activities4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-threading-tasks-dataflow4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-data-services-client4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-servicemodel-routing4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-oracle4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-peapi4.0a-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-security4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-reflection-context4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libnunit-core2.6.3-cil:amd64 (2.6.4+dfsg-1.1), libmono-system-web-http-selfhost4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-custommarshalers4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-i18n-west4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-smdiagnostics0.0-cil:amd64 (6.8.0.105+dfsg-3.2), libnunit-util2.6.3-cil:amd64 (2.6.4+dfsg-1.1), libmono-microsoft-web-infrastructure1.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-xml-serialization4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-serviceprocess4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-xml4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-servicemodel-web4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-runtime-caching4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-data-tds4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-data-services4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-webmatrix-data4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-microsoft-build4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-net4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-microsoft-build-tasks-v4.0-4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-messaging4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-i18n-cjk4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-system-io-compression4.0-cil:amd64 (6.8.0.105+dfsg-3.2), mono-gac:amd64 (6.8.0.105+dfsg-3.2), libmono-system-runtime-serialization-formatters-soap4.0-cil:amd64 (6.8.0.105+dfsg-3.2)
End-Date: 2026-08-08 17:46:23
Start-Date: 2026-08-08 17:53:29
Commandline: /usr/sbin/synaptic
Requested-By: ...(1000)
Remove: libmonosgen-2.0-dev:amd64 (6.8.0.105+dfsg-3.2), libmono-system-numerics4.0-cil:amd64 (6.8.0.105+dfsg-3.2)
Purge: libmono-2.0-dev:amd64 (6.8.0.105+dfsg-3.2), libmonosgen-2.0-1:amd64 (6.8.0.105+dfsg-3.2), libmono-btls-interface4.0-cil:amd64 (6.8.0.105+dfsg-3.2), libmono-corlib4.5-dll:amd64 (6.8.0.105+dfsg-3.2)
I got errors during the uninstallation and wanted to make a screenshot and save the terminal output, but by mistake I closed the terminal so that I can't show you.
Edit: Ah, now I found the error messages in the file /var/log/apt/term.log. It were many messages (~15), similar to this one:
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: System.Native assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
at Interop+Sys..cctor () [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
--- End of inner exception stack trace ---
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x0000f] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath) [0x00006] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.File.Exists (System.String path) [0x00058] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at Mono.Tools.Driver.LoadConfig (System.Boolean quiet) [0x00031] in <3c116a3f551b47a09422f1ef7e2033f8>:0
at Mono.Tools.Driver.Main (System.String[] args) [0x00347] in <3c116a3f551b47a09422f1ef7e2033f8>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'Sys' threw an exception. ---> System.DllNotFoundException: System.Native assembly:<unknown assembly> type:<unknown type> member:(null)
at (wrapper managed-to-native) Interop+Sys.LChflagsCanSetHiddenFlag()
at Interop+Sys..cctor () [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
--- End of inner exception stack trace ---
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath, System.Int32 fileType, Interop+ErrorInfo& errorInfo) [0x0000f] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.FileSystem.FileExists (System.ReadOnlySpan`1[T] fullPath) [0x00006] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at System.IO.File.Exists (System.String path) [0x00058] in <12b418a7818c4ca0893feeaaf67f1e7f>:0
at Mono.Tools.Driver.LoadConfig (System.Boolean quiet) [0x00031] in <3c116a3f551b47a09422f1ef7e2033f8>:0
at Mono.Tools.Driver.Main (System.String[] args) [0x00347] in <3c116a3f551b47a09422f1ef7e2033f8>:0
W: removing assembly: nunit.mocks, Version=2.6.4.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77 failed!
Did You do that in a Live Session?
No, on my Zorin 17 Lite system (bare-metal).
My guess would be that the Leftovers built an Error because it were Leftovers.
Or is the error because I removed some mono folders (I don't remember where they were saved, I think I removed some from my home directory) or have removed other mono packages some months ago? I'm not sure if everything is uninstalled now. When I run the apt list command, the mono packages are no longer shown.
In my .~/.config folder is still a folder named "mono.addins".
Is something in the Folder?
Yes, two folders "addin-db-001" and "repository-cache", and a file "addins-setup.config". When I would try to reinstall mono-addins-utils to purge it afterwards, the entire mono-runtimes would be installed again. I think, that wouldn't really help.
Can I remove it by rightclicking on the folder? It seems to be an addin for pinta.
I think, You can delete it. Or, You could test with adding .bak at the Folder Name End and see if something behaves weird. When all is good, You can delete the whole Stuff.