Mods/Installing OptiForge/Manual Install/Modify Existing
Warning: this guide is a work in progress!
This guide will help you install the latest version of Minecraft Forge and OptiFine.
This guide assumes you have already chosen a Minecraft version you would like to modify, and already know how to access it on your file system. If you need help with that, check out the guide on how to create a new Minecraft version from scratch.
 Step 1. Download & Install Forge
1. Choose and download a Forge version to use. You can find a list of downloads on their forum or on their download site. Be sure to check if the forge version is compatible with the version of Minecraft that you're using. Download the "universal" jar file.
On their download site, the compatible Minecraft version is listed in the "Minecraft" column. The forge version is in the format of <major>.<minor>.<micro>.<build>. For this guide we will be using the Forge version "220.127.116.110", as it's the latest version at the time of writing. Remember what version of Forge you downloaded, you will need it in the following steps.
You can download the universal file from either site, or construct the url manually. The file is located at http://files.minecraftforge.net/minecraftforge/minecraftforge-universal-<minecraft_version>-<forge_version>.jar where "<minecraft_version>" is your chosen Minecraft version, and "<forge_version> is your chosen Forge version. For Minecraft 1.6.2 and Forge 18.104.22.1680 this would be http://files.minecraftforge.net/minecraftforge/minecraftforge-universal-1.6.2-22.214.171.1240.jar
2. Forge will come as a .jar file. Move and rename this file to "libraries/net/minecraftforge/minecraftforge/<forge_version>/minecraftforge-<forge_version>.jar" in your .minecraft directory, where "<forge_version>" is your Forge version. In this case it will be "libraries/net/minecraftforge/minecraftforge/126.96.36.1990/minecraftforge-188.8.131.520.jar". You will need to create this directory.
Linux (using wget):
n=minecraftforge; v=184.108.40.2060; d="$HOME/.minecraft/libraries/net/$n/$n/$v" mkdir -p "$d" && wget -cO "$d/$n-$v.jar" "http://files.$n.net/$n/$n-universal-1.6.2-$v.jar"
 Step 2. Download & Install OptiFine
1. Choose and download a OptiFine version to use. You can find a list of downloads on the minecraft forum or on [http://optifine.net/downloads.php their download site. You can also construct the url manually: http://optifine.net/download.php?f=OptiFine_<minecraft_version>_<optifine_version>.zip where <minecraft_version> is your chosen Minecraft version, and <optifine_version> is your chosen OptiFine version. For Minecraft 1.6.2 and OptiFine HD Ultra B3 this would be http://optifine.net/download.php?f=OptiFine_1.6.2_HD_U_B3.zip
2. OptiFine will come as a .jar file. Move and rename this file to libraries/net/optifine/optifine/<optifine_version>/optifine-<optifine_version>.jar in your .minecraft directory. The optifine version should have its spaces replaced with underscores. For 1.6.2 HD Ultra B3 this will be "/net/optifine/optifine/1.6.2_HD_U_B3/optifine-1.6.2_HD_U_B3.jar" You will need to create this directory
Linux (using wget):
n=optifine; v=1.6.2_HD_U_B3; d="$HOME/.minecraft/libraries/net/$n/$n/$v" mkdir -p "$d" && wget -cO "$d/$n-$v.jar" "http://$n.net/download.php?f=OptiFine_$v.zip"