Note: If a second argument is provided, the script will interpret it as seconds before and after the reference file's Change time otherwise 10 seconds is assumed. Increase the value if you think some files may have been missed. Decrease it if you feel that too many files were found.
Before removing anything, you might want to make a backup of the matched files. You can do this by piping the result to an archiver like cpio or tar with appropriate options. For a very old distribution with a version of GNU find that precedes version 4. RHEL 5 use the following:.
For a distribution that does not use GNU find and understands neither -newerct nor -cnewer e. Or for something quicker but potentially less reliable , here is a version using mtime with a 3 minute resolution window around the reference file:. Rather than attempting to find files associated with a package some time in the future, you should instead make the log immediately after you first installed the software. This is safer because you will have a valid log even if a Change timestamp on some file s gets altered in the future intentionally or by acident.
Just run the script right after make install completes and redirect the output to a file. An even better way to make a log is to do it before you install. That way you can be certain that the log only contains files that you have placed onto the system.
You will need a little knowledge of Linux packaging to pull this one off— if you have a lot of packaging knowledge, step up and make a real package, since that is an even better idea. Rather than the typical. To do this, first you need to review the yum transactions history by running the following command as root user, otherwise use the sudo command to gain root privileges.
From the output in the screenshot above, the yum history shows you the transaction ID, the command line, date and time, action and more. To undo a yum install , take note of the transaction ID , and perform the required action. To redo a yum install, as before, take note of the transaction ID , and run it. For instance to redo the install with ID 63 , run the the following command. The most important thing to note is the transaction ID of an yum install or yum remove action.
Share your thoughts with us via the comment form below. If that serves to indicate autoremoval that's good. OP should have no problems then. Show 8 more comments. When you want to remove a package and its dependencies that installed at the time, you should use: sudo apt-get purge package sudo apt-get --purge autoremove but to undo apt actions, you can use apt-undo script.
Eliah Kagan k 51 51 gold badges silver badges bronze badges. Ramin Ramin 1, 8 8 silver badges 8 8 bronze badges. Thanks, I came across this, and it sounded like exactly what the doctor ordered, until I saw the caveat that I needed to use it to install, to be able to undo.. Nice catch. Very confusing syntax, though. And I really don't like to use alternatives to well-tested core APT application. Add a comment. Robie Basak Robie Basak Nice script, but it should really be just sequence of commands people can remember to accomplish it.
Thanks, intimidating script, but I was afraid it would come down to this — Karthik T. I used very similar code to solve my very similar problem.
I did it in several steps just to be more sure about what was happening. Execute sudo apt-get remove [paste the contents of the clipboard here] Done. Insperatus Insperatus 4, 5 5 gold badges 23 23 silver badges 40 40 bronze badges.
K 23 3 3 bronze badges. Ken Kinder Ken Kinder 3, 2 2 gold badges 22 22 silver badges 37 37 bronze badges. Thanks, but autoremove proved to be insufficient in this case.
Please see my edit. Follow the sudo apt-get purge packagename with sudo apt-get autoremove. Unless it's metapackage this should take care of it. Thank you for the FAQ link, very useful! Some of those packages may be needed by other things and not marked as able to be autoremoved.
Did you look at the instructions at the link? How are those? The instructions on the link are rather orthogonal to the core issue, and as it is, I am leaning towards reinstalling my system. Rolf Rolf 1, 12 12 silver badges 11 11 bronze badges. To completely undo the Unity 8 installation I issued the followings: sudo apt-get purge unity8-desktop-session-mir sudo apt-get --purge autoremove sudo apt-get install python3-aptdaemon. Set the Stack instance to use as the undo stack.
An undo stack. The two key features are the redo and undo methods. If an exception occurs during doing or undoing a undoable, the undoable aborts and the stack is cleared to avoid any further data corruption. The stack provides two properties for tracking actions: docallback and undocallback.
Each of these allow a callback function to be set which is called when an action is done or undone repectively. By default, they do nothing.
Setting them back to lambda: None will stop any further actions. It is possible to mark a point in the undo history when the document handled is saved. This allows the undo system to report whether a document has changed. The point is marked using savepoint and haschanged returns whether or not the state has changed either by doing or undoing an action.
Only one savepoint can be tracked, marking a new one removes the old one.
0コメント