LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-12-2018, 07:51 AM   #1
sterry0101
LQ Newbie
 
Registered: Jan 2018
Posts: 11

Rep: Reputation: Disabled
Exclamation how to fall back after yum update


Hello all!
I would like to ask how to fall back after yum update for redhat6/7, centos6/7, oracle.

I found that the following command to do rollback in redhat distribution.
# yum history rollback last-1
However, when compare with previous rpm list after yum update, there are some slightly difference. (command shows as follows.)

# rpm -qa >> test1
After yum update
#yum history rollback last-1
# rpm -qa >>test2
#diff test1 test2
It is not the same.

So, do you guys have any idea how to do that?
 
Old 01-12-2018, 07:54 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,416

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by sterry0101 View Post
Hello all!
I would like to ask how to fall back after yum update for redhat6/7, centos6/7, oracle.

I found that the following command to do rollback in redhat distribution.
# yum history rollback last-1
However, when compare with previous rpm list after yum update, there are some slightly difference. (command shows as follows.)

# rpm -qa >> test1
After yum update
#yum history rollback last-1
# rpm -qa >>test2
#diff test1 test2
It is not the same.

So, do you guys have any idea how to do that?
Define "fall back" ?

Do you mean to roll back and restore your system back to the way it was before you updated it? (removing the updates you installed)
 
1 members found this post helpful.
Old 01-12-2018, 07:58 AM   #3
sterry0101
LQ Newbie
 
Registered: Jan 2018
Posts: 11

Original Poster
Rep: Reputation: Disabled
Hi jsbjsb001!
Thank you for your reply first.
Do you mean to roll back and restore your system back to the way it was before you updated it?<----yes!!
As you know that yum update is not only install something, but also upgrade package version.
I want to restore the system back.
 
Old 01-12-2018, 08:02 AM   #4
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,416

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by sterry0101 View Post
Hi jsbjsb001!
Thank you for your reply first.
Do you mean to roll back and restore your system back to the way it was before you updated it?<----yes!!
As you know that yum update is not only install something, but also upgrade package version.
I want to restore the system back.
As far as I can see, the only option that would come close is the downgrade option for yum.

Which will (as it suggests) downgrade packages.
 
1 members found this post helpful.
Old 01-12-2018, 08:45 AM   #5
sterry0101
LQ Newbie
 
Registered: Jan 2018
Posts: 11

Original Poster
Rep: Reputation: Disabled
Yes. If just need to handle a few packages, yum downgrade can be used.
But how about handling 500 package?
It is hard to downgrade the package one by one. And those old version may not found in the internet.
 
Old 01-12-2018, 09:03 AM   #6
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,416

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by sterry0101 View Post
Yes. If just need to handle a few packages, yum downgrade can be used.
But how about handling 500 package?
It is hard to downgrade the package one by one. And those old version may not found in the internet.
Yeah, you're right... it does not look easy. The only thing I can suggest in that case is to have a look at the following:

https://access.redhat.com/solutions/64069
https://www.cyberciti.biz/faq/howto-...entific-linux/ - a little dated, but should still work.

You should also backup your system before installing updates. I'm glad I did, to cut a long story short.

(I've never tried to downgrade 500 different packages before myself - that's why I do backups beforehand)

Hint: The yum history command is what your looking for.

Last edited by jsbjsb001; 01-12-2018 at 09:10 AM. Reason: addition/typo
 
Old 01-12-2018, 09:16 AM   #7
sterry0101
LQ Newbie
 
Registered: Jan 2018
Posts: 11

Original Poster
Rep: Reputation: Disabled
Yes. I read these website before. But i found that it cannot completely rollback to original system.
Just what i said before,
Before yum update
#rpm -qa >> test.1
after yum update
# yum history rollback last-1 (or yum history undo [the last transaction])
# rpm -qa >> test.2
# diff test.1 test.2
They are not completely same.

Have you tried these command before?
 
Old 01-12-2018, 09:23 AM   #8
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,416

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by sterry0101 View Post
Yes. I read these website before. But i found that it cannot completely rollback to original system.
Just what i said before,
Before yum update
#rpm -qa >> test.1
after yum update
# yum history rollback last-1 (or yum history undo [the last transaction])
# rpm -qa >> test.2
# diff test.1 test.2
They are not completely same.

Have you tried these command before?
I am using CentOS 7.3 myself and have used the yum and rpm commands many times, but once again I've never even tried to "roll back" the whole system before. So if that's what you mean, well... no.

The best option in your case maybe to backup all data you want to keep and do a clean install instead.

This is my system:

Code:
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
 
1 members found this post helpful.
Old 01-12-2018, 09:55 AM   #9
sterry0101
LQ Newbie
 
Registered: Jan 2018
Posts: 11

Original Poster
Rep: Reputation: Disabled
Um.. can i ask... is there any command that can repackage installed package as rpm?
 
Old 01-12-2018, 09:58 AM   #10
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,416

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by sterry0101 View Post
Um.. can i ask... is there any command that can repackage installed package as rpm?
I'm not clear about what your asking here? What exactly do you mean?
 
Old 01-12-2018, 10:26 AM   #11
sterry0101
LQ Newbie
 
Registered: Jan 2018
Posts: 11

Original Poster
Rep: Reputation: Disabled
if we # rpm -qa , we saw lots of package. Can we generate a rpm for one of package?
 
Old 01-12-2018, 10:32 AM   #12
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,416

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by sterry0101 View Post
if we # rpm -qa , we saw lots of package. Can we generate a rpm for one of package?
If I'm understanding you correctly, I believe the answer is no.

Code:
[root@localhost ~]# rpm --help
Usage: rpm [OPTION...]

Query/Verify package selection options:
  -a, --all                        query/verify all packages
  -f, --file                       query/verify package(s) owning file
  -g, --group                      query/verify package(s) in group
  -p, --package                    query/verify a package file
  --pkgid                          query/verify package(s) with package identifier
  --hdrid                          query/verify package(s) with header identifier
  --triggeredby                    query the package(s) triggered by the package
  --whatrequires                   query/verify the package(s) which require a dependency
  --whatprovides                   query/verify the package(s) which provide a dependency
  --nomanifest                     do not process non-package files as manifests

Query options (with -q or --query):
  -c, --configfiles                list all configuration files
  -d, --docfiles                   list all documentation files
  -L, --licensefiles               list all license files
  --dump                           dump basic file information
  -l, --list                       list files in package
  --queryformat=QUERYFORMAT        use the following query format
  -s, --state                      display the states of the listed files
...
The options you've specified in are bold.
 
Old 01-12-2018, 10:35 AM   #13
sterry0101
LQ Newbie
 
Registered: Jan 2018
Posts: 11

Original Poster
Rep: Reputation: Disabled
OK. Then is there any command can do that? Maybe no?
 
Old 01-12-2018, 10:39 AM   #14
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,416

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by sterry0101 View Post
OK. Then is there any command can do that? Maybe no?
You can build your own RPM packages if you want, but you would need to install the following command, to do it:

Code:
[james@localhost ~]$ rpmbuild --help
Usage: rpmbuild [OPTION...]

Build options with [ <specfile> | <tarball> | <source package> ]:
  -bp                           build through %prep (unpack sources and apply patches) from <specfile>
  -bc                           build through %build (%prep, then compile) from <specfile>
  -bi                           build through %install (%prep, %build, then install) from <specfile>
  -bl                           verify %files section from <specfile>
  -ba                           build source and binary packages from <specfile>
  -bb                           build binary package only from <specfile>
  -bs                           build source package only from <specfile>
  -tp                           build through %prep (unpack sources and apply patches) from <tarball>
  -tc                           build through %build (%prep, then compile) from <tarball>
  -ti                           build through %install (%prep, %build, then install) from <tarball>
  -ta                           build source and binary packages from <tarball>
  -tb                           build binary package only from <tarball>
  -ts                           build source package only from <tarball>
  --rebuild                     build binary package from <source package>
  --recompile                   build through %install (%prep, %build, then install) from <source package>
  --buildroot=DIRECTORY         override build root
  --clean                       remove build tree when done
  --nobuild                     do not execute any stages of the build
  --nodeps                      do not verify build dependencies
  --nodirtokens                 generate package header(s) compatible with (legacy) rpm v3 packaging
  --noclean                     do not execute %clean stage of the build
  --nocheck                     do not execute %check stage of the build
  --rmsource                    remove sources when done
  --rmspec                      remove specfile when done
  --short-circuit               skip straight to specified stage (only for c,i)
  --target=CPU-VENDOR-OS        override target platform
...
Code:
Installed Packages
Name        : rpm-build
Arch        : x86_64
Version     : 4.11.3
Release     : 21.el7
Size        : 320 k
Repo        : installed
From repo   : anaconda
Summary     : Scripts and executable programs used to build packages
URL         : http://www.rpm.org/
License     : GPLv2+
Description : The rpm-build package contains the scripts and executable programs
            : that are used to build packages using the RPM Package Manager.
You should not need to add any extra repo's to your repo list, if your using CentOS.
 
1 members found this post helpful.
Old 01-12-2018, 10:49 AM   #15
sterry0101
LQ Newbie
 
Registered: Jan 2018
Posts: 11

Original Poster
Rep: Reputation: Disabled
OK! Thank you so much!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How Windows 10 Fall Creators Update b0rked my Slackware partitions and how I could recover sombragris Slackware 17 10-26-2017 08:35 PM
LXer: Linux Audio Update: The Fall Fashions LXer Syndicated Linux News 0 10-14-2010 05:41 PM
"Clean" bitmap font as fall-back in Firefox SpelledJ Linux - Software 1 12-25-2009 12:34 PM
GRUB - Fall-back kernel? fr0zen Linux - Software 4 11-18-2005 03:08 AM
Booting up in X server... how do I disable it or fall back to console mode? Delmarc Linux - Newbie 3 09-06-2003 09:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration