The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams?
Learn more. Asked 6 years, 10 months ago. Active 5 years, 9 months ago. Viewed 9k times. When I try to remove Java with sudo apt-get remove jdk1.
Done Building dependency tree Reading state information After this operation, MB disk space will be freed.
Do you want to continue? Removing jdk1. Improve this question. David Foerster Adrian Christensen Adrian Christensen 13 1 1 silver badge 5 5 bronze badges. Improve this answer. James Jithin James Jithin 9, 3 3 gold badges 34 34 silver badges 50 50 bronze badges. LoganMzz, LOL! Thanks for notifying. It may become clearer if you try tracing through the setup for your machine.
If its just about setting paths of different executables, then why not just do alternative --config javac and so on, just like for java. Still, its hard to absorb logic of setting individual executables — Charu Khurana. For Ubuntu use update-alternatives. Dnyaneshwar Harer Dnyaneshwar Harer 6 6 silver badges 12 12 bronze badges. Definition of "all" depends on your distro.
Rostislav Matl Rostislav Matl 3, 4 4 gold badges 25 25 silver badges 51 51 bronze badges. Maybe, just the guide is outdated. After you install the rpm, you can check: alternatives --display java to see if you can see the new version is controlled by alternative, if not you need to "--install" them; otherwise, I think you can just skip "--install" part.
Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. The line that shows the active MTA is link currently points to When Sendmail is the active MTA, you'll also see that it is configured to come up as a service when the machine is booted via the chkconfig command:.
This shows that Sendmail will start up at boot time in runlevel 2, 3, 4, or 5. Once you have verified that Sendmail is active, you can issue the next set of commands, which notify the alternatives system to use PostFix as the MTA instead of Sendmail:. Again, use chkconfig to see whether Sendmail is still set to run at boot time:.
You should receive no output. The lack of output indicates that alternatives has not only changed the MTA, but has ensured that Sendmail will not be referenced at boot time or during runlevel changes. Next, test whether the system also correctly set up PostFix as the system MTA and also configured it for the system's boot and runlevel changes:.
It will also run if the runlevel is changed to anything from runlevels 2 to 5. This all looks good, but the one thing that alternatives does not do for you is actually start and stop running daemons or services.
In this example, Sendmail is still running. If you check the status of the MTA daemons before you stop Sendmail by hand, you will see something like this:. After you have seen the confirmation that Sendmail is stopped, you can start PostFix.
PostFix can either be started manually or through runlevel change, as shown here:. If you want to simulate a reboot without actually rebooting your system, just toggle over to another runlevel and then back to your production default runlevel.
After doing this, anything set to run in your default runlevel should start up if not already running. The last command shows us that PostFix is now running. Changing runlevels is done here for illustrative purposes. Most administrators will not change runlevels on a production server unless they really have to.
If you do want to simulate what happens when you boot a system, changing runlevels will get you as close as possible without doing an actual reboot. Some experts consider the changing of runlevels to test the ability of init script-configured services to properly start and stop on reboot to be unduly dangerous on a production server.
This is because a lot happens to a server when you toggle runlevels. Services across the system are checked for running process IDs or PIDS , kill and start scripts are called, logs are written, and so on. However, the "boot survivability" of a service is best tested using this real world runlevel testing method. You just need to be sure that you know exactly what you have running and not running in each run level. If you are not intimately familiar with the configuration of all of the daemons on your server, or testing chkconfig controlled services like this makes you nervous on a live system, then just verify the proper per daemon configuration settings with chkconfig , manually start the service you're configuring, and then just check its status either with the init script or with ps , like this:.
Once you get PostFix running, you may want to check the process to be sure that it is working correctly. Should you no longer want to work with PostFix, it is easy to reverse these commands and get back to Sendmail:. This code block shows the complete process for using alternatives to change the server MTA, and then testing the change by switching runlevels.
0コメント