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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-05-2014, 05:01 PM
|
#1
|
Senior Member
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Rep: 
|
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
Last edited by SaintDanBert; 03-05-2014 at 05:07 PM.
Reason: clarification
|
|
|
03-05-2014, 05:05 PM
|
#2
|
Senior Member
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943
|
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.
|
|
|
03-09-2014, 08:14 PM
|
#3
|
Senior Member
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Original Poster
Rep: 
|
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
|
|
|
03-09-2014, 10:27 PM
|
#4
|
Senior Member
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943
|
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.
|
|
|
03-10-2014, 12:33 AM
|
#5
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,673
|
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
|
|
|
03-10-2014, 02:21 AM
|
#6
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
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
|
|
|
03-10-2014, 02:23 AM
|
#7
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
PPS. Eg.
Code:
apt-get install $(grep '^Removing' term.log | cut -f2 -d' ')
|
|
|
03-10-2014, 06:46 PM
|
#8
|
Senior Member
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint v21.3 & v22.x with Cinnamon
Posts: 1,797
Original Poster
Rep: 
|
Quote:
Originally Posted by evo2
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
|
|
|
03-10-2014, 07:28 PM
|
#9
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
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.
|
|
|
All times are GMT -5. The time now is 08:02 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|