When I install something using apt it tells me that “The following packages were automatically installed and are no longer required:” Then 320 packages that look like most of my install followed by “Use ‘sudo apt autoremove’ to remove them.”
Not sure how I got into this situation or how to rectify it…
autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed as dependencies changed or the package(s) needing them were removed in the meantime. You should check that the list does not include applications you have grown to like even though they were once installed just as a dependency of another package. You can mark such a package as manually installed by using apt-mark(8). Packages which you have installed explicitly via install are also never proposed for automatic removal.
You’ll also find varies questions on sites that also describe it (eg. here.
You’ll have no negative consequences to your system if you’re only using official or well managed repositories for your software. Problems occur only with 3rd party sources that tend to be lazy and don’t package for a specific release creating one repository that can be used by multiple OSes or releases.
In your case; I’d go to terminal and type in
sudo apt autoremove
and then scan the packages that are listed; I’d expect I’d know why they are there, or where they came from (I review any sources I add to my system before I add them). If I was unsure of any, I’d not let the removal of packages occur (ie. it asks for permission first; I don’t give it) and explore why they’re being listed before I proceeded.
You didn’t provide a list of these packages, as this with release detail is required to review in my opinion.
Personally, I perform package upgrades three times per day, and the full-upgrade I use is always followed by an apt autoremove and apt autoclean as I don’t want packages to accumulate waiting for removal; as I may not remember why they’re there (with 320 in your queue, either you never run it, or you’ve added a bad source to your system I suspect, but I’m guessing based only on what you provided).
FYI: to view the manual page on your system, use man apt
Thanks for that. I’m actually using 22.04. Below is the output from sudo apt autoremove… I’m thinking I’d destroy my installation if I removed that lot!
Well that’s strange. Looking through my the installation history in the Muon package manager I noticed that the metapackage “Lubuntu desktop” had been removed on the 7th October. I certainly wouldn’t have done that…
Anyway, reinstalling that metapackage seems to have solved the problem. I now only have 3 files to remove via autoremove.
I’ll report on what I’d do in your shoes, but sorry I don’t use Muon beyond testing it to ensure it works (my preference is terminal, and if I want a package manager it’s aptitude for me usually)
I’d explore your apt package logs, me I’d likely use the command
view /var/log/apt/history.log
If you’re not familiar with unix/POSIX searching (or vi / vim which uses it too) you’ll be out of place here, but I’d type something like
/lubuntu-desktop
to search for “lubuntu-desktop” and possibly press ‘enter’ IF it didn’t find the one I wanted so I could hit N to jump to the next reference in the log. You’ve already got a date, which will help find the entry you’re looking for.
The reason I’d look at these logs is I’d want to explore the reason/command that caused the removal of the package, was it because you’d installed a 3rd party package that conflicted which apt resolved by removing lubuntu-desktop as a solution? or just a careless mistake was made (we all make them!). I’d like to find the reason, or possible reason before I ignored it. This method will largely present the detail in a more complete manner (in my opinion anyway)
If your situation is solved, none of this matters. I opened muon and had a look and it concentrates of package versions without all details. Maybe what I provided will be of benefit.
Not sure why it wanted to remove ntfs-3g ( I reinstalled it). The only things outside of the repo I installed were Eddie ( Openvpn gui prog) and Spideroak (Cloud server) I was fiddling with a terminal prog called scrcpy (Copies android phone screen via usb to display) the day before but thats in the repo. Seems to be a lot of ‘fuse’ activity. Different versions etc…
Anyway, everything seems to be working fine. Thanks for your help.
I run into this exact same situation if I remove any application that comes with Lubuntu by default. For instance, I used to remove the Bluetooth stack on my systems pretty much all the time, which led to the mess you’re describing. I’m not exactly sure what package you uninstalled, but that’s almost certainly how you got there.