[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rm -rf /var/cache/apt/archives/



> How do you down-grade a package?  I get burned a lot by ximian and was
> thinking that it would be really useful to have a list of what packages
> I was running before upgrading so that I could revert to that state if
> there packages were broken, again ;(

*************************************************************************
A word of warning before I begin:
With *any* upgrade/downgrade (or any time you muck with /etc)

0)  Be careful.

1)  Do not log out until you verify you can log back in.

2)  Do not reboot unless you have a rescue disk.

3)  Downgrading dpkg, libc, login, pam, et. al. can HOSE YOUR SYSTEM  

4)  Regular backups are a must.

YOU HAVE BEEN WARNED.
************************************************************************


Answer if you only want to downgrade a single package:

  dpkg -i oldpkg.deb

  (Obviously, you will need to replace "oldpkg.deb" with whatever package
   you wanted to revert AND you'll need to have the old deb handy.)

  I'd start with the package you need to downgrade first, and then
  do other packages as forced.



The answer you want if you want to completely undo the latest upgrade:

*********************************************************************
* WARNING:                                                          *
*   I DO NOT ADVOCATE DOING THIS, SINCE IT CAN COMPLETELY HOSE YOUR *
*   SYSTEM.  YOU HAVE BEEN WARNED.                                  *
*********************************************************************

  Note that I chose "/root/packages.(old|new)" arbitrarily.  Choose
  appropriate for your system and remember that /tmp gets nuked on
  reboot.

  Also note that this assumes dpkg sorts it's answer before
  presenting the results to you.  If not, add a "sort" command before
  the file redirection on the "dpkg -l" lines.

0)  Tell whatever method you are using to keep your old packages.
    They aren't kept in the deb tree, and if you've alreadly deleted
    them, you can't go back.

1)  Do the following *before* you upgrade:

  dpkg -l > /root/packages.old

    (This records the current status of the system.)

2)  Upgrade.

3)  Now do the following (at any time after upgrading):

  dpkg -l > /root/packages.new
  diff /root/packages.old /root/packages.new | sort | egrep '[<>]'

    BTW -- You can just do the diff.  All the sort & egrep do is
    move around the info & get rid of some extraneous lines.

    You will get output like:

< ii  docbook        4.1-3          SGML DTD for software documentation
> ii  docbook        4.1-4          SGML DTD for software documentation

    All of the lines with "<" at the beginning were from your old config.
    All of the lines with ">" at the beginning are from your new config.

    Now that you have a list of differences, you can go about downgrading*.

    * This can get a bit hairy, and could take some work to undo the
      latest changes completely.  Also, you can easily shoot yourself in
      the foot.

HTH,
Ian

"These are not the opinions of my employer.  And, as with anything you read
 over the net, take this with a grain of salt."



Reply to: