Score:0

I accidentally ran "apt install gnome", how can I revert it without uninstalling stuff that I need?

in flag

I wanted to install a package that started with gnome- and accidentally ran apt install gnome. As soon as I realized my mistake I canceled the installation using ctrl+z.
How can I check if anything has been installed/changed and revert this without breaking the system?
I am running Ubuntu 22.04 LTS.

Gasp0de avatar
in flag
There is a log entry in history that lists a number of packages, and the term.log is the output of apt. I cancelled it at the stage where it said "Selecting previously unselected package XYZ" "Unpacking XYZ". Are all those "previously unselected packages" safe to remove? I am afraid to remove packages that I had previously, just not manually installed
user535733 avatar
cn flag
Keep reading: Apt logs as it works; it does not summarize. Your question might be answered on the next line or two. You will figure it out.
Score:3
cn flag

Apt logs deb packages installs and removals.

See the following logfiles to discover what package changes (if any) were made:

/var/log/apt/history.log
/var/log/apt/term.log 

If you discover that packages were installed that you don't want, simply use apt to remove them.

sudo apt remove package1 package2 package3 package4 packageN
Gasp0de avatar
in flag
How can I make sure that none of these were installed before I ran this command? I am afraid that I may have had some packages before (but maybe marked as a dependency and not manually installed) and that I will break my system by removing them. I am already getting error messages on boot (contacts not working, clocks not working) although so far I have done nothing except for cancelling the installation.
user535733 avatar
cn flag
"*I am afraid that...I will break my system by removing them*" Then read your apt output before agreeing to any removals. If the output includes important applications or is very lengthy, then simply tell apt "No". Advice: ALWAYS read your apt output before agreeing -- doing so will save you much grief.
Gasp0de avatar
in flag
That is what I should have done in the first place. Obviously I will now read carefully what I remove, but how do I know what's part of gnome(-core) and what belongs to Ubuntu-Desktop (which is also gnome)?
mook765 avatar
cn flag
@Gasp0de If a package had been installed before you ran `apt install gnome` it was not installed again and therefor does not appear in the logs from that command.
Gasp0de avatar
in flag
Alright, thanks
user535733 avatar
cn flag
"*how do I know what's part of gnome(-core) and what belongs to Ubuntu-Desktop*" Apt will tell you in the output. It won't say so in those terms, but you will understand that if apt offers to remove `ubuntu-desktop` now you know and can refuse the offer.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.