PDA

View Full Version : apt-get Rolling back changes



beforewisdom
08-24-2003, 09:01 AM
Hi;

I did 2-3 installs/upgrades yesterday.

Something I did changed something that broke an application I use a lot.

Is there way to get apt-get to rollback everything it did over the past day
( I don't remember everything it did )

Steve

Dave_Bechtel
08-24-2003, 10:43 PM
--You need to be more specific. What broke, exactly?

--The quick-and-dirty thing to find out what was installed is to:
' ls -tl /var/cache/apt/archives |head ' (you can also pipe output to "less" instead of "head" if you have a lot of packages installed on the same day. You don't have to be root for this.)

--Post the results of that command, and maybe we can try apt-get install pkgname/stable or something.

--Usually when upgrade breaks something, Debian fixes it right away. You might try another update/upgrade a day or so after the last one, and see if it got fixed.

--Here is a script I use for updating my boxes (don't forget to chmod +x it) - #BEGIN /root/bin/updt


#!/bin/sh
apt-get update
apt-get -u upgrade
#debsort
mv -f -v ~/DEBInstalled.list ~/DEBInstalled.list.prev ; \
dpkg -l >~/DEBInstalled.list
updatedb &
##END


--Now whenever you get packages on your system upgraded, you can ' diff ~/DEBInstalled.list.prev ~/DEBInstalled.list ' and see what changed.

--A final note, it is a VERY good idea to start tracking what you are doing to the system. I use a file called localinfo.dat in root's home dir, and track every new package that gets installed, every pkg that gets removed, hardware upgrades, driver updates, etc. Here's an excerpt:



2003.0715 + Installed pkg (mplayer-686 w32codecs)
- Removed mplayer-686 and compiled from source (not finding codec)
( ./configure --enable-gui --enable-largefiles --enable-vorbis --enable-xmms
--with-win32libdir=/usr/lib/win32
) -- aalib support errored out.

? Installed mplayer-skin--default-1.7.tar.bz2 into
/usr/local/share/mplayer/Skin, but it's still not finding
the win32 dlls.
! This is getting old REALLY fast.
+ Installed mplayer--qt6dlls.tar.bz2, mplayer--qtextras.tar.bz2

+ :) Now it works - but it keeps crashing at the end of QT videos. :(

++ Changed proftpd.conf for better security (ServerIdent.)

2003.0805 - Removed proftpd (conf file changed)
+ Installed pkg vsftpd
+ Restored /etc/ftpusers file (deleted when proftpd went)
+ Updated stopsvcs

+ Installed pkg bittorrent

2003.0817 + Renamed .xinitrc to .xinitrc-manual and updated .bashrc,
since the way it was had broken plain startx

+ VNC on this box works diff than p233 - the ~/.vncrc is used here.

+ Updated NVIDIA driver to 4496.

2003.0821 + Installed mozilla-browser-snapshot with synaptic
+ Installed pkg aptitude




Hi;

I did 2-3 installs/upgrades yesterday.

Something I did changed something that broke an application I use a lot.

Is there way to get apt-get to rollback everything it did over the past day
( I don't remember everything it did )

Steve

beforewisdom
08-25-2003, 03:10 AM
--You need to be more specific. What broke, exactly?

Excellent point.

I used apt-get to upgrade icewm from 1.2.7 to 1.2.11. In the process it looked like upgraded some C libraries ( next time I will pay attention ) and prompted me for a bunch of preferences. It looked like most were for icewm, but I am not sure.

After the upgrade when I would go run Visual SlickEdit ( an editor ) I would get Segment Fault messages.

Steve

garyng
08-25-2003, 04:49 AM
--You need to be more specific. What broke, exactly?

Excellent point.

I used apt-get to upgrade icewm from 1.2.7 to 1.2.11. In the process it looked like upgraded some C libraries ( next time I will pay attention ) and prompted me for a bunch of preferences. It looked like most were for icewm, but I am not sure.

After the upgrade when I would go run Visual SlickEdit ( an editor ) I would get Segment Fault messages.

Steve

Chances are you hit the limitation of dpkg/apt-get and may not be able to do what you want. I have come across similar scenario before like the following :

I need to install a newer package that needs libc6(the core of the whole GNU tool set and almost everything) which would upgrade from 2.2.5(woody) to 2.3.1(sid/sarge). Once this is done, there is no way it can go back to 2.2.5 as apt-get would remove almost everything(including dpkg/apt-get itself) that use this libc6.

I don't know what your affected packages is but if it is some library(most likely) it is not easy. the only thing I can think of is to do a :

1. dpkg --get-selection > current
2. don't include the source repository that 'upgrade' your affected package
3. dpkg --set-selection < current
4. apt-get dist-upgrade

and hopefully it would restore the whole thing, but I am not sure given the design of dpkg.

Dave_Bechtel
08-25-2003, 04:55 AM
--Have you tried seeing if there's a later version of visual slickedit?



--You need to be more specific. What broke, exactly?

Excellent point.

I used apt-get to upgrade icewm from 1.2.7 to 1.2.11. In the process it looked like upgraded some C libraries ( next time I will pay attention ) and prompted me for a bunch of preferences. It looked like most were for icewm, but I am not sure.

After the upgrade when I would go run Visual SlickEdit ( an editor ) I would get Segment Fault messages.

Steve

beforewisdom
08-26-2003, 01:18 AM
--Have you tried seeing if there's a later version of visual slickedit?

There is, but I don't want to shell out the money for an upgrade until I can see if I can fix my system and if an upgrade will solve the problem.

Yes, I have done the free of charge editors. Emacs used to be my life.

Steve

beforewisdom
08-26-2003, 01:27 AM
--You need to be more specific. What broke, exactly?

--The quick-and-dirty thing to find out what was installed is to:
' ls -tl /var/cache/apt/archives |head ' (you can also pipe output to "less" instead of "head" if you have a lot of packages installed on the same day. You don't have to be root for this.)]

The dates are a bit off, I think because I had soem clock issues that I did not bother to fix.

The libs listed look familiar. apt-get got them for me when I upgraded to icewm 1.2.11 out of unstable( I down graded icewm back to icewm 1.2.7 which I found in test ).


Should dpkg _P these libraries and install the version from test or will I be getting myself into more hot water?

Steve


total 43736
drwxr-xr-x 2 root root 4096 Aug 24 10:08 partial
-rw-r----- 1 root root 0 Aug 24 10:06 lock
-rw-r--r-- 1 root root 299710 Aug 20 10:02 icewm-common_1.2.11-1_i386.deb
-rw-r--r-- 1 root root 397238 Aug 20 10:02 icewm_1.2.11-1_i386.deb
-rw-r--r-- 1 root root 2574446 Aug 19 16:02 libc6-dev_2.3.2-3_i386.deb
-rw-r--r-- 1 root root 3602448 Aug 19 16:02 libc6_2.3.2-3_i386.deb
-rw-r--r-- 1 root root 3784782 Aug 19 16:02 locales_2.3.2-3_all.deb

beforewisdom
08-31-2003, 03:05 AM
I found my own answer:

1. get the name of the previous package
2. use an '=' in place of space in the package name
3. put the package name in a normal apt-get install command:

$ apt-get install libc6=2.2

I was able to roll stuff back and get my editor working without paying for an upgrade :)

Steve

Dave_Bechtel
09-01-2003, 03:42 AM
--That's cool; I have to remember that for next time. You should go into ' aptitude ' and put a Hold on the packages that broke before so they don't get upgraded again.


I found my own answer:

1. get the name of the previous package
2. use an '=' in place of space in the package name
3. put the package name in a normal apt-get install command:

$ apt-get install libc6=2.2

I was able to roll stuff back and get my editor working without paying for an upgrade :)

Steve