Wissam HANNA Wissam HANNA - 21 days ago 8
Linux Question

reverting apt upgrade command on UBUNTU

i did an upgrade yesterday for my ubuntu machine. now my ubuntu is not stable. how can i revert it back to the old state before upgrade.

thank you
Wissam

Answer

I agree that it's more convenient to post it in askubuntu.com. But I will still try to help in case I find the question here.

apt-get is not designed to be do an downgrade, at least a quick review within man apt-get reveals no easy commands for downgrading. It's understandable, though, because once upgraded you are not supposed to preserve informations about the last version of each and every software installed. You may have to fix them one by one.

What may be relevant in man apt-get:

   remove
       remove is identical to install except that packages are removed instead of installed. Note that removing a
       package leaves its configuration files on the system. If a plus sign is appended to the package name (with
       no intervening space), the identified package will be installed instead of removed.

   purge
       purge is identical to remove except that packages are removed and purged (any configuration files are
       deleted too).

   clean
       clean clears out the local repository of retrieved package files. It removes everything but the lock file
       from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.

   autoclean (and the auto-clean alias since 1.1)
       Like clean, autoclean clears out the local repository of retrieved package files. The difference is that
       it only removes package files that can no longer be downloaded, and are largely useless. This allows a
       cache to be maintained over a long period without it growing out of control. The configuration option
       APT::Clean-Installed will prevent installed packages from being erased if it is set to off.

   clean
       clean clears out the local repository of retrieved package files. It removes everything but the lock file
       from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.

   autoclean (and the auto-clean alias since 1.1)
       Like clean, autoclean clears out the local repository of retrieved package files. The difference is that
       it only removes package files that can no longer be downloaded, and are largely useless. This allows a
       cache to be maintained over a long period without it growing out of control. The configuration option
       APT::Clean-Installed will prevent installed packages from being erased if it is set to off.

OPTIONS
   All command line options may be set using the configuration file, the descriptions indicate the configuration
   option to set. For boolean options you can override the config file by using something like -f-,--no-f, -f=no
   or several other variations.

   --no-install-recommends
       Do not consider recommended packages as a dependency for installing. Configuration Item:
       APT::Install-Recommends.

   --install-suggests
       Consider suggested packages as a dependency for installing. Configuration Item: APT::Install-Suggests.

   -d, --download-only
       Download only; package files are only retrieved, not unpacked or installed. Configuration Item:
       APT::Get::Download-Only.

   -f, --fix-broken
       Fix; attempt to correct a system with broken dependencies in place. This option, when used with
       install/remove, can omit any packages to permit APT to deduce a likely solution. If packages are
       specified, these have to completely correct the problem. The option is sometimes necessary when running
       APT for the first time; APT itself does not allow broken package dependencies to exist on a system. It is
       possible that a system's dependency structure can be so corrupt as to require manual intervention (which
       usually means using dpkg --remove to eliminate some of the offending packages). Use of this option
       together with -m may produce an error in some situations. Configuration Item: APT::Get::Fix-Broken.

   -m, --ignore-missing, --fix-missing
       Ignore missing packages; if packages cannot be retrieved or fail the integrity check after retrieval
       (corrupted package files), hold back those packages and handle the result. Use of this option together
       with -f may produce an error in some situations. If a package is selected for installation (particularly
       if it is mentioned on the command line) and it could not be downloaded then it will be silently held back.
       Configuration Item: APT::Get::Fix-Missing.
   -u, --show-upgraded
       Show upgraded packages; print out a list of all packages that are to be upgraded. Configuration Item:
       APT::Get::Show-Upgraded.

   -V, --verbose-versions
       Show full versions for upgraded and installed packages. Configuration Item: APT::Get::Show-Versions.

   --no-upgrade
       Do not upgrade packages; when used in conjunction with install, no-upgrade will prevent packages on the
       command line from being upgraded if they are already installed. Configuration Item: APT::Get::Upgrade.

   --only-upgrade
       Do not install new packages; when used in conjunction with install, only-upgrade will install upgrades for
       already installed packages only and ignore requests to install new packages. Configuration Item:
       APT::Get::Only-Upgrade.

   --purge
       Use purge instead of remove for anything that would be removed. An asterisk ("*") will be displayed next
       to packages which are scheduled to be purged.  remove --purge is equivalent to the purge command.
       Configuration Item: APT::Get::Purge.

   --reinstall
       Re-install packages that are already installed and at the newest version. Configuration Item:
       APT::Get::ReInstall.

   --list-cleanup
       This option is on by default; use --no-list-cleanup to turn it off. When it is on, apt-get will
       automatically manage the contents of /var/lib/apt/lists to ensure that obsolete files are erased. The only
       reason to turn it off is if you frequently change your sources list. Configuration Item:
       APT::Get::List-Cleanup.

   -t, --target-release, --default-release
       This option controls the default input to the policy engine; it creates a default pin at priority 990
       using the specified release string. This overrides the general settings in /etc/apt/preferences.
       Specifically pinned packages are not affected by the value of this option. In short, this option lets you
       have simple control over which distribution packages will be retrieved from. Some common examples might be
       -t '2.1*', -t unstable or -t sid. Configuration Item: APT::Default-Release; see also the
       apt_preferences(5) manual page.