how to backup installed rpm files to reinstall

Issues related to applications and software problems
hemanthbitra
Posts: 207
Joined: 2015/11/11 13:52:53
Location: Hyderbad,Telangana,India
Contact:

how to backup installed rpm files to reinstall

Post by hemanthbitra » 2016/10/12 17:23:15

Hello everyone,

If i want remove centos 7 and install centos 7.2 but i had installed so many applications from rpm files in centos 7 then how get all rpm files which installed in the system so i do not need to search for those installed application for reinstallation.

mghe
Posts: 755
Joined: 2015/11/24 12:04:43
Location: Katowice, Poland

Re: how to backup installed rpm files to reinstall

Post by mghe » 2016/10/12 18:39:14

You do not bare metal install 7.2 version, 'yum update' command will update your centos to newest version without problem.

User avatar
TrevorH
Forum Moderator
Posts: 28523
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to backup installed rpm files to reinstall

Post by TrevorH » 2016/10/12 19:28:00

And if you've run yum update recently then you're already on 7.2. And by recently I mean since November 2015...
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

User avatar
l2g
Posts: 9
Joined: 2015/08/14 13:04:27
Contact:

Re: how to backup installed rpm files to reinstall

Post by l2g » 2016/10/12 20:12:34

But i suppose if you really want to acompiish OP's goal, you could do the following:

tar cvfz backup.tgz $(rpm -ql name)
Where name is the RPM that is installed without the version, architecture and .rpm extension.
Hence lets, say you were installing a new version of nginx (e.g. nginx-1.10.1-1.el7.x86_64.rpm); you could do the following:

Code: Select all

# backup nginx contents
tar cvfz nginx.backup.tgz $(rpm -ql nginx)
Also, if you just get a copy of the old RPM that 'used' to be installed, you can always force it's installation with the --force command to roll back:

Code: Select all

# force installation of an older RPM (this command can install
# any rpm this way, so only use it if you have to)
rpm -Uhi --force older.rpm

User avatar
TrevorH
Forum Moderator
Posts: 28523
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to backup installed rpm files to reinstall

Post by TrevorH » 2016/10/12 21:07:04

Ideally you don't install packages by downloading them anyway. You install yum repositories and then all you need to do is run rpm -qa --qf '%{name}\n' and redirect the output to a file that you then copy elsewhere. Now if you need to reinstall you also reinstall the $repo-release packages and feed your text file back into yum to reinstall them.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

hemanthbitra
Posts: 207
Joined: 2015/11/11 13:52:53
Location: Hyderbad,Telangana,India
Contact:

Re: how to backup installed rpm files to reinstall

Post by hemanthbitra » 2016/10/13 00:51:21

TrevorH wrote:And if you've run yum update recently then you're already on 7.2. And by recently I mean since November 2015...


I can update os using yum update i know but problem is after updates are installed when it is restarted it go to grub mode with some so I asked this scenario.

User avatar
TrevorH
Forum Moderator
Posts: 28523
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to backup installed rpm files to reinstall

Post by TrevorH » 2016/10/13 01:35:04

Then you need to start a new thread with the exact symptoms and description of that problem to get it fixed.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

hemanthbitra
Posts: 207
Joined: 2015/11/11 13:52:53
Location: Hyderbad,Telangana,India
Contact:

Re: how to backup installed rpm files to reinstall

Post by hemanthbitra » 2016/10/14 04:46:29

TrevorH wrote:Then you need to start a new thread with the exact symptoms and description of that problem to get it fixed.
I already posted issue regarding grub error after centos update but i might deleted that post i don't want to take that risk again

hemanthbitra
Posts: 207
Joined: 2015/11/11 13:52:53
Location: Hyderbad,Telangana,India
Contact:

Re: how to backup installed rpm files to reinstall

Post by hemanthbitra » 2016/10/14 04:48:09

If i had installed any file using yum command or rpm for installing .rpm will it store those .rpm files in any root folder

User avatar
TrevorH
Forum Moderator
Posts: 28523
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to backup installed rpm files to reinstall

Post by TrevorH » 2016/10/14 07:26:20

No.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - Software Support”