LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-05-2014, 05:01 PM   #1
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Unhappy Trouble with 'apt-get install'


I shot my own foot and need urgent help.
(No (blush) I didn't perform a backup before apt-get. I guess that my "luck" finally ran out.)

Is there some command, or set of commands that will ROLL-BACK the actions performed during 'apt-get install' ? When I say, "roll-back", I mean something like:
  • delete any files copied into folders
  • restore any files that were "replaced"
  • delete any files that were downloaded
  • restore any packages that were "removed" or "purged"
  • ... and so on
I've called myself reading the 'apt-*' man pages and I'm not finding anything that does what I think that I need. (Likely, I was in too much panic to read with proper attention.)

Though I've used sudo apt-get install {package} hundreds of times without trouble, this time it left me limping. During the processing of the command, it also did a huge number of operations that I didn't expect.
Code:
prompt$  sudo apt-get install {package}

...
remove {package}
remove {package}
remove {package}
...
remove {package}
remove {package}
remove {package}
...
<CTRL-C>
...
NOTE -- I have attached the full edition of '/var/log/apt/term.log' for your review

Thanks in advance,
~~~ 0;-Dan
Attached Files
File Type: log term.log (7.6 KB, 17 views)

Last edited by SaintDanBert; 03-05-2014 at 05:07 PM. Reason: clarification
 
Old 03-05-2014, 05:05 PM   #2
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
There is no rollback that I know of, unless you have a backup of your system. You were warned about the packages to be removed, but you probably didn't bother to read that section. You should be able to manually get things back, but it does require some effort.
 
Old 03-09-2014, 08:14 PM   #3
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Really!?! No "roll back"?!?
It appears that apt tracks all of the needed details to perform that function. I'm really surprised that it cannot do something.

I don't remember... does a distro install (Mint or Ubuntu) include a "repair" feature that will find the missing packages and put them back?

The package that I installed was skypeŽ. I had done this before for Mint-15, Mint-12, Mint-11, Ubuntu 10.04 and Ubuntu 8.04 without any grief or unexpected side effect. Yes, I told apt-get to --assume-yes like I've done before. Yes, I got burned.

Regards,
~~~ 0;-/ Dan
 
Old 03-09-2014, 10:27 PM   #4
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
No, there are no Linux distros that I know of that provide a "rollback" function. The only way to do that is to make a full snapshot of your system somewhere on your HDD, which can be reinstalled if necessary. Linux provides many backup tools, but none are automatic. In Linux, you, and you alone, are responsible for maintaining your computer. There is no nanny behind the scenes to hold your hand. You have the responsibility for making regular backups of your system, and there are lots of ways of automating that. You have to do it yourself, though. And as an aside, be really, really careful about using --assume-yes. There a many, many options in Linux that will get you into deep trouble, but they too are your responsibility for knowing about before you use them. Linux and Windows have widely divergent philosophies about users and how to treat them. Windows holds your hand, Linux assumes you know what you're doing and lets you do anything you please. Good, bad, or ugly, that's the way it is.
 
Old 03-10-2014, 12:33 AM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,673

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
Quote:
No, there are no Linux distros that I know of that provide a "rollback" function.
suse dose
BUT
you have to set it up before hand

and i have never tried it

fedora and yum has a option that can sort of undo things
but for apt ?????

i do not know
 
Old 03-10-2014, 02:21 AM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,

since those packages were removed, not purged (purging also removes config files), simply reinstalling them *should* restore your system.

Evo2.

PS. One of the big reasons that apt can't really do roll backs is because there is no guarantee that a specific version of a given package will still be available in the configured repos
 
Old 03-10-2014, 02:23 AM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
PPS. Eg.
Code:
apt-get install $(grep '^Removing' term.log | cut -f2 -d' ')
 
Old 03-10-2014, 06:46 PM   #8
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797

Original Poster
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by evo2 View Post
PPS. Eg.
Code:
apt-get install $(grep '^Removing' term.log | cut -f2 -d' ')
I tried doing this, albeit without 'grep', and every package that I tried to install reported a long list of dependents.
I would create a command:
Code:
prompt$ sudo apt-get install {package-1} {package-2} {package-3}\
    {package-4} {package-5} {package-6}   ... {package-N}
Where {package-x} was something chosen from the list of 'removed' packages.

At one point, when I managed to satisfy the dependencies, there was a new string of "to be removed" ... including 'libreoffice' (as an example).

Do I need to construct one, huge command that lists ALL of the "removed" packages, or similar, or is there some other way to restore what was "removed?"

To those who wagged a finger at my absent failsoft/failsafe copy of my system BEFORE running apt-get, I was lucky for long enough that I became complacent. Now (1) I'm working to recover, and (2) want to document things for anyone else who steps in the same tar pit.

Thanks in advance,
~~~ 0;-Dan
 
Old 03-10-2014, 07:28 PM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Hi,

why did you omit the grep?

Unless you post the full output I can't give specific advice, I can only suggest you start by removing skype, and then running "apt-get -f install" etc.

Quote:
Do I need to construct one, huge command that lists ALL of the "removed" packages, or similar
No, but that is one way, it is the way that I would do it, and is what I suggested in my previous post.

Quote:
or is there some other way to restore what was "removed?"
You could reinstall one package at a time.

Another option would be to set the dpkg desired status to install and then do an "apt-get deselect-upgrade". Eg
Code:
grep '^Removing' term.log | awk '{ printf "%s install\n", $2 }' | dpkg --set-selections
then
Code:
apt-get dselect-upgrade
Evo2.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apt-get has unmet dependencies, but apt-get -f install doesn't solve problem sophanox Linux - Software 1 02-23-2011 11:07 AM
Is there knoppix-like distro, that we can: apt-get update; apt-get install programs ? frenchn00b Linux - Distributions 7 04-28-2008 03:06 PM
LXer: Apt-get remove SUSE; apt-get install Etch LXer Syndicated Linux News 0 05-26-2007 08:46 PM
Question about 'apt-get upgrade' versus 'apt-get install' eur0dad Red Hat 8 07-16-2006 06:41 PM
knoppix 3.4 and no apt-setup how to fix info install apt-file + base-config maximalred Debian 0 10-16-2004 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration