Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Ok. Well, backups are important. But I actually version my config files for just such a thing. On my old LAN I used Chef to manage all the files. But you can easily use git or subversion to do the same thing.
Make it a habit to make changes, commit changes and so on, and you will be able to roll back to a previous version. This is not a built in feature of any distro, you have to do it on your own.
If you want to go back to factory default, you can use reinstall. I would do:
Its definitely a good idea to look at yums built-ins. The thing is SUPER powerful! I prefer it over all else.
Usage: yum [options] COMMAND
List of Commands:
check Check for problems in the rpmdb
check-update Check for available package updates
clean Remove cached data
deplist List a package's dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade downgrade a package
erase Remove a package or packages from your system
groupinfo Display details about a package group
groupinstall Install the packages in a group on your system
grouplist List available package groups
groupremove Remove the packages in a group from your system
help Display a helpful usage message
history Display, or use, the transaction history
info Display details about a package or group of packages
install Install a package or packages on your system
list List a package or groups of packages
load-transaction load a saved transaction from filename
makecache Generate the metadata cache
provides Find what package provides the given value
reinstall reinstall a package
repolist Display the configured software repositories
resolvedep Determine which package provides the given dependency
search Search package details for the given string
shell Run an interactive yum shell
update Update a package or packages on your system
upgrade Update packages taking obsoletes into account
version Display a version for the machine and/or available repos.
And you can add to that with yum plugins, such as yum-security. In fact, in newer versions of yum, there is a rollback/version control, so if you accidentally update too far, you can roll back to a previous version. But this is strictly for the programs themselves, not the custom config you make. Fyi.
Rather than reinstall, I would just download the package, open it with the archive manager, extract the needed file, and copy it back to where it belonged. This is on systems in the Red Hat family, using RPM packages. I presume other packaging types can do something similar.
If I want to look at a bunch of stuff from an RPM,
rpm2cpio /path/to/something.rpm | cpio -idm
and all the directories and files contained in the RPM are right there.
In his case, it would be a re-install, since PHP was 'partially' removed, and he didn't know what parts were left. Doing that by hand could have been time consuming with your example.
Oh definitely, once things had gone that far. The original problem was a single overwritten file. As I understand it, the partial loss of PHP occurred later, during the "reinstall Apache" attempt at recovery.