http://wiki.amule.org/t/api.php?action=feedcontributions&user=JohnGH&feedformat=atomAMule Project FAQ - User contributions [en]2024-03-28T13:06:54ZUser contributionsMediaWiki 1.23.3http://wiki.amule.org/t/index.php?title=FAQ_eD2k-KademliaFAQ eD2k-Kademlia2008-03-16T11:59:57Z<p>JohnGH: /* Are there any limitations on the ED2K network? */ grammar</p>
<hr />
<div><center><u><h4>F.A.Q. on eD2k-Kademlia</h4></u><br />
<br />
'''English''' | [[FAQ_eD2k-Kademlia-es|Espa&ntilde;ol]] | [[FAQ_eD2k-Kademlia-it|Italiano]] | [[FAQ_eD2k-Kademlia-de|Deutsch]] | [[FAQ_ed2k-fr|Fran&ccedil;ais]] | [[FAQ_eD2k-Kademlia-nl|Nederlands]] | [[FAQ_eD2k-Kademlia-pl|Polish]] | [[FAQ_eD2k-Kademlia-ru|Russian]]<br />
</center><br />
<br />
== What is ED2K? ==<br />
ED2K is a protocol originally used by the P2P (Peer-to-Peer) client [[eDonkey2000]], which is where the name comes from. It is a server-client based protocol, with the ability to exchange sources between clients. <br />
<br />
The ED2K network is server based like many other P2P networks such as [[Kazaa]] (Kazaa is server based, but hides the server connection from the user), which means that the first thing you do when you run [[aMule]] is to connect to a server (either manually or automatically). <br />
<br />
Once successfully connected to a server, the client can search, either locally (the connected server) or globally (all servers), for any file and the servers asked will provide the client with a list of all the files which match search parameters. <br />
<br />
If the user starts a download, the client will then ask the server for sources, which the server will return in the form of IP addresses for the clients that have told the server that they have the specific file.<br />
<br />
Then the remote client will begin to upload a whole chunk to your client as soon as you are the [[FAQ_eD2k-Kademlia#What_is_all_this_talk_about_credits,_ratings_and_scoring_about?|first in the queue]], and when the chunk has been completly sent, you will be taken back to its upload queue. This way different chunks get spread around the ED2K network, so that, although no-one may have at a same given moment the complete file, it may be completed by downloading the different chunks from different people (it is well known that users tend to stop sharing a file once it has been completed).<br />
<br />
Note that clients upload only '''one''' chunk at a time to another client. Even if a client is in the upload queue of two different files of a same user and gets to the top of both, that user will only upload one of the files to that client (the other upload, depending on the ED2K application the client uses, will probably remain as a maximum priority upload, but will not begin until the other chunk has been successfully uploaded).<br />
<br />
If both users have HighID (see [[FAQ_eD2k-Kademlia#What_is_LowID_and_HighID?|What is LowID and HighID?]]) the transfer will be done directly from client to client (Peer-to-Peer), but if one of the clients have LowID, the connection will be established through the server, since LowID cannot accept incoming connections. As a result, two LowID clients '''cannot''' connect to each other.<br />
<br />
== What is Kademlia? ==<br />
Kademlia is a natural evolution of the ED2K network. Kademlia is the future. See [[FAQ_eD2k-Kademlia#Are_there_any_limitations_on_the_ED2K_network?|Are there any limitations on the ED2K network?]] for more information on why Kademlia is necessary.<br />
<br />
Since Kademlia is a decentralized network, it removes the bottleneck that was previously caused by the need for servers (though [[Lugdunum]] has done great work in reducing this bottleneck). Now, instead of connecting to a server, you just connect to a client (with a known IP-address and port), which supports the network [[Kademlia]]. This is called the Boot Strapping.<br />
<br />
Once connected, depending on your ability to accept incoming connections, you are given either "open" or "firewalled" status, which is similar to the HighID and LowID of the ED2K network. Then you are given an ID. <br />
<br />
When searching, each client acts as a small server and is given responsibility for certain keywords or sources. This adds to the complexity of finding sources, as you no longer have a central server to ask, but instead will have to propagate the query through the network.<br />
<br />
Kademlia is supported in aMule since the 2.1.0 version.<br />
<br />
== Is Kademlia the same as Overnet? ==<br />
Short and clear: No. Overnet is the natural serverless evolution of the eDonkey software, while Kademlia is the natural serverless evolution of *Mule clients. Both are based on the original [[Kademlia]] algorithm but have been applied in different ways and therefore are incompatible. So, it's the same philosophy, but different rules. To learn about how Overnet works, refer to http://www.edonkey2000.com/documentation/how_on.html but, keep in mind, Overnet's development is closed until it reaches version 1.0, while Kademlia's development is completly open from the very beginning.<br />
<br />
== What is a chunk? ==<br />
In the ED2K protocol, to avoid sharing corrupt files, each file is divided into various parts, which are known as ''chunks'', and then each chunk is hashed (read below to know what a [[FAQ_eD2k-Kademlia#What_is_a_hash?|hash]] is). Each chunk is 9.28MB in size, so a 15MB file will be divided into two chunks (9.28MB + 5.72MB), a 315KB file will be a single chunk and a 100MB file will be divided into 11 chunks (10x9.28MB + 7.2MB).<br />
<br />
== What is a hash? ==<br />
Dividing each file into chunks (see [[FAQ_eD2k-Kademlia#What_is_a_chunk?|What is a chunk?]]) will avoid the problem of downloading a whole corrupted file since only the corrupted chunk will have to be downloaded again, but a method to identify corrupted chunks is needed. This is done by using MD4 hashes.<br />
<br />
A [[MD4 hash]] is a unique value each chunk is given and is the result of a mathematical operation on every single bit on the chunk. This means that modifying a single bit in a chunk would result in a completely different hash. That means that the [[client]] needs to verify the integrity of each part of a file as it is downloaded. <br />
<br />
Not only are the chunks hashed but also, in order to get a file-hash, all chunks's hashes are concatenated one after the other in their file order (that is: chunk1's_hash+chunk2's_hash+chunk3's_hash+...) and the resulting string is hashed. This way, each file on the ED2K network has a unique identifier. The file hash isn't taken from hashing the whole file, but from hashing the value of the chunk's hashes.<br />
<br />
In reality, you need both the hash of a file and its size. These pieces of information is embedded in the [[Ed2k_link|ED2k URLs]] found in many places.<br />
<br />
Take this for example:<br />
<br />
ed2k://|file|eMule0.42f-Sources.zip|2407949|CC8C3B104AD58678F69858F1F9B736E9|/ <br />
<br />
The interesting parts are the fifth part, "2407949", which is the size of the file in bytes and the last part, "CC8C3B104AD58678F69858F1F9B736E9", which is the hash itself, stored as hex-decimals, 32 letters long.<br />
<br />
The filename itself is irrelevant in the process of identifying the file.<br />
<br />
== Why after searching, some files which are the same appear as a different file in the results, although they even have the same name? ==<br />
<br />
If you understood "What is a hash" you will understand this quickly. When a search is started, the server tells the ED2K client the filename of the found file and the hash of the complete file for each file which matches the search. If two files, although being the same, have some difference in their content, no matter if it's big or small, the hash is different, so they are considered as a different file. That's also the reason why two file with different file name appear as the same file: on the ED2K network, the filename isn't important, the hash is.<br />
<br />
== What is LowID and HighID? ==<br />
Each client is assigned an ID (Identification) number which is unique and will distinguish the client from all other clients on the server. If this ID is below 16777216 (16 million) then you have a LowID and anything over is a HighID. Whether your client receives a high or low ID will depend on your client and whether or not the Client TCP port is open. Client TCP Port is an customisable option located in Preferences -> Connection. The default port is 4662 which is fine. If you understand [[FAQ_eD2k-Kademlia#What_is_ED2K?|what ED2K is]], odds are you'll understand the chances that clients with LowIDs may be unable to connect to other clients with LowIDs which reduces transfer rates significantly. This is the reason why having port 4662 TCP (or the one set in Preferences) is so important. Some of the larger servers refuse clients with LowIDs and disallow connections since LowID clients have data transfered through the server, rather than directly from the other client, which in turn adds more overhead for the server.<br />
<br />
For clients with a HighID, their ID is the result of a mathematical operation with their IP which corresponds to A + 256*B + 256*256*C + 256*256*256*D, where the IP is A.B.C.D. Keep in mind that this ID has identification purposes as well. Apart from having an ID over or under 16777216, it does not matter if the ID is bigger or smaller. This means a client with an ID of 50000000 isn't any better than a client with an ID of 49999999. The only exception is at times servers are either incorrectly configured or are very busy and issue LowIDs to clients even though port 4662 TCP is open. These are rare exceptions but it can happen sometimes.<br />
<br />
If you're unsure about having proper port settings, you can test your ports [http://www.amule.org/testport.php here].<br />
<br />
== Which ports do I have to configure in a firewall or router to run aMule? ==<br />
One has to distinguish between incoming and outgoing connections. Normally, all ports of a router are open for sending data (outgoing connection).<br />
<br />
So, in this normal case, You only have to configure the ports for ''incoming'' connections: aMule works even with no specific ports opened, but you won't get a HighID in this case. As mentioned above, to be given a HighID, port 4662 TCP (or the one set in the Preferences) must be listening (i.e. opened in your firewall and forwarded in your router).<br />
http://www.amule.org/wiki/index.php/FAQ_eD2k-Kademlia<br />
Apart from that port, to have an optimal ED2K experience, two more port should be enabled for listening as well: UDP ports 4672 and 4665 (that is, TCP_PORT+3) (both can be changed to any other number in the Preferences).<br />
<br />
== Why does Kademlia still say it is "firewalled?" ==<br />
If you are using Kad and your router is doing NAT (Network Address Translation), you should prevent your router from remapping the port of outgoing UDP port 4672 packets. This might help if you have a high ID but Kad status is 'firewalled'.<br />
<br />
== What does each port do? ==<br />
Well, since most ports can be configured to be set to any other number, the defaults will be listed. The traffic direction is from client perspective (you):<br />
*4661 TCP (outgoing): Port, on which a server listens for connection (defined by server).<br />
*4662 TCP (outgoing and incoming): Client to client transfers.<br />
*4665 UDP (outgoing and incoming): Used for global server searches and global source queries. This is always Client TCP port + 3<br />
*4672 UDP (outgoing and incoming): Extended eMule protocol, Queue Rating, File Reask Ping, Kad. Kad will be 'firewalled' if NAT (Network Address Translation) remaps this port number.<br />
*4711 TCP: WebServer listening port.<br />
*4712 TCP: External Connection port. Used to communicate aMule with other applications such as aMule WebServer or aMuleCMD.<br />
<br />
== Are there any limitations on the ED2K network? ==<br />
<br />
Not much, but yes, there are: two natural limits and a "forced" limitation. The two natural limits have already been mentioned before. First, the issues on LowID users (their transfers involve data through the server and two LowID clients can't share between them). The second, although ED2K is a p2p protocol, it needs servers to establish the p2p connection. This has lots of problems relating to bottlenecks, privacy and scalability (if one single server is disconnected, a big part of the network is disconnected with it). This latter one is solved in the Kademlia protocol.<br />
<br />
About the "forced" limitation, it's only a limit to make sure that clients share, so that the ED2K network will not disappear: clients which have an upload limit of X KBps, where X is from 0 to 3.99 (both included) can download at a maximum of X*3 KBps. Clients which have an upload limit of Y KBps, where Y is from 4 to 9.99 (both included) can download at a maximum of Y*4 KBps. Clients with an upload limit of 10KBps or more have no downloading limitations. This restriction is set in the client application so it could be by-passed by hacking the code, but that would probably result in being banned from the servers you connect to.<br />
<br />
Also, any client is forced to allow at least three upload slots, so it's not possible to allow more than upload_limit/3 KBps per slot.<br />
<br />
There is one last limit: Maximum file size is exactly 256GB (274877906944 bytes). Older limit (up to eMule 0.46 and aMule 2.1.*) was slightly under 4GB aproximately (exactly 4294967295 bytes, although aMule would only support files up to 4290048000 bytes).<br />
<br />
Additionally, this is not an eD2k limitation but a server limitation, servers will only send 300 results for your searches, so don't expect any more results.<br />
<br />
And on the clients side, filenames are usually limited to 161 [[character]]s.<br />
<br />
== Are there any limitations on the Kademlia network? ==<br />
*As it is a network derived from the ed2k network and, therefore, has to maintain compatibility when it comes to identify files uniquely, the 256GB maximum file size limit exisits in the Kademlia network too.<br />
*Same happens with the 161 characters limit.<br />
<br />
== In search window, what filter stands for which filetype? ==<br />
Keep in mind that the filters in the search window don't depend on the file type, but on the extensions of the filenames, in the following way:<br />
*'''Archive:''' ''.ace .arj .rar .tar.bz2 .tar.gz .zip .Z''<br />
*'''Audio:''' ''.aac .ape .au .mp2 .mp3 .mp4 .mpc .ogg .wav .wma''<br />
*'''CDImage:''' ''.bin .ccd .cue .img .iso .nrg .sub''<br />
*'''Picture:''' ''.bmp .gif .jpeg .jpg .png .tif''<br />
*'''Program:''' ''.com .exe''<br />
*'''Video:''' ''.avi .divx .mov .mpeg .mpg .ogg .ram .rm .vivo .vob''<br />
<br />
So, a movie file that has the name "Birthday.zip" will appear in the Archive filter, but not in the Video filter.<br />
<br />
== What is a source? ==<br />
A source is a client which is sharing some chunk in some file you have in your downloading queue which you still have not completed. Obviously, the more sources you can get for a given file, the more possibilities you have to download the file and the quicker you'll download it. Keep in mind that there's a difference between "sources" and "available sources" if you're on LowID, since "sources"s stands for clients sharing a chunk or file you still haven't completed, while "available sources" stands for clients sharing a chunk or file you still haven't completed and from who you can download (that is, a source who is on HighID).<br />
<br />
== What is all this talk about credits, ratings and scoring about? ==<br />
All three concepts have to do with the way in which the ED2K network establishes the uploading queues preferences.<br />
<br />
The score is the most important value: the client with the higher score will be the next client which you'll provide a slot to. The way in the score value is set is this: score = rate x time_waiting_in_seconds / 100<br />
So, to understand this, we must known what rate is.<br />
<br />
Rate can be understood as an objective preference. This is, the preference which a client is given without caring how much time it's been waiting. When a client is added to the uploading queue, it gets a rate of 100. This value is modified following according to this:<br />
<br />
According to the amount of credits, the rate will be multiplied by 1x to 10x.<br />
Depending on the file priority, it will be multiplied by 0.2x to 1.8x (Release 1.8x, High 0.9x, Normal 0.7x, Low 0.6x, Very Low: 0.2x).<br><br />
Users on specific old clients which load too much the network traffic will get penalized by multiplying their rate by 0.5x.<br />
<br />
Banned clients will instantly get no rate (that is, their rate will by multiplied by 0).<br />
<br />
This multiplying values are known as "modifiers". Clients with a modifier value strictly bigger than 1 will be marked as yellow in the icon.<br />
<br />
So we only have credits left to known. Credits are a prize you get for uploading files to a specific user. Credits are exchanged between two specific clients, they are not global, so your own credits can't be viewed, although you can know the credits any other user has on you (that is, the credits you owe that client). Since credits are managed by the uploading client, you might be uploading to some client with no credits support, so you will gain no credits on him, although that client will actually get credits on you if it uploads to you, since you do have credits support. This credits are stored in clients.met file.<br />
<br />
The credits modifier used by rate is the lower between these two: <br>(upload_total x 2)/download_total or sqrt(upload_total+2) where both upload_total and download_total are measured in MBs.<br />
<br />
If the result is lower than 1, then it is set to 1 and if it is bigger than 10, it is set to 10. In addition, if the uploaded total is less than 1MB, the modifier is set to 1 and if the downloaded total is equal to 0, then the modifier is set to 10.<br />
<br />
== What is a slot? ==<br />
When uploading files, your upload bandwidth (which may vary depending on the upload limit or the natural connection-type upload limit) will be divided into slots. So, each slot is an amount of KBps which will be assigned to each client who tries to download from you.<br />
<br />
== Version ==<br />
Created by Jacobo221 on 28.05.04 at 20:13<br><br />
Updated by Vollstrecker on 23.01.08 at 13:49</div>JohnGHhttp://wiki.amule.org/t/index.php?title=UserhashUserhash2005-06-11T00:05:02Z<p>JohnGH: </p>
<hr />
<div>This user hash is stored in the preferences.dat file and is used to grant earned credits with other users. aMule (like eMule) can use an asymmetric encryption to avoid exploiting or manipulating other user hash values. The method uses a private and a public key to ensure a correct and unique identification on other clients.<br />
<br />
Secure User Identification can be turned on in Preferences -> Connection (since aMule 2.x). It is recommended to use it.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=Secure_User_IdentificationSecure User Identification2005-06-11T00:00:50Z<p>JohnGH: =What is Secure User Identification (SUI) ?=</p>
<hr />
<div>== What is Secure User Identification (SUI) ? ==<br />
<br />
[[Client|Clients]] in the network are identified by a unique value called [[Userhash|user hash]]. This user hash is stored in the ''preferences.dat'' file and is used to grant earned [[FAQ_eD2k-Kademlia#What_is_all_that_credits,_rate_and_score_stuff_about?|credits]] with other users.<br />
[[aMule]] (like [[eMule]]) can use an asymmetric encryption to avoid exploiting or manipulating other user hash values. The method uses a private and a public key to ensure a correct and unique identification on other clients.<br />
<br />
Secure User Identification can be turned on in Preferences -> Connection (since [[aMule]] 2.x). It is recommended to use it.<br />
<br />
== The identification process ==<br />
<br />
The following describes how two [[client]]s supporting SUI identify each other. If the identification fails, the [[client]] which detects the failure should ban the other [[client]].<br />
<br />
== First [[aMule]] start ==<br />
<br />
When you start [[aMule]] for the first time, it will create a 384-bit [http://en.wikipedia.org/wiki/RSA RSA] private key (which will be stored in ''cryptkey.dat''). This file should be kept forever, since loosing it will make you loose all your credits.<br />
<br />
== First meeting ==<br />
<br />
When [[aMule]] connects to a client supporting SUI, it expects this client to send it's public key (it's user hash) along with a random number, while [[aMule]] will do right the same. If the public key it gets is unknown, it will stored it in ''clients.met'' (only the public key, not the random number) so that it will be possible to identify that [[client]] next time it meets it.<br />
<br />
== Identificating ==<br />
<br />
When a [[client]] wants to identify in another [[client]], it will send to this latter [[client]] a [[digital signature]] created from it's own private key, the public key of the other [[client]] and the random value the other [[client]] sent.<br />
<br />
The other [[client]] will do the same.<br />
<br />
== Validating an identification ==<br />
<br />
When the remote [[client]] get's this signature, it will check if it is created from the your public key and the random value it sent, and then check if it suits it's own private key. If both checks succeed, your [[client]] will be successfully identified on that [[client]].<br />
<br />
Of course, your [[client]] will do exactly the same with the [[digital signature]] it gets fromthe remote [[client]].</div>JohnGHhttp://wiki.amule.org/t/index.php?title=Secure_User_IdentificationSecure User Identification2005-06-11T00:00:32Z<p>JohnGH: =What is Secure User Identification (SUI) ?=</p>
<hr />
<div>== What is Secure User Identification (SUI) ? ==<br />
<br />
[[Client|Clients]] in the network are identified by a unique value called [Userhash|user hash]. This user hash is stored in the ''preferences.dat'' file and is used to grant earned [[FAQ_eD2k-Kademlia#What_is_all_that_credits,_rate_and_score_stuff_about?|credits]] with other users.<br />
[[aMule]] (like [[eMule]]) can use an asymmetric encryption to avoid exploiting or manipulating other user hash values. The method uses a private and a public key to ensure a correct and unique identification on other clients.<br />
<br />
Secure User Identification can be turned on in Preferences -> Connection (since [[aMule]] 2.x). It is recommended to use it.<br />
<br />
== The identification process ==<br />
<br />
The following describes how two [[client]]s supporting SUI identify each other. If the identification fails, the [[client]] which detects the failure should ban the other [[client]].<br />
<br />
== First [[aMule]] start ==<br />
<br />
When you start [[aMule]] for the first time, it will create a 384-bit [http://en.wikipedia.org/wiki/RSA RSA] private key (which will be stored in ''cryptkey.dat''). This file should be kept forever, since loosing it will make you loose all your credits.<br />
<br />
== First meeting ==<br />
<br />
When [[aMule]] connects to a client supporting SUI, it expects this client to send it's public key (it's user hash) along with a random number, while [[aMule]] will do right the same. If the public key it gets is unknown, it will stored it in ''clients.met'' (only the public key, not the random number) so that it will be possible to identify that [[client]] next time it meets it.<br />
<br />
== Identificating ==<br />
<br />
When a [[client]] wants to identify in another [[client]], it will send to this latter [[client]] a [[digital signature]] created from it's own private key, the public key of the other [[client]] and the random value the other [[client]] sent.<br />
<br />
The other [[client]] will do the same.<br />
<br />
== Validating an identification ==<br />
<br />
When the remote [[client]] get's this signature, it will check if it is created from the your public key and the random value it sent, and then check if it suits it's own private key. If both checks succeed, your [[client]] will be successfully identified on that [[client]].<br />
<br />
Of course, your [[client]] will do exactly the same with the [[digital signature]] it gets fromthe remote [[client]].</div>JohnGHhttp://wiki.amule.org/t/index.php?title=FAQ_webserverFAQ webserver2005-06-10T10:39:10Z<p>JohnGH: =How can I setup aMuleWeb with aMule v2?=</p>
<hr />
<div>== What is [[aMuleWeb]]? ==<br />
<br />
Take a look at [[aMuleWeb|this]].<br />
<br />
== How can I setup [[aMuleWeb]] with [[aMule]] v2? ==<br />
<br />
To configure it, please follow [[Webserver#Webserver_with_aMule_2.0.0_or_later|this HowTo]].<br />
<br />
== How can I setup [[aMuleWeb]] with [[aMule]] v1? ==<br />
<br />
Read [[Webserver#With aMule 1.2.8 or earlier|this HowTo]], but be aware that using [[aMule]] v2 is '''recommended''' and that [[aMule]] v1's [[aMuleWeb]] has some security bugs.<br />
<br />
== What should I see when [[aMuleWeb]] is running correctly? ==<br />
<br />
After running ''amuleweb'' in a terminal, you should see something like this:<br />
<br />
:''Web Server: Started''<br><br />
:''WSThread: Thread started''<br><br />
:''WSThread: created service''<br><br />
:''WSThread: created socket listening on :4711''<br><br />
:''amuleweb$''<br />
<br />
== Can I run [[aMuleWeb]] as a daemon? ==<br />
<br />
Since [[aMule]] 2.0.0-rc6, [[aMuleWeb]] supports ''--quiet'' switch (or ''-q'' also) which renders allows [[aMuleWeb]] to be easily run on the background.<<br />
<br />
However, on previous [[aMule]] releases, although [[aMuleWeb]] works well, it's actually quite tricky to run it in the background because it's continuously asking for user commands and showing the prompt. The obvious way to avoid this would be running amuleweb with the output redirected to ''/dev/null'', but this hogs the CPU due to the constant writing, so a better approach is to use the program [http://directory.fsf.org/GNU/screen.html screen], which is a terminal emulator. In order to run [[aMuleWeb]] inside a virtual terminal, the following command should be executed: ''screen -d -m -S amulewebsession amuleweb -p 7000 -pw password'' (assuming that [[aMule]] is listening for [[External Connections]] on port ''7000'' and the password is ''password''). Then, [[aMuleWeb]] will start listening for HTTP connections, but will show the prompt and all messages in this virtual terminal. It's possible to switch to this terminal using the command ''screen -r amulewebsession'', please refer to [http://directory.fsf.org/GNU/screen.html screen] documentation for info about session switching, internal commands, etc.<br />
<br />
== Why is [[aMuleWeb]] failing to connect? ==<br />
<br />
If you followed the [[Webserver|above HowTo]] correctly, make sure that you are using an [[aMuleWeb]] binnary distributed with the same release as the [[aMule]] binnary. For example, [[aMuleWeb]] binnary from the [[aMule]] 2.0.0-rc3 release will '''not''' connect with [[aMule]] 2.0.0-rc4, [[aMule]] 2.0.0-rc2 or any other version (including v1 versions).</div>JohnGHhttp://wiki.amule.org/t/index.php?title=AICHAICH2005-06-01T16:35:18Z<p>JohnGH: =How is the Root Hash spread?=</p>
<hr />
<div>== Description ==<br />
<br />
[[ICH]]'s success has no point to be discussed about, but it comes to an end where being able to actually know which exact part of the [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is [[Corrupt|corrupt]] would make life easier. This comes specially significant when several [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] are [[Corrupt|corrupt]]. [[AICH]] (Advanced Intelligent [[Corrupt]]ion Handler) takes part in this problem and allows [[aMule]] and any [[client]] supporting it to actually know which exact part/s of the [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is/are [[Corrupt|corrupt]].<br />
<br />
== Definitions ==<br />
<br />
Each [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is divided into 53 180KB parts and each of these parts is hashed using the [http://www.faqs.org/rfcs/rfc3174.html SHA1 algorithm]. Each of these hashes is called a [[Block Hash]]. By combining pairs of [[Block Hash]]es (i.e. each part with the part next to it) [[aMule]] will get a whole tree of hashes (this tree which is threfore a hashset made of all of the other [[Block Hash]]es is called the [[AICH Hashset]]). Each hash which is neither a [[Block Hash]] nor the [[Root Hash]], is a [[Verifying Hash]]. The hash at the top level is the [[Root Hash]] and it is supposed to be provided by the [[ed2k link]] when releasing.<br />
<br />
== The actual work ==<br />
<br />
When a [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is known to be [[Corrupt|corrupt]], [[aMule]] will try to get an [[AICH Hashset]] from some [[client]] sharing that file and which has already completed it. It will ask for the all hashes of the 53 parts in the [[Corrupt|corrupt]] [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] and the necessary [[Verifying Hash]]es to complete the [[AICH Hashset]] tree up to the [[Root Hash]].<br />
<br />
Once it gets the [[Block Hash]]es and the [[Verifying Hash]]es, it builds up the tree to get the [[Root Hash]] and check if it's the same as the [[Root Hash]] the original [[ed2k link]]s provided. If it is, those [[Block Hash]]es will be considered as reliable. If it isn't, those [[Block Hash]]es and [[Verifying Hash]]es will be dropped and considered fakes.<br />
<br />
Once the [[Block Hash]]es are considered reliable, each 180KB part in the [[Corrupt|corrupt]]ed [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] will be hashed (using the [http://www.faqs.org/rfcs/rfc3174.html SHA1 algorithm]) in order to compare the resulting hash with the recieved [[Block Hash]]es. If they are the same, then that part is not [[Corrupt|corrupt]]ed, so there's no need to redownload it. If they're not the same, then that part is [[Corrupt|corrupt]]ed and it will be redownloaded.<br />
<br />
== How is the [[Root Hash]] spread? ==<br />
<br />
The ideal way to spread the [[Root Hash]] is through the [[ed2k link]]. But many times files are downloaded through the search feature in the [[FAQ_eD2k-Kademlia#What_is_ED2K?|eD2k]] [[client]]. Also, the [[ed2k link]] might not include the [[Root Hash]] in its URL. In such cases an alternative method is used to get the file's [[Root Hash]].<br />
<br />
It will ask other [[client]]s for the [[Root Hash]]. If at least 10 other [[client]]s send you the same [[Root Hash]] and that is 92% or more of the total [[Root Hash]]es received, that [[Root Hash]] will be considered as reliable for the '''current session only'''. It will not be stored anywhere on disk and will only be kept in memory. Also, it will not be shared with any other [[client]] who asks for it.<br />
<br />
When the file download is completed, the [[Root Hash]] will be calculated, with the whole [[AICH Hashset]], stored in ''~/.aMule/known2.met'' and shared with any [[client]] who asks for it.<br />
<br />
== Storing the [[AICH Hashset]] ==<br />
<br />
Once a file has been completly downloaded, [[aMule]] builds it's complete [[AICH Hashset]] and stores it in ''~/.aMule/known2.met'' so whenever a [[client]] asks for it, it can provide it without having to recalculate it every time.<br />
<br />
Please notice that as long as the AICH method can be applied to a file, [[ICH]] will not be used for that file.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=AICHAICH2005-06-01T16:30:00Z<p>JohnGH: =Definitions=</p>
<hr />
<div>== Description ==<br />
<br />
[[ICH]]'s success has no point to be discussed about, but it comes to an end where being able to actually know which exact part of the [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is [[Corrupt|corrupt]] would make life easier. This comes specially significant when several [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] are [[Corrupt|corrupt]]. [[AICH]] (Advanced Intelligent [[Corrupt]]ion Handler) takes part in this problem and allows [[aMule]] and any [[client]] supporting it to actually know which exact part/s of the [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is/are [[Corrupt|corrupt]].<br />
<br />
== Definitions ==<br />
<br />
Each [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is divided into 53 180KB parts and each of these parts is hashed using the [http://www.faqs.org/rfcs/rfc3174.html SHA1 algorithm]. Each of these hashes is called a [[Block Hash]]. By combining pairs of [[Block Hash]]es (i.e. each part with the part next to it) [[aMule]] will get a whole tree of hashes (this tree which is threfore a hashset made of all of the other [[Block Hash]]es is called the [[AICH Hashset]]). Each hash which is neither a [[Block Hash]] nor the [[Root Hash]], is a [[Verifying Hash]]. The hash at the top level is the [[Root Hash]] and it is supposed to be provided by the [[ed2k link]] when releasing.<br />
<br />
== The actual work ==<br />
<br />
When a [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is known to be [[Corrupt|corrupt]], [[aMule]] will try to get an [[AICH Hashset]] from some [[client]] sharing that file and which has already completed it. It will ask for the all hashes of the 53 parts in the [[Corrupt|corrupt]] [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] and the necessary [[Verifying Hash]]es to complete the [[AICH Hashset]] tree up to the [[Root Hash]].<br />
<br />
Once it gets the [[Block Hash]]es and the [[Verifying Hash]]es, it builds up the tree to get the [[Root Hash]] and check if it's the same as the [[Root Hash]] the original [[ed2k link]]s provided. If it is, those [[Block Hash]]es will be considered as reliable. If it isn't, those [[Block Hash]]es and [[Verifying Hash]]es will be dropped and considered fakes.<br />
<br />
Once the [[Block Hash]]es are considered reliable, each 180KB part in the [[Corrupt|corrupt]]ed [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] will be hashed (using the [http://www.faqs.org/rfcs/rfc3174.html SHA1 algorithm]) in order to compare the resulting hash with the recieved [[Block Hash]]es. If they are the same, then that part is not [[Corrupt|corrupt]]ed, so there's no need to redownload it. If they're not the same, then that part is [[Corrupt|corrupt]]ed and it will be redownloaded.<br />
<br />
== How is the [[Root Hash]] spread? ==<br />
<br />
The ideal way to spread the [[Root Hash]] is through the [[ed2k link]]s. But many times files are downloaded through the search feture in the [[FAQ_eD2k-Kademlia#What_is_ED2K?|eD2k]] [[client]]s. Also, the [[ed2k link]]s might not include the [[Root Hash]] in their URL. In such cases an alternative method is used to grap the file's [[Root Hash]].<br />
<br />
It will ask for the [[Root Hash]] to other [[client]]s. If at least 10 [[client]]s send you the same [[Root Hash]] and that is 92% or more of the total [[Root Hash]]es recieved, that [[Root Hash]] will be considered as reliable for the '''current session only'''. It will not be stored anywhere in disk and will only be kept in memory. Also, it will not be shared with any other [[client]] who asks for it.<br />
<br />
When the file download is completed, the [[Root Hash]] will be calculated, with the whole [[AICH Hashset]], stored in ''~/.aMule/known2.met'' and shared with any [[client]] who asks for it.<br />
<br />
== Storing the [[AICH Hashset]] ==<br />
<br />
Once a file has been completly downloaded, [[aMule]] builds it's complete [[AICH Hashset]] and stores it in ''~/.aMule/known2.met'' so whenever a [[client]] asks for it, it can provide it without having to recalculate it every time.<br />
<br />
Please notice that as long as the AICH method can be applied to a file, [[ICH]] will not be used for that file.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=AICHAICH2005-06-01T16:28:37Z<p>JohnGH: =Definitions= English grammar</p>
<hr />
<div>== Description ==<br />
<br />
[[ICH]]'s success has no point to be discussed about, but it comes to an end where being able to actually know which exact part of the [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is [[Corrupt|corrupt]] would make life easier. This comes specially significant when several [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] are [[Corrupt|corrupt]]. [[AICH]] (Advanced Intelligent [[Corrupt]]ion Handler) takes part in this problem and allows [[aMule]] and any [[client]] supporting it to actually know which exact part/s of the [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is/are [[Corrupt|corrupt]].<br />
<br />
== Definitions ==<br />
<br />
Each [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is divided into 53 180KB parts and each of these parts is hashed using the [http://www.faqs.org/rfcs/rfc3174.html SHA1 algorithm]. Each of these hashes is called a [[Block Hash]]. By combining the [[Block Hash]]es two-by-two each with the part next to it, [[aMule]] will get a whole tree of hashes (this tree which is threfore a hashset made of all of the other [[Block Hash]]es is called the [[AICH Hashset]]). Each hash which is neither a [[Block Hash]] nor the [[Root Hash]], is a [[Verifying Hash]]. The hash at the top level is the [[Root Hash]] and it is supposed to be provided by the [[ed2k link]] when releasing.<br />
<br />
== The actual work ==<br />
<br />
When a [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] is known to be [[Corrupt|corrupt]], [[aMule]] will try to get an [[AICH Hashset]] from some [[client]] sharing that file and which has already completed it. It will ask for the all hashes of the 53 parts in the [[Corrupt|corrupt]] [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] and the necessary [[Verifying Hash]]es to complete the [[AICH Hashset]] tree up to the [[Root Hash]].<br />
<br />
Once it gets the [[Block Hash]]es and the [[Verifying Hash]]es, it builds up the tree to get the [[Root Hash]] and check if it's the same as the [[Root Hash]] the original [[ed2k link]]s provided. If it is, those [[Block Hash]]es will be considered as reliable. If it isn't, those [[Block Hash]]es and [[Verifying Hash]]es will be dropped and considered fakes.<br />
<br />
Once the [[Block Hash]]es are considered reliable, each 180KB part in the [[Corrupt|corrupt]]ed [[FAQ_eD2k-Kademlia#What_is_a_chunk?|chunk]] will be hashed (using the [http://www.faqs.org/rfcs/rfc3174.html SHA1 algorithm]) in order to compare the resulting hash with the recieved [[Block Hash]]es. If they are the same, then that part is not [[Corrupt|corrupt]]ed, so there's no need to redownload it. If they're not the same, then that part is [[Corrupt|corrupt]]ed and it will be redownloaded.<br />
<br />
== How is the [[Root Hash]] spread? ==<br />
<br />
The ideal way to spread the [[Root Hash]] is through the [[ed2k link]]s. But many times files are downloaded through the search feture in the [[FAQ_eD2k-Kademlia#What_is_ED2K?|eD2k]] [[client]]s. Also, the [[ed2k link]]s might not include the [[Root Hash]] in their URL. In such cases an alternative method is used to grap the file's [[Root Hash]].<br />
<br />
It will ask for the [[Root Hash]] to other [[client]]s. If at least 10 [[client]]s send you the same [[Root Hash]] and that is 92% or more of the total [[Root Hash]]es recieved, that [[Root Hash]] will be considered as reliable for the '''current session only'''. It will not be stored anywhere in disk and will only be kept in memory. Also, it will not be shared with any other [[client]] who asks for it.<br />
<br />
When the file download is completed, the [[Root Hash]] will be calculated, with the whole [[AICH Hashset]], stored in ''~/.aMule/known2.met'' and shared with any [[client]] who asks for it.<br />
<br />
== Storing the [[AICH Hashset]] ==<br />
<br />
Once a file has been completly downloaded, [[aMule]] builds it's complete [[AICH Hashset]] and stores it in ''~/.aMule/known2.met'' so whenever a [[client]] asks for it, it can provide it without having to recalculate it every time.<br />
<br />
Please notice that as long as the AICH method can be applied to a file, [[ICH]] will not be used for that file.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=User:JohnGHUser:JohnGH2005-06-01T10:12:01Z<p>JohnGH: </p>
<hr />
<div>[http://www.aotea.org/john/ JohnGH] is an '''[[aMule]] user''' on Debian Linux...<br />
<br />
<u>Main [[aMule]] concerns:</u><br />
*Fixed [[HowTo Compile In Debian]] to be ''the [[AMule_Project_FAQ:Help|wiki way]]'' (c)</div>JohnGHhttp://wiki.amule.org/t/index.php?title=User:JohnGHUser:JohnGH2005-06-01T10:10:46Z<p>JohnGH: </p>
<hr />
<div>[[http://www.aotea.org/john/|JohnGH]] is an '''[[aMule]] user''' on Debian Linux...<br />
<br />
<u>Main [[aMule]] concerns:</u><br />
*Fixed [[HowTo Compile In Debian]] to be ''the [[AMule_Project_FAQ:Help|wiki way]]'' (c)</div>JohnGHhttp://wiki.amule.org/t/index.php?title=User:JohnGHUser:JohnGH2005-06-01T10:10:11Z<p>JohnGH: </p>
<hr />
<div>[[http://www.aotea.org/john/|JohnGH]]<br />
<br />
I am an '''[[aMule]] user''' on Debian Linux...<br />
<br />
<u>Main [[aMule]] concerns:</u><br />
*Fixed [[HowTo Compile In Debian]] to be ''the [[AMule_Project_FAQ:Help|wiki way]]'' (c)</div>JohnGHhttp://wiki.amule.org/t/index.php?title=User:JohnGHUser:JohnGH2005-06-01T10:09:26Z<p>JohnGH: </p>
<hr />
<div><a href="http://www.aotea.org/john/">JohnGH</a><br />
<br />
I am an '''[[aMule]] user''' on Debian Linux...<br />
<br />
<u>Main [[aMule]] concerns:</u><br />
*Fixed [[HowTo Compile In Debian]] to be ''the [[AMule_Project_FAQ:Help|wiki way]]'' (c)</div>JohnGHhttp://wiki.amule.org/t/index.php?title=HowTo_Compile_In_Debian/UbuntuHowTo Compile In Debian/Ubuntu2005-05-19T09:02:07Z<p>JohnGH: =The easiest: Preparing the system=</p>
<hr />
<div>HowTo compile aMule in [[Debian]] by ''[[User:Jacobo221|Jacobo221]]''<br />
<br />
Very special thanks to ''darknox'', ''Arathornz'', ''guest234'', ''parasito'', ''maya'' and ''klando'' for their tests!<br />
<br />
'''NOTE:''' This howto will also work for [http://www.ubuntulinux.com Ubuntu Linux].<br />
<br />
== Are you sure you want to compile? ==<br />
<br />
You can just install latest [[aMule CVS]] through debs adding the following lines into your ''/etc/apt/sources.list'' file:<br />
<br />
deb http://www.vollstreckernet.de/debian/ testing amule<br />
deb http://www.vollstreckernet.de/debian/ testing wx<br />
<br />
'''NOTE:''' The second line is necessary for Sarge users and strongly recommended for Sid users.<br />
<br />
Now run ''apt-get update && apt-get install amule''<br />
<br />
You might also want to take a look at the other available [[aMule]] utilities:<br />
*amule<br />
*amule-common<br />
*amuled<br />
*amule-remote-gui<br />
*amuleweb<br />
*amulewebdlg<br />
*amule-cas<br />
*amule-wxcas<br />
*amule-xas<br />
*amule-utils<br />
<br />
If you still want to compile aMule instead of just installing a binary, keep reading...<br />
<br />
== Notes before starting ==<br />
<br />
'''Important:''' Have in mind that this HowTo was done having in mind aMule 2.0.0 or greater in [[Debian]] 3.0 (Woody/Sarge/Sid).<br />
<br />
This HowTo is based on using the apt-get package installer tool, which means you'll have to be able to get super-user (root) access. Also, apt-get requires a perfect packet dependencies installed system. If you usually use apt-get for installing any application, skip this and go to the next section. If you rarely use apt-get but, instead, use dpkg, you can;<br />
<br />
A) (Recommended) Solve all the dependencies problems on your system. This can be done by taking a look at the <code>"dpkg -C"</code> output and installing/removing/updating the packages it mentions depending on what's required. This option is the recommended since it will not only ensure your aMule compilation will be most surely correct, but it will also make your system the most stable it can possibly be and from now on you'll be able to use apt-get to not only make easier installations, but also to easily upgrade your system.<br />
<br />
B) Force apt-get to ignore the dependencies problems using the -f or --fix-broken switches (just one of them, since they're exactly the same, so that'd be, for example, <code>"apt-get install -f ..."</code>). This option may cause a corrupt installation of some packages which may cause the apps not to work. Also have in mind that using this switch in a system with dependencies problems may cause the system to completely break if the package being installed is a base package (although this is not the case).<br />
<br />
C) Follow this instructions but, instead of using <code>"apt-get install foo"</code>, use <code>"dpkg -i foo"</code> where foo is the package to install. Remember the packages must be already on the system when installing packages with dpkg. Remember also to download any "Depends" package since it most-surely will be necessary for successfully compiling [[aMule]]. Avoid using whichever of the following dpkg switches: --force-all --force-depends-version --force-depends --force-conflicts<br />
<br />
If you usually install applications from source, read deltaHF's [[Compilation_Installation|"aMule compilation / installation HowTo"]] since your system might not be complying the Debian aMule package dependencies although <code>"dpkg -C"</code> shows no errors.<br />
<br />
== The easiest: Preparing the system ==<br />
<br />
Once you decided to use apt-get, you must make sure you'll be downloading the latest versions of the packages (aMule team has discovered bugs in some deb packages that would make aMule impossible to compile on Debian without compiling some other libraries too. This bugs have been mostly fixed in those affected debian packages, so it is very important to be sure to have the packages up to date). This is done by issuing:<br />
<br />
apt-get update && apt-get dist-upgrade<br />
<br />
'''''Note 1:''' You must be root user to do this. Log in as root or <code>"su"</code> or use <code>"sudo"</code>. NB: <code>"sudo"</code> must be specified on both apt-get commands, that is:''<br />
<br />
sudo apt-get update && sudo apt-get dist-upgrade<br />
<br />
''<code>"sudo"</code> is not a base command, so it may not be installed on your system, although it most probably will. Be aware that following this HowTo entirely as root may bring some problems later such as being unable to delete certain files as a normal user, so please only use root priviledges when necessary.''<br />
<br />
'''''Note 2:''' Woody users (that is, people stuck in the stable Debian 3.0 branch) will be unable to install the wxGTK, wxbase and Crypto++ libraries since they were not available in the current minimum compatible versions (2.4.2 and 2.5.1 respectively) when Woody was released.''<br />
<br />
''The best for Woody users is to switch to the Sarge or Sid branch. That can be done with the following command (again, you must be root)''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/testing/g" /etc/apt/sources.list<br />
<br />
''or''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sarge/g" /etc/apt/sources.list<br />
<br />
''to switch to the Sarge/testing branch, or with''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/unstable/g" /etc/apt/sources.list<br />
''or''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sid/g" /etc/apt/sources.list<br />
<br />
''to switch to the Sid/unstable branch.''<br />
<br />
''If Woody users are not be interested in switching to Sarge they will need to download Woody-backported debian packages by adding the following line to /etc/apt/sources.list (remember to <code>"apt-get update"</code> after adding this line):''<br />
<br />
deb <nowiki>http://debian.thermoman.de/</nowiki> woody wxwindows2.4 libcrypto++<br />
<br />
''What's more, [http://www.thermoman.de thermoman] stopped working on the [[aMule]] backports for [http://www.debian.org Woody] on the [[aMule]] 2.0.0-rc5 release, so newer [[aMule]] releases backports are unavailable. Sorry.''<br />
<br />
'''''Note 3:''' Sarge users won't have any dependecy problems any longer, since both crypto++ and wxWidgets have both been in Sarge for some time now. So there's no longer any need to update ''sources.list'' on Debian Sarge distributions.''<br />
<br />
'''''Note 4:''' Sid users (that is, people holding the cutting-edge unstable Debian 3.0 branch) could suffer problems from packages not completely implemented or with broken dependencies (both are normal issues in the unstable branch). It is very important to keep this in mind since a compiler (g++) will be installed so it could also be broken and, with it, most applications compiled with it (once upgraded, of course). If a package was broken, to downgrade you can use the --force-downgrade switch with dpkg.''<br />
<br />
If for whatever reason you think this is too much of a complication, you can just wait a few days until the aMule binary version comes out for your architecture (that is, a .deb file).<br />
<br />
== The fastest: Installing the necessary packages ==<br />
Remember you need to be root to install applications using apt-get, since apt-get installs system-wide applications. So, log in as root, use "su" or add "sudo" before every command shown here.<br />
<br />
The following are the packages which must be installed:<br />
<br />
1) Install the latest stable g++ compiler and the C++ Standard Library<br />
<br />
apt-get install g++<br />
<br />
the required libraries for compiling [[aMule]] (wxbase is not really a requiered packet to compile aMule but, unless you know what you're doing, be sure you install it. I won't show in this this guide how to force aMule's compilation without wxbase):<br />
<br />
apt-get install libwxbase2.4-dev libcurl3-dev libgtk1.2-dev libwxgtk2.4-dev<br />
<br />
Alternatively you can use <code>apt-get build-dep amule</code> to get all the required depencies for compilation. Anyway, this last method is not sure to work, since it will depend on the latest version on the Debian repository and later versions or CVS versions might have different dependencies.<br />
And the required utilities for compiling [[aMule]], at the moment only gettext (necessary for internationalization support):<br />
<br />
apt-get install gettext<br />
<br />
'''''Note 5:''' This can all be done in a single command line, which might be more handy for users using <code>"sudo"</code> to gain root priviledges:''<br />
<br />
apt-get install g++ libwxbase2.4-dev libcurl3-dev libgtk1.2-dev gettext<br />
<br />
'''''Note 6:''' From aMule 2.0.0-rc1 to aMule 2.0.0-rc5 (inclusive) the package ''libcrypto++-dev'' is was necessary for compiling aMule, so if you are compiling any of such versions, apt-get libcrypto++-dev too.<br />
<br />
Also, you might be interested in installing libgd2-noxpm-dev if you plan to compile CAS. It is not a required library for compiling CAS, this library is only used by CAS for creating images (since v2.0.0-rc3) on the current aMule status (by running <code>cas -o</code>). If you plan to use this feature of CAS, you need to install LibGD2. Anyway, CAS will compile perfectly well even if LibGD2 isn't installed, since it detects, on compilation time, if this library is installed.''<br />
<br />
'''''Note 7:''' Woody users will most probably be unable to get libgd2-xpm-dev and libcurl3-dev since those packages aren't available for Woody. For libcurl3-dev you can just install libcurl2-dev and go on, everything will be ok For libgd2-xpm, at the moment there is no backport available but, since this library is only used by CAS (and suggested, not even required), it won't give any problems on compilation time. Just be aware that <code>cas -o</code> won't work.''<br />
<br />
2) Download the latest released [[aMule]] source code from [http://www.amule.org/files/files.php?cat=6 here] (or look [[AMule_CVS|here]] for an up-to-date link).<br />
<br />
'''''Note 8:''' From now on, I will suppose we are installing aMule 2.0.0-rc3''<br />
<br />
3) Fix Crypto++ Library 5.1 if using it.<br />
<br />
From [[aMule]] 2.0.0-rc1 to a aMule 1.0.0-rc5 (inclusive) this library is required because [[aMule]] is now supporting SecureIdent (remember, since aMule 2.0.0-rc6, libcrypto++ is optional and not needed by default), but the [[Libcrypto|Crypto++]] [[Debian]] package has had lots of compiling bugs and still has one (although the rest have been fixed after aMule team's reports). Remember you should have update and dist-upgraded apt-get before installing any [[Debian]] package in this HowTo, otherwise, you could be installing (or already have installed) a buggy Crypto++ package and this fix will not suit your needs. To fix the latest [[Libcrypto|crypto++]] [[Debian]] package only a symbolic link is needed:''<br />
<br />
ln -s /usr/include/crypto++/cryptopp_config.h /usr/include/crypto++/config.h<br />
<br />
''If you still can't compile crypto++, try compiling it after running the following command:''<br />
<br />
ln -s /usr/include/crypto++ /usr/include/cryptopp<br />
<br />
'''''Note 9:''' Since this link needs write permissions in /usr/lib, super-user (root) priviledges are needed. Again, this can be done easily with <code>"su"</code> or <code>"sudo"</code>.''<br />
<br />
== The hardest: Compiling [[aMule]] ==<br />
<br />
4) Extract the sources. The following will create a folder on your user's home directory where it will extract the sources with the -C switch into it (the following command understands that [[aMule]]'s sources are on the current directory):<br />
<br />
mkdir ~/aMule-compilation/ && tar xzfv aMule-2.0.0rc3.tar.gz -C ~/aMule-compilation/ && cd ~/aMule-compilation/<br />
<br />
'''''Note 10:''' Remember I'm supposing you are extracting [[aMule]] 2.0.0-rc3. Change the file name if it doesn't correspond to the actual packed source code filename.''<br />
<br />
5) Compile [[aMule]]! The following command will actually switch to the directory containing [[aMule]] 2.0.0rc3 and compile it:<br />
<br />
cd ~/aMule-compilation/aMule-2.0.0rc3/ && ./configure && make<br />
<br />
'''''Note 11:''' Please take a look at the [[configure|configure article]].''<br />
<br />
'''''Note 12:''' You should check the output of<br />
./configure --help | more<br />
to see if there is any configure switch which might be of your interest, such as --disable-debug --enable-optimise or --bindir= ''<br />
<br />
'''''Note 13:''' if you get an error message, while compiling, similar to: "In file included from /usr/include/wx/***:***, [...] /usr/include/wx/******:***: internal compiler error: Segmentation fault", then you most probably have problems with wxWidgets. Try with''<br />
<br />
apt-get install --reinstall wxwin2.4-headers libwxbase2.4 libwxgtk2.4-dev<br />
<br />
''which will reinstall wxWidgets and will most probably fix the compilation error.''<br />
<br />
== Meeting satisfaction: Installing aMule! ==<br />
<br />
8) What's left? Install aMule (remember you must be root, so log in as root or use <code>"su"</code> or <code>"sudo"</code>):<br />
<br />
make install<br />
<br />
Now you can remove the sources so you free up space in your hard disk by running:<br />
<br />
rm -rf ~/aMule-compilation/</code><br />
<br />
== The end: Final checks ==<br />
<br />
If you have sometime installed aMule from the Debian packages (no matter if the package came from http://gunnm.org/~soda ), you will have aMule binaries installed in /usr/bin. But <code>"make install"</code> installs binnaries in /usr/local/bin (unless --prefix= is set in configure). This leads us to the point that when typing "amule" anyone of the two installed aMule versions might be invoked (which one is executed will depend on the $PATH environment variable. You can check it by typing <code>"type amule"</code>). The walk around is very easy: remove the aMule installed through [[Debian]] package. You can do this with the command "apt-get remove amule" (do not use <code>"apt-get remove --purge"</code> or you might loose your [[aMule]] settings) or with <code>"dpkg --remove amule"</code> (again, never ever use <code>"dpkg --purge"</code> or you might loose your [[aMule]] settings). apt-get will remove aMule-utils if you have them installed (only available as a separate package in Sid, in Sarge and Woody aMule utils are included in the base aMule package) while dpkg will leave aMule-utils installed on the system (which, in general, is a bad idea).<br />
<br />
Also, if you installed xmule sometime or you are planing to install it, have in mind that the [[ed2k command]] exists both in [[aMule]] and [[xMule]]. You might want to run `type ed2k` to see which [[ed2k command]] will be executed and rename the other so you make sure it's never executed by mistake.<br />
<br />
== You're done... ==<br />
That's it! Your own compiled [[aMule]] is installed on your system and ready to go.<br />
<br />
To run [[aMule]], just type <code>"amule"</code>. You can check if everything worked by typing <code>"amule -v"</code> and check if the displayed version corresponds with the one you were compiling/installing.<br />
<br />
If this HowTo didn't help, you have a rare problem on your system ;-) Take a look at http://www.amule.org ([http://www.amule.org/amule aMule Forums] at http://forum.amule.org ) or visit us in #amule on irc.freenode.net and (don't doubt) we'll try to do our best to help you.<br />
<br />
== Final notes ==<br />
<br />
If you are in one of those rare cases when you wish to compile [[aMule]] statically, install also ''libtiff4-dev'' (through ''apt-get install libtiff4-dev''). Anyway, this is '''NOT''' recommended and, in fact, will probably not do any better or even, not work at all.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=HowTo_Compile_In_Debian/UbuntuHowTo Compile In Debian/Ubuntu2005-05-19T08:43:11Z<p>JohnGH: =The easiest: Preparing the system=</p>
<hr />
<div>HowTo compile aMule in [[Debian]] by ''[[User:Jacobo221|Jacobo221]]''<br />
<br />
Very special thanks to ''darknox'', ''Arathornz'', ''guest234'', ''parasito'', ''maya'' and ''klando'' for their tests!<br />
<br />
'''NOTE:''' This howto will also work for [http://www.ubuntulinux.com Ubuntu Linux].<br />
<br />
== Are you sure you want to compile? ==<br />
<br />
You can just install latest [[aMule CVS]] through debs adding the following lines into your ''/etc/apt/sources.list'' file:<br />
<br />
deb http://www.vollstreckernet.de/debian/ testing amule<br />
deb http://www.vollstreckernet.de/debian/ testing wx<br />
<br />
'''NOTE:''' The second line is necessary for Sarge users and strongly recommended for Sid users.<br />
<br />
Now run ''apt-get update && apt-get install amule''<br />
<br />
You might also want to take a look at the other available [[aMule]] utilities:<br />
*amule<br />
*amule-common<br />
*amuled<br />
*amule-remote-gui<br />
*amuleweb<br />
*amulewebdlg<br />
*amule-cas<br />
*amule-wxcas<br />
*amule-xas<br />
*amule-utils<br />
<br />
If you still want to compile aMule instead of just installing a binary, keep reading...<br />
<br />
== Notes before starting ==<br />
<br />
'''Important:''' Have in mind that this HowTo was done having in mind aMule 2.0.0 or greater in [[Debian]] 3.0 (Woody/Sarge/Sid).<br />
<br />
This HowTo is based on using the apt-get package installer tool, which means you'll have to be able to get super-user (root) access. Also, apt-get requires a perfect packet dependencies installed system. If you usually use apt-get for installing any application, skip this and go to the next section. If you rarely use apt-get but, instead, use dpkg, you can;<br />
<br />
A) (Recommended) Solve all the dependencies problems on your system. This can be done by taking a look at the <code>"dpkg -C"</code> output and installing/removing/updating the packages it mentions depending on what's required. This option is the recommended since it will not only ensure your aMule compilation will be most surely correct, but it will also make your system the most stable it can possibly be and from now on you'll be able to use apt-get to not only make easier installations, but also to easily upgrade your system.<br />
<br />
B) Force apt-get to ignore the dependencies problems using the -f or --fix-broken switches (just one of them, since they're exactly the same, so that'd be, for example, <code>"apt-get install -f ..."</code>). This option may cause a corrupt installation of some packages which may cause the apps not to work. Also have in mind that using this switch in a system with dependencies problems may cause the system to completely break if the package being installed is a base package (although this is not the case).<br />
<br />
C) Follow this instructions but, instead of using <code>"apt-get install foo"</code>, use <code>"dpkg -i foo"</code> where foo is the package to install. Remember the packages must be already on the system when installing packages with dpkg. Remember also to download any "Depends" package since it most-surely will be necessary for successfully compiling [[aMule]]. Avoid using whichever of the following dpkg switches: --force-all --force-depends-version --force-depends --force-conflicts<br />
<br />
If you usually install applications from source, read deltaHF's [[Compilation_Installation|"aMule compilation / installation HowTo"]] since your system might not be complying the Debian aMule package dependencies although <code>"dpkg -C"</code> shows no errors.<br />
<br />
== The easiest: Preparing the system ==<br />
<br />
Once you decided to use apt-get, you must make sure you'll be downloading the latest versions of the packages (aMule team has discovered bugs in some deb packages that would make aMule impossible to compile on Debian without compiling some other libraries too. This bugs have been mostly fixed in those affected debian packages, so it is very important to be sure to have the packages up to date). This is done by issuing:<br />
<br />
apt-get update && apt-get dist-upgrade<br />
<br />
'''''Note 1:''' You must be root user to do this. Log in as root or <code>"su"</code> or use <code>"sudo"</code>. NB: <code>"sudo"</code> must be specified on both apt-get commands, that is:''<br />
<br />
sudo apt-get update && sudo apt-get dist-upgrade<br />
<br />
''<code>"sudo"</code> is not a base command, so it may not be installed on your system, although it most probably will. Be aware that following this HowTo entirely as root may bring some problems later such as being unable to delete certain files as a normal user, so please only use root priviledges when necessary.''<br />
<br />
'''''Note 2:''' Woody users (that is, people stuck in the stable Debian 3.0 branch) will be unable to install the wxGTK, wxbase and Crypto++ libraries since they were not available in the current minimum compatible versions (2.4.2 and 2.5.1 respectively) when Woody was released.''<br />
<br />
''The best for Woody users is to switch to the Sarge or Sid branch.<br />
That can be done with the following command (again, you must be root)''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/testing/g" /etc/apt/sources.list<br />
<br />
''or''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sarge/g" /etc/apt/sources.list<br />
<br />
''to switch to the Sarge/testing branch, or with''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/unstable/g" /etc/apt/sources.list<br />
''or''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sid/g" /etc/apt/sources.list<br />
<br />
''to switch to the Sid/unstable branch.''<br />
<br />
''If Woody users are not be interested in switching to Sarge they will need to download Woody-backported debian packages by adding the following line to /etc/apt/sources.list (remember to <code>"apt-get update"</code> after adding this line):''<br />
<br />
deb http://debian.thermoman.de/ woody wxwindows2.4 libcrypto++<br />
<br />
What's more, [http://www.thermoman.de thermoman] stopped working on the [[aMule]] backports for [http://www.debian.org Woody] on the [[aMule]] 2.0.0-rc5 release, so newer [[aMule]] releases backports are unavailable. Sorry.<br />
<br />
'''''Note 3:''' Sarge users won't have any dependecy problems any longer, since both crypto++ and wxWidgets have both been in Sarge for some time now.<br />
So, there's no longer any need to update ''sources.list'' on Debian Sarge distributions.''<br />
<br />
'''''Note 4:''' Sid users (that is, people holding the cutting-edge unstable Debian 3.0 branch) could suffer problems from packages not completely implemented or with broken dependencies (both are normal issues in the unstable branch). It is very important to keep this in mind since a compiler (g++) will be installed so it could also be broken and, with it, most applications compiled with it (once upgraded, of course). If a package was broken, to downgrade you can use the --force-downgrade switch with dpkg.''<br />
<br />
If for whatever reason you think this is too much of a complication, you can just wait a few days until the aMule binary version comes out for your architecture (that is, a .deb file).<br />
<br />
== The fastest: Installing the necessary packages ==<br />
Remember you need to be root to install applications using apt-get, since apt-get installs system-wide applications. So, log in as root, use "su" or add "sudo" before every command shown here.<br />
<br />
The following are the packages which must be installed:<br />
<br />
1) Install the latest stable g++ compiler and the C++ Standard Library<br />
<br />
apt-get install g++<br />
<br />
the required libraries for compiling [[aMule]] (wxbase is not really a requiered packet to compile aMule but, unless you know what you're doing, be sure you install it. I won't show in this this guide how to force aMule's compilation without wxbase):<br />
<br />
apt-get install libwxbase2.4-dev libcurl3-dev libgtk1.2-dev libwxgtk2.4-dev<br />
<br />
Alternatively you can use <code>apt-get build-dep amule</code> to get all the required depencies for compilation. Anyway, this last method is not sure to work, since it will depend on the latest version on the Debian repository and later versions or CVS versions might have different dependencies.<br />
And the required utilities for compiling [[aMule]], at the moment only gettext (necessary for internationalization support):<br />
<br />
apt-get install gettext<br />
<br />
'''''Note 5:''' This can all be done in a single command line, which might be more handy for users using <code>"sudo"</code> to gain root priviledges:''<br />
<br />
apt-get install g++ libwxbase2.4-dev libcurl3-dev libgtk1.2-dev gettext<br />
<br />
'''''Note 6:''' From aMule 2.0.0-rc1 to aMule 2.0.0-rc5 (inclusive) the package ''libcrypto++-dev'' is was necessary for compiling aMule, so if you are compiling any of such versions, apt-get libcrypto++-dev too.<br />
<br />
Also, you might be interested in installing libgd2-noxpm-dev if you plan to compile CAS. It is not a required library for compiling CAS, this library is only used by CAS for creating images (since v2.0.0-rc3) on the current aMule status (by running <code>cas -o</code>). If you plan to use this feature of CAS, you need to install LibGD2. Anyway, CAS will compile perfectly well even if LibGD2 isn't installed, since it detects, on compilation time, if this library is installed.''<br />
<br />
'''''Note 7:''' Woody users will most probably be unable to get libgd2-xpm-dev and libcurl3-dev since those packages aren't available for Woody. For libcurl3-dev you can just install libcurl2-dev and go on, everything will be ok For libgd2-xpm, at the moment there is no backport available but, since this library is only used by CAS (and suggested, not even required), it won't give any problems on compilation time. Just be aware that <code>cas -o</code> won't work.''<br />
<br />
2) Download the latest released [[aMule]] source code from [http://www.amule.org/files/files.php?cat=6 here] (or look [[AMule_CVS|here]] for an up-to-date link).<br />
<br />
'''''Note 8:''' From now on, I will suppose we are installing aMule 2.0.0-rc3''<br />
<br />
3) Fix Crypto++ Library 5.1 if using it.<br />
<br />
From [[aMule]] 2.0.0-rc1 to a aMule 1.0.0-rc5 (inclusive) this library is required because [[aMule]] is now supporting SecureIdent (remember, since aMule 2.0.0-rc6, libcrypto++ is optional and not needed by default), but the [[Libcrypto|Crypto++]] [[Debian]] package has had lots of compiling bugs and still has one (although the rest have been fixed after aMule team's reports). Remember you should have update and dist-upgraded apt-get before installing any [[Debian]] package in this HowTo, otherwise, you could be installing (or already have installed) a buggy Crypto++ package and this fix will not suit your needs. To fix the latest [[Libcrypto|crypto++]] [[Debian]] package only a symbolic link is needed:''<br />
<br />
ln -s /usr/include/crypto++/cryptopp_config.h /usr/include/crypto++/config.h<br />
<br />
''If you still can't compile crypto++, try compiling it after running the following command:''<br />
<br />
ln -s /usr/include/crypto++ /usr/include/cryptopp<br />
<br />
'''''Note 9:''' Since this link needs write permissions in /usr/lib, super-user (root) priviledges are needed. Again, this can be done easily with <code>"su"</code> or <code>"sudo"</code>.''<br />
<br />
== The hardest: Compiling [[aMule]] ==<br />
<br />
4) Extract the sources. The following will create a folder on your user's home directory where it will extract the sources with the -C switch into it (the following command understands that [[aMule]]'s sources are on the current directory):<br />
<br />
mkdir ~/aMule-compilation/ && tar xzfv aMule-2.0.0rc3.tar.gz -C ~/aMule-compilation/ && cd ~/aMule-compilation/<br />
<br />
'''''Note 10:''' Remember I'm supposing you are extracting [[aMule]] 2.0.0-rc3. Change the file name if it doesn't correspond to the actual packed source code filename.''<br />
<br />
5) Compile [[aMule]]! The following command will actually switch to the directory containing [[aMule]] 2.0.0rc3 and compile it:<br />
<br />
cd ~/aMule-compilation/aMule-2.0.0rc3/ && ./configure && make<br />
<br />
'''''Note 11:''' Please take a look at the [[configure|configure article]].''<br />
<br />
'''''Note 12:''' You should check the output of<br />
./configure --help | more<br />
to see if there is any configure switch which might be of your interest, such as --disable-debug --enable-optimise or --bindir= ''<br />
<br />
'''''Note 13:''' if you get an error message, while compiling, similar to: "In file included from /usr/include/wx/***:***, [...] /usr/include/wx/******:***: internal compiler error: Segmentation fault", then you most probably have problems with wxWidgets. Try with''<br />
<br />
apt-get install --reinstall wxwin2.4-headers libwxbase2.4 libwxgtk2.4-dev<br />
<br />
''which will reinstall wxWidgets and will most probably fix the compilation error.''<br />
<br />
== Meeting satisfaction: Installing aMule! ==<br />
<br />
8) What's left? Install aMule (remember you must be root, so log in as root or use <code>"su"</code> or <code>"sudo"</code>):<br />
<br />
make install<br />
<br />
Now you can remove the sources so you free up space in your hard disk by running:<br />
<br />
rm -rf ~/aMule-compilation/</code><br />
<br />
== The end: Final checks ==<br />
<br />
If you have sometime installed aMule from the Debian packages (no matter if the package came from http://gunnm.org/~soda ), you will have aMule binaries installed in /usr/bin. But <code>"make install"</code> installs binnaries in /usr/local/bin (unless --prefix= is set in configure). This leads us to the point that when typing "amule" anyone of the two installed aMule versions might be invoked (which one is executed will depend on the $PATH environment variable. You can check it by typing <code>"type amule"</code>). The walk around is very easy: remove the aMule installed through [[Debian]] package. You can do this with the command "apt-get remove amule" (do not use <code>"apt-get remove --purge"</code> or you might loose your [[aMule]] settings) or with <code>"dpkg --remove amule"</code> (again, never ever use <code>"dpkg --purge"</code> or you might loose your [[aMule]] settings). apt-get will remove aMule-utils if you have them installed (only available as a separate package in Sid, in Sarge and Woody aMule utils are included in the base aMule package) while dpkg will leave aMule-utils installed on the system (which, in general, is a bad idea).<br />
<br />
Also, if you installed xmule sometime or you are planing to install it, have in mind that the [[ed2k command]] exists both in [[aMule]] and [[xMule]]. You might want to run `type ed2k` to see which [[ed2k command]] will be executed and rename the other so you make sure it's never executed by mistake.<br />
<br />
== You're done... ==<br />
That's it! Your own compiled [[aMule]] is installed on your system and ready to go.<br />
<br />
To run [[aMule]], just type <code>"amule"</code>. You can check if everything worked by typing <code>"amule -v"</code> and check if the displayed version corresponds with the one you were compiling/installing.<br />
<br />
If this HowTo didn't help, you have a rare problem on your system ;-) Take a look at http://www.amule.org ([http://www.amule.org/amule aMule Forums] at http://forum.amule.org ) or visit us in #amule on irc.freenode.net and (don't doubt) we'll try to do our best to help you.<br />
<br />
== Final notes ==<br />
<br />
If you are in one of those rare cases when you wish to compile [[aMule]] statically, install also ''libtiff4-dev'' (through ''apt-get install libtiff4-dev''). Anyway, this is '''NOT''' recommended and, in fact, will probably not do any better or even, not work at all.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=HowTo_Compile_In_Debian/UbuntuHowTo Compile In Debian/Ubuntu2005-05-19T08:42:40Z<p>JohnGH: </p>
<hr />
<div>HowTo compile aMule in [[Debian]] by ''[[User:Jacobo221|Jacobo221]]''<br />
<br />
Very special thanks to ''darknox'', ''Arathornz'', ''guest234'', ''parasito'', ''maya'' and ''klando'' for their tests!<br />
<br />
'''NOTE:''' This howto will also work for [http://www.ubuntulinux.com Ubuntu Linux].<br />
<br />
== Are you sure you want to compile? ==<br />
<br />
You can just install latest [[aMule CVS]] through debs adding the following lines into your ''/etc/apt/sources.list'' file:<br />
<br />
deb http://www.vollstreckernet.de/debian/ testing amule<br />
deb http://www.vollstreckernet.de/debian/ testing wx<br />
<br />
'''NOTE:''' The second line is necessary for Sarge users and strongly recommended for Sid users.<br />
<br />
Now run ''apt-get update && apt-get install amule''<br />
<br />
You might also want to take a look at the other available [[aMule]] utilities:<br />
*amule<br />
*amule-common<br />
*amuled<br />
*amule-remote-gui<br />
*amuleweb<br />
*amulewebdlg<br />
*amule-cas<br />
*amule-wxcas<br />
*amule-xas<br />
*amule-utils<br />
<br />
If you still want to compile aMule instead of just installing a binary, keep reading...<br />
<br />
== Notes before starting ==<br />
<br />
'''Important:''' Have in mind that this HowTo was done having in mind aMule 2.0.0 or greater in [[Debian]] 3.0 (Woody/Sarge/Sid).<br />
<br />
This HowTo is based on using the apt-get package installer tool, which means you'll have to be able to get super-user (root) access. Also, apt-get requires a perfect packet dependencies installed system. If you usually use apt-get for installing any application, skip this and go to the next section. If you rarely use apt-get but, instead, use dpkg, you can;<br />
<br />
A) (Recommended) Solve all the dependencies problems on your system. This can be done by taking a look at the <code>"dpkg -C"</code> output and installing/removing/updating the packages it mentions depending on what's required. This option is the recommended since it will not only ensure your aMule compilation will be most surely correct, but it will also make your system the most stable it can possibly be and from now on you'll be able to use apt-get to not only make easier installations, but also to easily upgrade your system.<br />
<br />
B) Force apt-get to ignore the dependencies problems using the -f or --fix-broken switches (just one of them, since they're exactly the same, so that'd be, for example, <code>"apt-get install -f ..."</code>). This option may cause a corrupt installation of some packages which may cause the apps not to work. Also have in mind that using this switch in a system with dependencies problems may cause the system to completely break if the package being installed is a base package (although this is not the case).<br />
<br />
C) Follow this instructions but, instead of using <code>"apt-get install foo"</code>, use <code>"dpkg -i foo"</code> where foo is the package to install. Remember the packages must be already on the system when installing packages with dpkg. Remember also to download any "Depends" package since it most-surely will be necessary for successfully compiling [[aMule]]. Avoid using whichever of the following dpkg switches: --force-all --force-depends-version --force-depends --force-conflicts<br />
<br />
If you usually install applications from source, read deltaHF's [[Compilation_Installation|"aMule compilation / installation HowTo"]] since your system might not be complying the Debian aMule package dependencies although <code>"dpkg -C"</code> shows no errors.<br />
<br />
== The easiest: Preparing the system ==<br />
<br />
Once you decided to use apt-get, you must make sure you'll be downloading the latest versions of the packages (aMule team has discovered bugs in some deb packages that would make aMule impossible to compile on Debian without compiling some other libraries too. This bugs have been mostly fixed in those affected debian packages, so it is very important to be sure to have the packages up to date). This is done by issuing:<br />
<br />
apt-get update && apt-get dist-upgrade<br />
<br />
'''''Note 1:''' You must be root user to do this. Log in as root or <code>"su"</code> or use <code>"sudo"</code>. NB: <code>"sudo"</code> must be specified on both apt-get commands, that is:''<br />
<br />
"sudo apt-get update && sudo apt-get dist-upgrade"<br />
<br />
''<code>"sudo"</code> is not a base command, so it may not be installed on your system, although it most probably will. Be aware that following this HowTo entirely as root may bring some problems later such as being unable to delete certain files as a normal user, so please only use root priviledges when necessary.''<br />
<br />
'''''Note 2:''' Woody users (that is, people stuck in the stable Debian 3.0 branch) will be unable to install the wxGTK, wxbase and Crypto++ libraries since they were not available in the current minimum compatible versions (2.4.2 and 2.5.1 respectively) when Woody was released.''<br />
<br />
''The best for Woody users is to switch to the Sarge or Sid branch.<br />
That can be done with the following command (again, you must be root)''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/testing/g" /etc/apt/sources.list<br />
<br />
''or''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sarge/g" /etc/apt/sources.list<br />
<br />
''to switch to the Sarge/testing branch, or with''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/unstable/g" /etc/apt/sources.list<br />
''or''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sid/g" /etc/apt/sources.list<br />
<br />
''to switch to the Sid/unstable branch.''<br />
<br />
''If Woody users are not be interested in switching to Sarge they will need to download Woody-backported debian packages by adding the following line to /etc/apt/sources.list (remember to <code>"apt-get update"</code> after adding this line):''<br />
<br />
deb http://debian.thermoman.de/ woody wxwindows2.4 libcrypto++<br />
<br />
What's more, [http://www.thermoman.de thermoman] stopped working on the [[aMule]] backports for [http://www.debian.org Woody] on the [[aMule]] 2.0.0-rc5 release, so newer [[aMule]] releases backports are unavailable. Sorry.<br />
<br />
'''''Note 3:''' Sarge users won't have any dependecy problems any longer, since both crypto++ and wxWidgets have both been in Sarge for some time now.<br />
So, there's no longer any need to update ''sources.list'' on Debian Sarge distributions.''<br />
<br />
'''''Note 4:''' Sid users (that is, people holding the cutting-edge unstable Debian 3.0 branch) could suffer problems from packages not completely implemented or with broken dependencies (both are normal issues in the unstable branch). It is very important to keep this in mind since a compiler (g++) will be installed so it could also be broken and, with it, most applications compiled with it (once upgraded, of course). If a package was broken, to downgrade you can use the --force-downgrade switch with dpkg.''<br />
<br />
If for whatever reason you think this is too much of a complication, you can just wait a few days until the aMule binary version comes out for your architecture (that is, a .deb file).<br />
<br />
== The fastest: Installing the necessary packages ==<br />
Remember you need to be root to install applications using apt-get, since apt-get installs system-wide applications. So, log in as root, use "su" or add "sudo" before every command shown here.<br />
<br />
The following are the packages which must be installed:<br />
<br />
1) Install the latest stable g++ compiler and the C++ Standard Library<br />
<br />
apt-get install g++<br />
<br />
the required libraries for compiling [[aMule]] (wxbase is not really a requiered packet to compile aMule but, unless you know what you're doing, be sure you install it. I won't show in this this guide how to force aMule's compilation without wxbase):<br />
<br />
apt-get install libwxbase2.4-dev libcurl3-dev libgtk1.2-dev libwxgtk2.4-dev<br />
<br />
Alternatively you can use <code>apt-get build-dep amule</code> to get all the required depencies for compilation. Anyway, this last method is not sure to work, since it will depend on the latest version on the Debian repository and later versions or CVS versions might have different dependencies.<br />
And the required utilities for compiling [[aMule]], at the moment only gettext (necessary for internationalization support):<br />
<br />
apt-get install gettext<br />
<br />
'''''Note 5:''' This can all be done in a single command line, which might be more handy for users using <code>"sudo"</code> to gain root priviledges:''<br />
<br />
apt-get install g++ libwxbase2.4-dev libcurl3-dev libgtk1.2-dev gettext<br />
<br />
'''''Note 6:''' From aMule 2.0.0-rc1 to aMule 2.0.0-rc5 (inclusive) the package ''libcrypto++-dev'' is was necessary for compiling aMule, so if you are compiling any of such versions, apt-get libcrypto++-dev too.<br />
<br />
Also, you might be interested in installing libgd2-noxpm-dev if you plan to compile CAS. It is not a required library for compiling CAS, this library is only used by CAS for creating images (since v2.0.0-rc3) on the current aMule status (by running <code>cas -o</code>). If you plan to use this feature of CAS, you need to install LibGD2. Anyway, CAS will compile perfectly well even if LibGD2 isn't installed, since it detects, on compilation time, if this library is installed.''<br />
<br />
'''''Note 7:''' Woody users will most probably be unable to get libgd2-xpm-dev and libcurl3-dev since those packages aren't available for Woody. For libcurl3-dev you can just install libcurl2-dev and go on, everything will be ok For libgd2-xpm, at the moment there is no backport available but, since this library is only used by CAS (and suggested, not even required), it won't give any problems on compilation time. Just be aware that <code>cas -o</code> won't work.''<br />
<br />
2) Download the latest released [[aMule]] source code from [http://www.amule.org/files/files.php?cat=6 here] (or look [[AMule_CVS|here]] for an up-to-date link).<br />
<br />
'''''Note 8:''' From now on, I will suppose we are installing aMule 2.0.0-rc3''<br />
<br />
3) Fix Crypto++ Library 5.1 if using it.<br />
<br />
From [[aMule]] 2.0.0-rc1 to a aMule 1.0.0-rc5 (inclusive) this library is required because [[aMule]] is now supporting SecureIdent (remember, since aMule 2.0.0-rc6, libcrypto++ is optional and not needed by default), but the [[Libcrypto|Crypto++]] [[Debian]] package has had lots of compiling bugs and still has one (although the rest have been fixed after aMule team's reports). Remember you should have update and dist-upgraded apt-get before installing any [[Debian]] package in this HowTo, otherwise, you could be installing (or already have installed) a buggy Crypto++ package and this fix will not suit your needs. To fix the latest [[Libcrypto|crypto++]] [[Debian]] package only a symbolic link is needed:''<br />
<br />
ln -s /usr/include/crypto++/cryptopp_config.h /usr/include/crypto++/config.h<br />
<br />
''If you still can't compile crypto++, try compiling it after running the following command:''<br />
<br />
ln -s /usr/include/crypto++ /usr/include/cryptopp<br />
<br />
'''''Note 9:''' Since this link needs write permissions in /usr/lib, super-user (root) priviledges are needed. Again, this can be done easily with <code>"su"</code> or <code>"sudo"</code>.''<br />
<br />
== The hardest: Compiling [[aMule]] ==<br />
<br />
4) Extract the sources. The following will create a folder on your user's home directory where it will extract the sources with the -C switch into it (the following command understands that [[aMule]]'s sources are on the current directory):<br />
<br />
mkdir ~/aMule-compilation/ && tar xzfv aMule-2.0.0rc3.tar.gz -C ~/aMule-compilation/ && cd ~/aMule-compilation/<br />
<br />
'''''Note 10:''' Remember I'm supposing you are extracting [[aMule]] 2.0.0-rc3. Change the file name if it doesn't correspond to the actual packed source code filename.''<br />
<br />
5) Compile [[aMule]]! The following command will actually switch to the directory containing [[aMule]] 2.0.0rc3 and compile it:<br />
<br />
cd ~/aMule-compilation/aMule-2.0.0rc3/ && ./configure && make<br />
<br />
'''''Note 11:''' Please take a look at the [[configure|configure article]].''<br />
<br />
'''''Note 12:''' You should check the output of<br />
./configure --help | more<br />
to see if there is any configure switch which might be of your interest, such as --disable-debug --enable-optimise or --bindir= ''<br />
<br />
'''''Note 13:''' if you get an error message, while compiling, similar to: "In file included from /usr/include/wx/***:***, [...] /usr/include/wx/******:***: internal compiler error: Segmentation fault", then you most probably have problems with wxWidgets. Try with''<br />
<br />
apt-get install --reinstall wxwin2.4-headers libwxbase2.4 libwxgtk2.4-dev<br />
<br />
''which will reinstall wxWidgets and will most probably fix the compilation error.''<br />
<br />
== Meeting satisfaction: Installing aMule! ==<br />
<br />
8) What's left? Install aMule (remember you must be root, so log in as root or use <code>"su"</code> or <code>"sudo"</code>):<br />
<br />
make install<br />
<br />
Now you can remove the sources so you free up space in your hard disk by running:<br />
<br />
rm -rf ~/aMule-compilation/</code><br />
<br />
== The end: Final checks ==<br />
<br />
If you have sometime installed aMule from the Debian packages (no matter if the package came from http://gunnm.org/~soda ), you will have aMule binaries installed in /usr/bin. But <code>"make install"</code> installs binnaries in /usr/local/bin (unless --prefix= is set in configure). This leads us to the point that when typing "amule" anyone of the two installed aMule versions might be invoked (which one is executed will depend on the $PATH environment variable. You can check it by typing <code>"type amule"</code>). The walk around is very easy: remove the aMule installed through [[Debian]] package. You can do this with the command "apt-get remove amule" (do not use <code>"apt-get remove --purge"</code> or you might loose your [[aMule]] settings) or with <code>"dpkg --remove amule"</code> (again, never ever use <code>"dpkg --purge"</code> or you might loose your [[aMule]] settings). apt-get will remove aMule-utils if you have them installed (only available as a separate package in Sid, in Sarge and Woody aMule utils are included in the base aMule package) while dpkg will leave aMule-utils installed on the system (which, in general, is a bad idea).<br />
<br />
Also, if you installed xmule sometime or you are planing to install it, have in mind that the [[ed2k command]] exists both in [[aMule]] and [[xMule]]. You might want to run `type ed2k` to see which [[ed2k command]] will be executed and rename the other so you make sure it's never executed by mistake.<br />
<br />
== You're done... ==<br />
That's it! Your own compiled [[aMule]] is installed on your system and ready to go.<br />
<br />
To run [[aMule]], just type <code>"amule"</code>. You can check if everything worked by typing <code>"amule -v"</code> and check if the displayed version corresponds with the one you were compiling/installing.<br />
<br />
If this HowTo didn't help, you have a rare problem on your system ;-) Take a look at http://www.amule.org ([http://www.amule.org/amule aMule Forums] at http://forum.amule.org ) or visit us in #amule on irc.freenode.net and (don't doubt) we'll try to do our best to help you.<br />
<br />
== Final notes ==<br />
<br />
If you are in one of those rare cases when you wish to compile [[aMule]] statically, install also ''libtiff4-dev'' (through ''apt-get install libtiff4-dev''). Anyway, this is '''NOT''' recommended and, in fact, will probably not do any better or even, not work at all.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=HowTo_Compile_In_Debian/UbuntuHowTo Compile In Debian/Ubuntu2005-05-19T08:35:35Z<p>JohnGH: </p>
<hr />
<div>HowTo compile aMule in [[Debian]] by ''[[User:Jacobo221|Jacobo221]]''<br />
<br />
Very special thanks to ''darknox'', ''Arathornz'', ''guest234'', ''parasito'', ''maya'' and ''klando'' for their tests!<br />
<br />
'''NOTE:''' This howto will also work for [http://www.ubuntulinux.com Ubuntu Linux].<br />
<br />
== Are you sure you want to compile? ==<br />
<br />
You can just install latest [[aMule CVS]] through debs adding the following lines into your ''/etc/apt/sources.list'' file:<br />
<br />
deb http://www.vollstreckernet.de/debian/ testing amule<br />
deb http://www.vollstreckernet.de/debian/ testing wx<br />
<br />
'''NOTE:''' The second line is necessary for Sarge users and strongly recommended for Sid users.<br />
<br />
Now run ''apt-get update && apt-get install amule''<br />
<br />
You might also want to take a look at the other available [[aMule]] utilities:<br />
*amule<br />
*amule-common<br />
*amuled<br />
*amule-remote-gui<br />
*amuleweb<br />
*amulewebdlg<br />
*amule-cas<br />
*amule-wxcas<br />
*amule-xas<br />
*amule-utils<br />
<br />
If you still want to compile aMule instead of just installing a binary, keep reading...<br />
<br />
== Notes before starting ==<br />
<br />
'''Important:''' Have in mind that this HowTo was done having in mind aMule 2.0.0 or greater in [[Debian]] 3.0 (Woody/Sarge/Sid).<br />
<br />
This HowTo is based on using the apt-get package installer tool, which means you'll have to be able to get super-user (root) access. Also, apt-get requires a perfect packet dependencies installed system. If you usually use apt-get for installing any application, skip this and go to the next section. If you rarely use apt-get but, instead, use dpkg, you can;<br />
<br />
A) (Recommended) Solve all the dependencies problems on your system. This can be done by taking a look at the <code>"dpkg -C"</code> output and installing/removing/updating the packages it mentions depending on what's required. This option is the recommended since it will not only ensure your aMule compilation will be most surely correct, but it will also make your system the most stable it can possibly be and from now on you'll be able to use apt-get to not only make easier installations, but also to easily upgrade your system.<br />
<br />
B) Force apt-get to ignore the dependencies problems using the -f or --fix-broken switches (just one of them, since they're exactly the same, so that'd be, for example, <code>"apt-get install -f ..."</code>). This option may cause a corrupt installation of some packages which may cause the apps not to work. Also have in mind that using this switch in a system with dependencies problems may cause the system to completely break if the package being installed is a base package (although this is not the case).<br />
<br />
C) Follow this instructions but, instead of using <code>"apt-get install foo"</code>, use <code>"dpkg -i foo"</code> where foo is the package to install. Remember the packages must be already on the system when installing packages with dpkg. Remember also to download any "Depends" package since it most-surely will be necessary for successfully compiling [[aMule]]. Avoid using whichever of the following dpkg switches: --force-all --force-depends-version --force-depends --force-conflicts<br />
<br />
If you usually install applications from source, read deltaHF's [[Compilation_Installation|"aMule compilation / installation HowTo"]] since your system might not be complying the Debian aMule package dependencies although <code>"dpkg -C"</code> shows no errors.<br />
<br />
== The easiest: Preparing the system ==<br />
<br />
Once you decided to use apt-get, you must make sure you'll be downloading the latest versions of the packages (aMule team has discovered bugs in some deb packages that would make aMule impossible to compile on Debian without compiling some other libraries too. This bugs have been mostly fixed in those affected debian packages, so it is very important to be sure to have the packages up to date). This is done by issuing:<br />
<br />
apt-get update && apt-get dist-upgrade<br />
<br />
'''''Note 1:''' You must be root user to do this. Log in as root or <code>"su"</code> or use <code>"sudo"</code>. NB: <code>"sudo"</code> must be specified on both apt-get commands, that is:''<br />
<br />
"sudo apt-get update && sudo apt-get dist-upgrade"<br />
<br />
''<code>"sudo"</code> is not a base command, so it may not be installed on your system, although it most probably will. Be aware that following this HowTo entirely as root may bring some problems later such as being unable to delete certain files as a normal user, so please only use root priviledges when necessary.''<br />
<br />
'''''Note 2:''' Woody users (that is, people stuck in the stable Debian 3.0 branch) will be unable to install the wxGTK, wxbase and Crypto++ libraries since they were not available in the current minimum compatible versions (2.4.2 and 2.5.1 respectively) when Woody was released.''<br />
<br />
''The best for Woody users is to switch to the Sarge or Sid branch.<br />
That can be done with the following command (again, you must be root)''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/testing/g" /etc/apt/sources.list<br />
<br />
''or''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sarge/g" /etc/apt/sources.list<br />
<br />
''to switch to the Sarge/testing branch, or with''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/unstable/g" /etc/apt/sources.list<br />
''or''<br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sid/g" /etc/apt/sources.list<br />
<br />
''to switch to the Sid/unstable branch.''<br />
<br />
''If Woody users are not be interested in switching to Sarge they will need to download Woody-backported debian packages by adding the following line to /etc/apt/sources.list (remember to <code>"apt-get update"</code> after adding this line):''<br />
<br />
deb http://debian.thermoman.de/ woody wxwindows2.4 libcrypto++<br />
<br />
What's more, [http://www.thermoman.de thermoman] stopped working on the [[aMule]] backports for [http://www.debian.org Woody] on the [[aMule]] 2.0.0-rc5 release, so newer [[aMule]] releases backports are unavailable. Sorry.<br />
<br />
'''''Note 3:''' Sarge users won't have any dependecy problems any longer, since both crypto++ and wxWidgets have both been in Sarge for some time now.<br />
So, there's no longer any need to update ''sources.list'' on Debian Sarge distributions.''<br />
<br />
'''''Note 4:''' Sid users (that is, people holding the cutting-edge unstable Debian 3.0 branch) could suffer problems from packages not completely implemented or with broken dependencies (both are normal issues in the unstable branch). It is very important to keep this in mind since a compiler (g++) will be installed so it could also be broken and, with it, most applications compiled with it (once upgraded, of course). If a package was broken, to downgrade you can use the --force-downgrade switch with dpkg.''<br />
<br />
If for whatever reason you think this is too much of a complication, you can just wait a few days until the aMule binary version comes out for your architecture (that is, a .deb file).<br />
<br />
== The fastest: Installing the necessary packages ==<br />
Remember you need to be root to install applications using apt-get, since apt-get installs system-wide applications. So, log in as root, use "su" or add "sudo" before every command shown here.<br />
<br />
The following are the packages which must be installed:<br />
<br />
1) Install the latest stable g++ compiler and the C++ Standard Library<br />
<br />
apt-get install g++<br />
<br />
the required libraries for compiling [[aMule]] (wxbase is not really a requiered packet to compile aMule but, unless you know what you're doing, be sure you install it. I won't show in this this guide how to force aMule's compilation without wxbase):<br />
<br />
apt-get install libwxbase2.4-dev libcurl3-dev libgtk1.2-dev libwxgtk2.4-dev<br />
<br />
Alternatively you can use <code>apt-get build-dep amule</code> to get all the required depencies for compilation. Anyway, this last method is not sure to work, since it will depend on the latest version on the Debian repository and later versions or CVS versions might have different dependencies.<br />
And the required utilities for compiling [[aMule]], at the moment only gettext (necessary for internationalization support):<br />
<br />
apt-get install gettext<br />
<br />
'''''Note 5:''' This can all be done in a single command line, which might be more handy for users using <code>"sudo"</code> to gain root priviledges: <code>apt-get install g++ libwxbase2.4-dev libcurl3-dev libgtk1.2-dev gettext</code>''<br><br />
'''''Note 6:''' From aMule 2.0.0-rc1 to aMule 2.0.0-rc5 (inclusive) the package ''libcrypto++-dev'' is was necessary for compiling aMule, so if you are compiling any of such versions, apt-get libcrypto++-dev too.<br><br />
Also, you might be interested in installing libgd2-noxpm-dev if you plan to compile CAS. It is not a required library for compiling CAS, this library is only used by CAS for creating images (since v2.0.0-rc3) on the current aMule status (by running <code>cas -o</code>). If you plan to use this feature of CAS, you need to install LibGD2. Anyway, CAS will compile perfectly well even if LibGD2 isn't installed, since it detects, on compilation time, if this library is installed.''<br><br />
'''''Note 7:''' Woody users will most probably be unable to get libgd2-xpm-dev and libcurl3-dev since those packages aren't available for Woody. For libcurl3-dev you can just install libcurl2-dev and go on, everything will be ok For libgd2-xpm, at the moment there is no backport available but, since this library is only used by CAS (and suggested, not even required), it won't give any problems on compilation time. Just be aware that <code>cas -o</code> won't work.''<br />
<br />
2) Download the latest released [[aMule]] source code from [http://www.amule.org/files/files.php?cat=6 here] (or look [[AMule_CVS|here]] for an up-to-date link).<br />
<br />
'''''Note 8:''' From now on, I will suppose we are installing aMule 2.0.0-rc3''<br />
<br />
3) Fix Crypto++ Library 5.1 if using it<br><br />
From [[aMule]] 2.0.0-rc1 to a aMule 1.0.0-rc5 (inclusive) this library is required because [[aMule]] is now supporting SecureIdent (remember, since aMule 2.0.0-rc6, libcrypto++ is optional and not needed by default), but the [[Libcrypto|Crypto++]] [[Debian]] package has had lots of compiling bugs and still has one (although the rest have been fixed after aMule team's reports). Remember you should have update and dist-upgraded apt-get before installing any [[Debian]] package in this HowTo, otherwise, you could be installing (or already have installed) a buggy Crypto++ package and this fix will not suit your needs. To fix the latest [[Libcrypto|crypto++]] [[Debian]] package only a symbolic link is needed:''<br />
<br />
ln -s /usr/include/crypto++/cryptopp_config.h /usr/include/crypto++/config.h<br />
<br />
''If you still can't compile crypto++, try compiling it after running the following command:''<br />
<br />
ln -s /usr/include/crypto++ /usr/include/cryptopp<br />
<br />
'''''Note 9:''' Since this link needs write permissions in /usr/lib, super-user (root) priviledges are needed. Again, this can be done easily with <code>"su"</code> or <code>"sudo"</code>.''<br />
<br />
<br><br />
<br />
== The hardest: Compiling [[aMule]] ==<br />
4) Extract the sources. The following will create a folder on your user's home directory where it will extract the sources with the -C switch into it (the following command understands that [[aMule]]'s sources are on the current directory):<br />
<br />
mkdir ~/aMule-compilation/ && tar xzfv aMule-2.0.0rc3.tar.gz -C ~/aMule-compilation/ && cd ~/aMule-compilation/<br />
<br />
'''''Note 10:''' Remember I'm supposing you are extracting [[aMule]] 2.0.0-rc3. Change the file name if it doesn't correspond to the actual packed source code filename.''<br />
<br />
5) Compile [[aMule]]! The following command will actually switch to the directory containing [[aMule]] 2.0.0rc3 and compile it:<br />
<br />
cd ~/aMule-compilation/aMule-2.0.0rc3/ && ./configure && make<br />
<br />
'''''Note 11:''' Please take a look at the [[configure|configure article]].''<br><br />
'''''Note 12:''' You should check <code>"./configure --help | more"</code> to see if there is any configure switch which might be of your interest, such as --disable-debug --enable-optimise or --bindir= ''<br><br />
'''''Note 13:''' if you get an error message, while compiling, similar to: "In file included from /usr/include/wx/***:***, [...] /usr/include/wx/******:***: internal compiler error: Segmentation fault", then you most probably have problems with wxWidgets. Try with <code>"apt-get install --reinstall wxwin2.4-headers libwxbase2.4 libwxgtk2.4-dev"</code>, which will reinstall wxWidgets and will most probably fix the compilation error.''<br />
<br />
== Meeting satisfaction: Installing aMule! ==<br />
<br />
8) What's left? Install aMule (remember you must be root, so log in as root or use <code>"su"</code> or <code>"sudo"</code>):<br />
<br />
make install<br />
<br />
Now you can remove the sources so you free up space in your hard disk by running:<br />
<br />
rm -rf ~/aMule-compilation/</code><br />
<br />
== The end: Final checks ==<br />
<br />
If you have sometime installed aMule from the Debian packages (no matter if the package came from http://gunnm.org/~soda ), you will have aMule binaries installed in /usr/bin. But <code>"make install"</code> installs binnaries in /usr/local/bin (unless --prefix= is set in configure). This leads us to the point that when typing "amule" anyone of the two installed aMule versions might be invoked (which one is executed will depend on the $PATH environment variable. You can check it by typing <code>"type amule"</code>). The walk around is very easy: remove the aMule installed through [[Debian]] package. You can do this with the command "apt-get remove amule" (do not use <code>"apt-get remove --purge"</code> or you might loose your [[aMule]] settings) or with <code>"dpkg --remove amule"</code> (again, never ever use <code>"dpkg --purge"</code> or you might loose your [[aMule]] settings). apt-get will remove aMule-utils if you have them installed (only available as a separate package in Sid, in Sarge and Woody aMule utils are included in the base aMule package) while dpkg will leave aMule-utils installed on the system (which, in general, is a bad idea).<br><br />
Also, if you installed xmule sometime or you are planing to install it, have in mind that the [[ed2k command]] exists both in [[aMule]] and [[xMule]]. You might want to run `type ed2k` to see which [[ed2k command]] will be executed and rename the other so you make sure it's never executed by mistake.<br />
<br />
== You're done... ==<br />
That's it! Your own compiled [[aMule]] is installed on your system and ready to go.<br />
<br />
To run [[aMule]], just type <code>"amule"</code>. You can check if everything worked by typing <code>"amule -v"</code> and check if the displayed version corresponds with the one you were compiling/installing.<br />
<br />
If this HowTo didn't help, you have a rare problem on your system ;-) Take a look at http://www.amule.org ([http://www.amule.org/amule aMule Forums] at http://forum.amule.org ) or visit us in #amule on irc.freenode.net and (don't doubt) we'll try to do our best to help you.<br />
<br />
== Final notes ==<br />
<br />
If you are in one of those rare cases when you wish to compile [[aMule]] statically, install also ''libtiff4-dev'' (through ''apt-get install libtiff4-dev''). Anyway, this is '''NOT''' recommended and, in fact, will probably not do any better or even, not work at all.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=HowTo_Compile_In_Debian/UbuntuHowTo Compile In Debian/Ubuntu2005-05-19T07:50:45Z<p>JohnGH: =<h4><u>The easiest: Preparing the system</u></h4>=</p>
<hr />
<div><center><h2><u><b>HowTo compile aMule in [[Debian]]</b></u></h2><br><br />
<h2>by <i>[[User:Jacobo221|Jacobo221]]</i></h2><br><br />
<br />
<h3>Very special thanks to <i>darknox</i>, <i>Arathornz</i>, <i>guest234</i>, <i>parasito</i>, <i>maya</i> and <i>klando</i> for their tests!</h3></center><br><br />
<br><br />
<br />
'''NOTE:''' This howto will also work for [http://www.ubuntulinux.com Ubuntu Linux].<br />
<br />
== Are you sure you want to compile? ==<br />
<br />
You can just install latest [[aMule CVS]] through debs adding the following lines into your ''/etc/apt/sources.list'' file:<br />
<br />
deb http://www.vollstreckernet.de/debian/ testing amule<br />
deb http://www.vollstreckernet.de/debian/ testing wx<br />
<br />
'''NOTE:''' The second line is necessary for Sarge users and strongly recommended for Sid users.<br />
<br />
Now run ''apt-get update && apt-get install amule''<br />
<br />
You might also want to take a look at the other available [[aMule]] utilities:<br />
*amule<br />
*amule-common<br />
*amuled<br />
*amule-remote-gui<br />
*amuleweb<br />
*amulewebdlg<br />
*amule-cas<br />
*amule-wxcas<br />
*amule-xas<br />
*amule-utils<br />
<br />
If you still want to compile aMule instead of just installing a binary, keep reading...<br />
<br />
== <h4><u>Notes before starting</u></h4> ==<br />
<b>Important:</b> Have in mind that this HowTo was done having in mind aMule 2.0.0 or greater in [[Debian]] 3.0 (Woody/Sarge/Sid).<br><br />
<br><br />
This HowTo is based on using the apt-get package installer tool, which means you'll have to be able to get super-user (root) access. Also, apt-get requires a perfect packet dependencies installed system. If you usually use apt-get for installing any application, skip this and go to the next section. If you rarely use apt-get but, instead, use dpkg, you can<br><br />
<br><br />
A) (Recommended) Solve all the dependencies problems on your system. This can be done by taking a look at the <code>"dpkg -C"</code> output and installing/removing/updating the packages it mentions depending on what's required. This option is the recommended since it will not only ensure your aMule compilation will be most surely correct, but it will also make your system the most stable it can possibly be and from now on you'll be able to use apt-get to not only make easier installations, but also to easily upgrade your system.<br><br />
<br><br />
B) Force apt-get to ignore the dependencies problems using the -f or --fix-broken switches (just one of them, since they're exactly the same, so that'd be, for example, <code>"apt-get install -f ..."</code>). This option may cause a corrupt installation of some packages which may cause the apps not to work. Also have in mind that using this switch in a system with dependencies problems may cause the system to completely break if the package being installed is a base package (although this is not the case).<br><br />
<br><br />
C) Follow this instructions but, instead of using <code>"apt-get install foo"</code>, use <code>"dpkg -i foo"</code> where foo is the package to install. Remember the packages must be already on the system when installing packages with dpkg. Remember also to download any "Depends" package since it most-surely will be necessary for successfully compiling [[aMule]]. Avoid using whichever of the following dpkg switches: --force-all --force-depends-version --force-depends --force-conflicts<br><br />
<br><br />
If you usually install applications from source, read deltaHF's [[Compilation_Installation|"aMule compilation / installation HowTo"]] since your system might not be complying the Debian aMule package dependencies although <code>"dpkg -C"</code> shows no errors.<br><br />
<br><br />
<br><br />
== The easiest: Preparing the system ==<br />
<br />
Once you decided to use apt-get, you must make sure you'll be downloading the latest versions of the packages (aMule team has discovered bugs in some deb packages that would make aMule impossible to compile on Debian without compiling some other libraries too. This bugs have been mostly fixed in those affected debian packages, so it is very important to be sure to have the packages up to date). This is done by issuing:<br />
<br />
apt-get update && apt-get dist-upgrade<br />
<br />
<i><b>Note 1:</b> You must be root user to do this. Log in as root or <code>"su"</code> or use <code>"sudo"</code>.<br />
<code>"sudo"</code> must be specified on both apt-get commands, that is:</i><br />
<br />
"sudo apt-get update && sudo apt-get dist-upgrade"<br />
<br />
<i><code>"sudo"</code> is not a base command, so it may not be installed on your system, although it most probably will. Be aware that following this HowTo entirely as root may bring some problems later such as being unable to delete certain files as a normal user, so please only use root priviledges when necessary.</i><br />
<br />
<i><b>Note 2:</b> Woody users (that is, people stuck in the stable Debian 3.0 branch) will be unable to install the wxGTK, wxbase and Crypto++ libraries since they were not available in the current minimum compatible versions (2.4.2 and 2.5.1 respectively) when Woody was released.</i><br />
<br />
<i>The best for Woody users is to switch to the Sarge or Sid branch.<br />
That can be done with the following command (again, you must be root)</i><br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/testing/g" /etc/apt/sources.list<br />
<br />
<i>or</i><br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sarge/g" /etc/apt/sources.list<br />
<br />
<i>to switch to the Sarge/testing branch, or with</i><br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/unstable/g" /etc/apt/sources.list<br />
<i>or</i><br />
<br />
perl -pi.$$ -e "s/(\bstable|woody)/sid/g" /etc/apt/sources.list<br />
<br />
<i>to switch to the Sid/unstable branch.</i><br />
<br />
<i>If Woody users are not be interested in switching to Sarge they will need to download Woody-backported debian packages by adding the following line to /etc/apt/sources.list (remember to <code>"apt-get update"</code> after adding this line):</i><br />
<br />
deb http://debian.thermoman.de/ woody wxwindows2.4 libcrypto++<br />
<br />
What's more, [http://www.thermoman.de thermoman] stopped working on the [[aMule]] backports for [http://www.debian.org Woody] on the [[aMule]] 2.0.0-rc5 release, so newer [[aMule]] releases backports are unavailable. Sorry.<br />
<br />
<i><b>Note 3:</b> Sarge users won't have any dependecy problems any longer, sicne both crypto++ and wxWidgets have both been in Sarge for some time now.<br />
So, there's no longer any need to update ''sources.list'' on Debian Sarge distributions.</i><br />
<br />
<i><b>Note 4:</b> Sid users (that is, people holding the cutting-edge unstable Debian 3.0 branch) could suffer problems from packages not completely implemented or with broken dependencies (both are normal issues in the unstable branch). It is very important to keep this in mind since a compiler (g++) will be installed so it could also be broken and, with it, most applications compiled with it (once upgraded, of course). If a package was broken, to downgrade you can use the --force-downgrade switch with dpkg.</i><br />
<br />
If for whatever reason you think this is too much of a complication, you can just wait a few days until the aMule binary version comes out for your architecture (that is, a .deb file).<br />
<br />
== <h4><u>The fastest: Installing the necessary packages</u></h4> ==<br />
Remember you need to be root to install applications using apt-get, since apt-get installs system-wide applications. So, log in as root, use "su" or add "sudo" before every command shown here.<br><br />
<br><br />
The following are the packages which must be installed:<br><br />
<br><br />
1) Install the latest stable g++ compiler and the C++ Standard Library<br><br />
<br><br />
<code>apt-get install g++</code><br><br />
<br><br />
the required libraries for compiling [[aMule]] (wxbase is not really a requiered packet to compile aMule but, unless you know what you're doing, be sure you install it. I won't show in this this guide how to force aMule's compilation without wxbase):<br><br />
<br><br />
<code>apt-get install libwxbase2.4-dev libcurl3-dev libgtk1.2-dev libwxgtk2.4-dev</code><br><br />
Alternatively you can use <code>apt-get build-dep amule</code> to get all the required depencies for compilation. Anyway, this last method is not sure to work, since it will depend on the latest version on the Debian repository and later versions or CVS versions might have different dependencies.<br />
<br><br><br />
and the required utilities for compiling [[aMule]], at the moment only gettext (necessary for internationalization support):<br><br />
<br><br />
<code>apt-get install gettext</code><br><br />
<br><br />
<i><b>Note 5:</b> This can all be done in a single command line, which might be more handy for users using <code>"sudo"</code> to gain root priviledges: <code>apt-get install g++ libwxbase2.4-dev libcurl3-dev libgtk1.2-dev gettext</code></i><br><br />
<i><b>Note 6:</b> From aMule 2.0.0-rc1 to aMule 2.0.0-rc5 (inclusive) the package ''libcrypto++-dev'' is was necessary for compiling aMule, so if you are compiling any of such versions, apt-get libcrypto++-dev too.<br><br />
Also, you might be interested in installing libgd2-noxpm-dev if you plan to compile CAS. It is not a required library for compiling CAS, this library is only used by CAS for creating images (since v2.0.0-rc3) on the current aMule status (by running <code>cas -o</code>). If you plan to use this feature of CAS, you need to install LibGD2. Anyway, CAS will compile perfectly well even if LibGD2 isn't installed, since it detects, on compilation time, if this library is installed.</i><br><br />
<i><b>Note 7:</b> Woody users will most probably be unable to get libgd2-xpm-dev and libcurl3-dev since those packages aren't available for Woody. For libcurl3-dev you can just install libcurl2-dev and go on, everything will be ok For libgd2-xpm, at the moment there is no backport available but, since this library is only used by CAS (and suggested, not even required), it won't give any problems on compilation time. Just be aware that <code>cas -o</code> won't work.</i><br><br />
<br><br />
2) Download the latest released [[aMule]] source code from [http://www.amule.org/files/files.php?cat=6 here] (or look [[AMule_CVS|here]] for an up-to-date link).<br><br />
<br><br />
<i><b>Note 8:</b> From now on, I will suppose we are installing aMule 2.0.0-rc3</i><br><br />
<br><br />
3) Fix Crypto++ Library 5.1 if using it<br><br />
From [[aMule]] 2.0.0-rc1 to a aMule 1.0.0-rc5 (inclusive) this library is required because [[aMule]] is now supporting SecureIdent (remember, since aMule 2.0.0-rc6, libcrypto++ is optional and not needed by default), but the [[Libcrypto|Crypto++]] [[Debian]] package has had lots of compiling bugs and still has one (although the rest have been fixed after aMule team's reports). Remember you should have update and dist-upgraded apt-get before installing any [[Debian]] package in this HowTo, otherwise, you could be installing (or already have installed) a buggy Crypto++ package and this fix will not suit your needs. To fix the latest [[Libcrypto|crypto++]] [[Debian]] package only a symbolic link is needed:<br><br />
<br><br />
<code>ln -s /usr/include/crypto++/cryptopp_config.h /usr/include/crypto++/config.h</code><br><br />
<br><br />
If you still can't compile crypto++, try compiling it after running the following command:<br><br />
<br><br />
<code>ln -s /usr/include/crypto++ /usr/include/cryptopp''</code><br><br />
<br><br />
<i><b>Note 9:</b> Since this link needs write permissions in /usr/lib, super-user (root) priviledges are needed. Again, this can be done easily with <code>"su"</code> or <code>"sudo"</code>.</i><br><br />
<br><br />
<br><br />
<br />
== <h4><u>The hardest: Compiling [[aMule]]</u></h4> ==<br />
4) Extract the sources. The following will create a folder on your user's home directory where it will extract the sources with the -C switch into it (the following command understands that [[aMule]]'s sources are on the current directory):<br><br />
<br><br />
<code>mkdir ~/aMule-compilation/ && tar xzfv aMule-2.0.0rc3.tar.gz -C ~/aMule-compilation/ && cd ~/aMule-compilation/</code><br><br />
<br><br />
<i><b>Note 10:</b> Remember I'm supposing you are extracting [[aMule]] 2.0.0-rc3. Change the file name if it doesn't correspond to the actual packed source code filename.</i><br><br />
<br><br />
5) Compile [[aMule]]! The following command will actually switch to the directory containing [[aMule]] 2.0.0rc3 and compile it:<br><br />
<br><br />
<code>cd ~/aMule-compilation/aMule-2.0.0rc3/ && ./configure && make</code><br><br />
<br><br />
<i><b>Note 11:</b> Please take a look at the [[configure|configure article]].</i><br><br />
<i><b>Note 12:</b> You should check <code>"./configure --help | more"</code> to see if there is any configure switch which might be of your interest, such as --disable-debug --enable-optimise or --bindir= </i><br><br />
<i><b>Note 13:</b> if you get an error message, while compiling, similar to: "In file included from /usr/include/wx/***:***, [...] /usr/include/wx/******:***: internal compiler error: Segmentation fault", then you most probably have problems with wxWidgets. Try with <code>"apt-get install --reinstall wxwin2.4-headers libwxbase2.4 libwxgtk2.4-dev"</code>, which will reinstall wxWidgets and will most probably fix the compilation error.</i><br />
<br><br />
<br><br />
== <h4><u>Meeting satisfaction: Installing aMule!</u></h4> ==<br />
8) What's left? Install aMule (remember you must be root, so log in as root or use <code>"su"</code> or <code>"sudo"</code>):<br><br />
<br><br />
<code>make install</code><br><br />
<br><br />
Now you can remove the sources so you free up space in your hard disk by running:<br><br />
<br><br />
<code>rm -rf ~/aMule-compilation/</code><br><br />
<br><br />
<br><br />
== <h4><u>The end: Final checks</u></h4> ==<br />
If you have sometime installed aMule from the Debian packages (no matter if the package came from http://gunnm.org/~soda ), you will have aMule binaries installed in /usr/bin. But <code>"make install"</code> installs binnaries in /usr/local/bin (unless --prefix= is set in configure). This leads us to the point that when typing "amule" anyone of the two installed aMule versions might be invoked (which one is executed will depend on the $PATH environment variable. You can check it by typing <code>"type amule"</code>). The walk around is very easy: remove the aMule installed through [[Debian]] package. You can do this with the command "apt-get remove amule" (do not use <code>"apt-get remove --purge"</code> or you might loose your [[aMule]] settings) or with <code>"dpkg --remove amule"</code> (again, never ever use <code>"dpkg --purge"</code> or you might loose your [[aMule]] settings). apt-get will remove aMule-utils if you have them installed (only available as a separate package in Sid, in Sarge and Woody aMule utils are included in the base aMule package) while dpkg will leave aMule-utils installed on the system (which, in general, is a bad idea).<br><br />
Also, if you installed xmule sometime or you are planing to install it, have in mind that the [[ed2k command]] exists both in [[aMule]] and [[xMule]]. You might want to run `type ed2k` to see which [[ed2k command]] will be executed and rename the other so you make sure it's never executed by mistake.<br><br />
<br><br />
<br><br />
== <h4><u>You're done...</u></h4> ==<br />
That's it! Your own compiled [[aMule]] is installed on your system and ready to go.<br><br />
To run [[aMule]], just type <code>"amule"</code>. You can check if everything worked by typing <code>"amule -v"</code> and check if the displayed version corresponds with the one you were compiling/installing.<br><br />
If this HowTo didn't help, you have a rare problem on your system ;-) Take a look at http://www.amule.org ([http://www.amule.org/amule aMule Forums] at http://forum.amule.org ) or visit us in #amule on irc.freenode.net and (don't doubt) we'll try to do our best to help you.<br><br />
<br />
== Final notes ==<br />
<br />
If you are in one of those rare cases when you wish to compile [[aMule]] statically, install also ''libtiff4-dev'' (through ''apt-get install libtiff4-dev''). Anyway, this is '''NOT''' recommended and, in fact, will probably not do any better or even, not work at all.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=HowTo_Compile_In_Debian/UbuntuHowTo Compile In Debian/Ubuntu2005-05-19T07:31:37Z<p>JohnGH: =<h4><u>The easiest: Preparing the system</u></h4>=</p>
<hr />
<div><center><h2><u><b>HowTo compile aMule in [[Debian]]</b></u></h2><br><br />
<h2>by <i>[[User:Jacobo221|Jacobo221]]</i></h2><br><br />
<br />
<h3>Very special thanks to <i>darknox</i>, <i>Arathornz</i>, <i>guest234</i>, <i>parasito</i>, <i>maya</i> and <i>klando</i> for their tests!</h3></center><br><br />
<br><br />
<br />
'''NOTE:''' This howto will also work for [http://www.ubuntulinux.com Ubuntu Linux].<br />
<br />
== Are you sure you want to compile? ==<br />
<br />
You can just install latest [[aMule CVS]] through debs adding the following lines into your ''/etc/apt/sources.list'' file:<br />
<br />
deb http://www.vollstreckernet.de/debian/ testing amule<br />
deb http://www.vollstreckernet.de/debian/ testing wx<br />
<br />
'''NOTE:''' The second line is necessary for Sarge users and strongly recommended for Sid users.<br />
<br />
Now run ''apt-get update && apt-get install amule''<br />
<br />
You might also want to take a look at the other available [[aMule]] utilities:<br />
*amule<br />
*amule-common<br />
*amuled<br />
*amule-remote-gui<br />
*amuleweb<br />
*amulewebdlg<br />
*amule-cas<br />
*amule-wxcas<br />
*amule-xas<br />
*amule-utils<br />
<br />
If you still want to compile aMule instead of just installing a binary, keep reading...<br />
<br />
== <h4><u>Notes before starting</u></h4> ==<br />
<b>Important:</b> Have in mind that this HowTo was done having in mind aMule 2.0.0 or greater in [[Debian]] 3.0 (Woody/Sarge/Sid).<br><br />
<br><br />
This HowTo is based on using the apt-get package installer tool, which means you'll have to be able to get super-user (root) access. Also, apt-get requires a perfect packet dependencies installed system. If you usually use apt-get for installing any application, skip this and go to the next section. If you rarely use apt-get but, instead, use dpkg, you can<br><br />
<br><br />
A) (Recommended) Solve all the dependencies problems on your system. This can be done by taking a look at the <code>"dpkg -C"</code> output and installing/removing/updating the packages it mentions depending on what's required. This option is the recommended since it will not only ensure your aMule compilation will be most surely correct, but it will also make your system the most stable it can possibly be and from now on you'll be able to use apt-get to not only make easier installations, but also to easily upgrade your system.<br><br />
<br><br />
B) Force apt-get to ignore the dependencies problems using the -f or --fix-broken switches (just one of them, since they're exactly the same, so that'd be, for example, <code>"apt-get install -f ..."</code>). This option may cause a corrupt installation of some packages which may cause the apps not to work. Also have in mind that using this switch in a system with dependencies problems may cause the system to completely break if the package being installed is a base package (although this is not the case).<br><br />
<br><br />
C) Follow this instructions but, instead of using <code>"apt-get install foo"</code>, use <code>"dpkg -i foo"</code> where foo is the package to install. Remember the packages must be already on the system when installing packages with dpkg. Remember also to download any "Depends" package since it most-surely will be necessary for successfully compiling [[aMule]]. Avoid using whichever of the following dpkg switches: --force-all --force-depends-version --force-depends --force-conflicts<br><br />
<br><br />
If you usually install applications from source, read deltaHF's [[Compilation_Installation|"aMule compilation / installation HowTo"]] since your system might not be complying the Debian aMule package dependencies although <code>"dpkg -C"</code> shows no errors.<br><br />
<br><br />
<br><br />
== <h4><u>The easiest: Preparing the system</u></h4> ==<br />
Once you decided to use apt-get, you must make sure you'll be downloading the latest versions of the packages (aMule team has discovered bugs in some deb packages that would make aMule impossible to compile on Debian without compiling some other libraries too. This bugs have been mostly fixed in those affected debian packages, so it is very important to be sure to have the packages up to date). This is done by<br><br />
<br><br />
<code>apt-get update && apt-get dist-upgrade</code><br><br />
<br><br />
<i><b>Note 1:</b> You must be root user to do this. Log in as root or <code>"su"</code> or use <code>"sudo"</code> (<code>"sudo"</code> must be specified on both apt-get commands, that is <code>"sudo apt-get update && sudo apt-get dist-upgrade"</code>). <code>"sudo"</code> is not a base command, so it may not be installed on your system, although it most probably will. Be aware that following this HowTo entirely as root may bring some problems later such as being unable to delete certain files as a normal user, so please only use tooy priviledges when necessary.</i><br><br />
<i><b>Note 2:</b> Woody users (that is, people stuck in the stable Debian 3.0 branch) will be unable to install the wxGTK, wxbase and Crypto++ libraries since they were not available in the current minimum compatible versions (2.4.2 and 2.5.1 respectively) when Woody was released.</i><br><br />
<i>The best for Woody users is to switch to the Sarge or Sid branch.<br />
That can be done with the following command (again, you must be root)<br />
<code>perl -pi.$$ -e "s/(\bstable|woody)/testing/g" /etc/apt/sources.list</code><br />
or<br />
<code>perl -pi.$$ -e "s/(\bstable|woody)/sarge/g" /etc/apt/sources.list</code><br />
to switch to the Sarge/testing branch, or with<br />
<code>perl -pi.$$ -e "s/(\bstable|woody)/unstable/g" /etc/apt/sources.list</code><br />
or<br />
<code>perl -pi.$$ -e "s/(\bstable|woody)/sid/g" /etc/apt/sources.list</code><br />
to switch to the Sid/unstable branch.</i><br><br />
<i>If Woody users are not be interested in switching to Sarge they will have to download Woody-backported debian packages by adding the following line to /etc/apt/sources.list (remember to <code>"apt-get update"</code> after adding this line):</i><br><br />
<i><code>deb http://debian.thermoman.de/ woody wxwindows2.4 libcrypto++</code></i><br><br />
What's more, [http://www.thermoman.de thermoman] stopped working on the [[aMule]] backports for [http://www.debian.org Woody] on the [[aMule]] 2.0.0-rc5 release, so newer [[aMule]] releases backports are unavailable. Sorry.<br><br />
<i><b>Note 3:</b> Sarge users won't have any dependecy problems any longer, sicne both crypto++ and wxWidgets are both in Sarge since some time ago. So, there's no longer any need to update ''sources.list'' on Debian Sarge distributions.</i><br><br />
<i><b>Note 4:</b> Sid users (that is, people holding the cutting-edge unstable Debian 3.0 branch) could suffer problems from packages not completely implemented or with broken dependencies (both are normal issues in the unstable branch). It is very important to keep this in mind since a compiler (g++) will be installed so it could also be broken and, with it, most applications compiled with it (once upgraded, of course). If a package was broken, to downgrade you can use the --force-downgrade switch with dpkg.</i><br><br />
<br><br />
If for whatever reason you think this is too much of a complication, you can just wait a few days until the aMule binary version comes out for your architecture (that is, a .deb file).<br><br />
<br><br />
<br><br />
<br />
== <h4><u>The fastest: Installing the necessary packages</u></h4> ==<br />
Remember you need to be root to install applications using apt-get, since apt-get installs system-wide applications. So, log in as root, use "su" or add "sudo" before every command shown here.<br><br />
<br><br />
The following are the packages which must be installed:<br><br />
<br><br />
1) Install the latest stable g++ compiler and the C++ Standard Library<br><br />
<br><br />
<code>apt-get install g++</code><br><br />
<br><br />
the required libraries for compiling [[aMule]] (wxbase is not really a requiered packet to compile aMule but, unless you know what you're doing, be sure you install it. I won't show in this this guide how to force aMule's compilation without wxbase):<br><br />
<br><br />
<code>apt-get install libwxbase2.4-dev libcurl3-dev libgtk1.2-dev libwxgtk2.4-dev</code><br><br />
Alternatively you can use <code>apt-get build-dep amule</code> to get all the required depencies for compilation. Anyway, this last method is not sure to work, since it will depend on the latest version on the Debian repository and later versions or CVS versions might have different dependencies.<br />
<br><br><br />
and the required utilities for compiling [[aMule]], at the moment only gettext (necessary for internationalization support):<br><br />
<br><br />
<code>apt-get install gettext</code><br><br />
<br><br />
<i><b>Note 5:</b> This can all be done in a single command line, which might be more handy for users using <code>"sudo"</code> to gain root priviledges: <code>apt-get install g++ libwxbase2.4-dev libcurl3-dev libgtk1.2-dev gettext</code></i><br><br />
<i><b>Note 6:</b> From aMule 2.0.0-rc1 to aMule 2.0.0-rc5 (inclusive) the package ''libcrypto++-dev'' is was necessary for compiling aMule, so if you are compiling any of such versions, apt-get libcrypto++-dev too.<br><br />
Also, you might be interested in installing libgd2-noxpm-dev if you plan to compile CAS. It is not a required library for compiling CAS, this library is only used by CAS for creating images (since v2.0.0-rc3) on the current aMule status (by running <code>cas -o</code>). If you plan to use this feature of CAS, you need to install LibGD2. Anyway, CAS will compile perfectly well even if LibGD2 isn't installed, since it detects, on compilation time, if this library is installed.</i><br><br />
<i><b>Note 7:</b> Woody users will most probably be unable to get libgd2-xpm-dev and libcurl3-dev since those packages aren't available for Woody. For libcurl3-dev you can just install libcurl2-dev and go on, everything will be ok For libgd2-xpm, at the moment there is no backport available but, since this library is only used by CAS (and suggested, not even required), it won't give any problems on compilation time. Just be aware that <code>cas -o</code> won't work.</i><br><br />
<br><br />
2) Download the latest released [[aMule]] source code from [http://www.amule.org/files/files.php?cat=6 here] (or look [[AMule_CVS|here]] for an up-to-date link).<br><br />
<br><br />
<i><b>Note 8:</b> From now on, I will suppose we are installing aMule 2.0.0-rc3</i><br><br />
<br><br />
3) Fix Crypto++ Library 5.1 if using it<br><br />
From [[aMule]] 2.0.0-rc1 to a aMule 1.0.0-rc5 (inclusive) this library is required because [[aMule]] is now supporting SecureIdent (remember, since aMule 2.0.0-rc6, libcrypto++ is optional and not needed by default), but the [[Libcrypto|Crypto++]] [[Debian]] package has had lots of compiling bugs and still has one (although the rest have been fixed after aMule team's reports). Remember you should have update and dist-upgraded apt-get before installing any [[Debian]] package in this HowTo, otherwise, you could be installing (or already have installed) a buggy Crypto++ package and this fix will not suit your needs. To fix the latest [[Libcrypto|crypto++]] [[Debian]] package only a symbolic link is needed:<br><br />
<br><br />
<code>ln -s /usr/include/crypto++/cryptopp_config.h /usr/include/crypto++/config.h</code><br><br />
<br><br />
If you still can't compile crypto++, try compiling it after running the following command:<br><br />
<br><br />
<code>ln -s /usr/include/crypto++ /usr/include/cryptopp''</code><br><br />
<br><br />
<i><b>Note 9:</b> Since this link needs write permissions in /usr/lib, super-user (root) priviledges are needed. Again, this can be done easily with <code>"su"</code> or <code>"sudo"</code>.</i><br><br />
<br><br />
<br><br />
<br />
== <h4><u>The hardest: Compiling [[aMule]]</u></h4> ==<br />
4) Extract the sources. The following will create a folder on your user's home directory where it will extract the sources with the -C switch into it (the following command understands that [[aMule]]'s sources are on the current directory):<br><br />
<br><br />
<code>mkdir ~/aMule-compilation/ && tar xzfv aMule-2.0.0rc3.tar.gz -C ~/aMule-compilation/ && cd ~/aMule-compilation/</code><br><br />
<br><br />
<i><b>Note 10:</b> Remember I'm supposing you are extracting [[aMule]] 2.0.0-rc3. Change the file name if it doesn't correspond to the actual packed source code filename.</i><br><br />
<br><br />
5) Compile [[aMule]]! The following command will actually switch to the directory containing [[aMule]] 2.0.0rc3 and compile it:<br><br />
<br><br />
<code>cd ~/aMule-compilation/aMule-2.0.0rc3/ && ./configure && make</code><br><br />
<br><br />
<i><b>Note 11:</b> Please take a look at the [[configure|configure article]].</i><br><br />
<i><b>Note 12:</b> You should check <code>"./configure --help | more"</code> to see if there is any configure switch which might be of your interest, such as --disable-debug --enable-optimise or --bindir= </i><br><br />
<i><b>Note 13:</b> if you get an error message, while compiling, similar to: "In file included from /usr/include/wx/***:***, [...] /usr/include/wx/******:***: internal compiler error: Segmentation fault", then you most probably have problems with wxWidgets. Try with <code>"apt-get install --reinstall wxwin2.4-headers libwxbase2.4 libwxgtk2.4-dev"</code>, which will reinstall wxWidgets and will most probably fix the compilation error.</i><br />
<br><br />
<br><br />
== <h4><u>Meeting satisfaction: Installing aMule!</u></h4> ==<br />
8) What's left? Install aMule (remember you must be root, so log in as root or use <code>"su"</code> or <code>"sudo"</code>):<br><br />
<br><br />
<code>make install</code><br><br />
<br><br />
Now you can remove the sources so you free up space in your hard disk by running:<br><br />
<br><br />
<code>rm -rf ~/aMule-compilation/</code><br><br />
<br><br />
<br><br />
== <h4><u>The end: Final checks</u></h4> ==<br />
If you have sometime installed aMule from the Debian packages (no matter if the package came from http://gunnm.org/~soda ), you will have aMule binaries installed in /usr/bin. But <code>"make install"</code> installs binnaries in /usr/local/bin (unless --prefix= is set in configure). This leads us to the point that when typing "amule" anyone of the two installed aMule versions might be invoked (which one is executed will depend on the $PATH environment variable. You can check it by typing <code>"type amule"</code>). The walk around is very easy: remove the aMule installed through [[Debian]] package. You can do this with the command "apt-get remove amule" (do not use <code>"apt-get remove --purge"</code> or you might loose your [[aMule]] settings) or with <code>"dpkg --remove amule"</code> (again, never ever use <code>"dpkg --purge"</code> or you might loose your [[aMule]] settings). apt-get will remove aMule-utils if you have them installed (only available as a separate package in Sid, in Sarge and Woody aMule utils are included in the base aMule package) while dpkg will leave aMule-utils installed on the system (which, in general, is a bad idea).<br><br />
Also, if you installed xmule sometime or you are planing to install it, have in mind that the [[ed2k command]] exists both in [[aMule]] and [[xMule]]. You might want to run `type ed2k` to see which [[ed2k command]] will be executed and rename the other so you make sure it's never executed by mistake.<br><br />
<br><br />
<br><br />
== <h4><u>You're done...</u></h4> ==<br />
That's it! Your own compiled [[aMule]] is installed on your system and ready to go.<br><br />
To run [[aMule]], just type <code>"amule"</code>. You can check if everything worked by typing <code>"amule -v"</code> and check if the displayed version corresponds with the one you were compiling/installing.<br><br />
If this HowTo didn't help, you have a rare problem on your system ;-) Take a look at http://www.amule.org ([http://www.amule.org/amule aMule Forums] at http://forum.amule.org ) or visit us in #amule on irc.freenode.net and (don't doubt) we'll try to do our best to help you.<br><br />
<br />
== Final notes ==<br />
<br />
If you are in one of those rare cases when you wish to compile [[aMule]] statically, install also ''libtiff4-dev'' (through ''apt-get install libtiff4-dev''). Anyway, this is '''NOT''' recommended and, in fact, will probably not do any better or even, not work at all.</div>JohnGHhttp://wiki.amule.org/t/index.php?title=HowTo_Compile_In_Debian/UbuntuHowTo Compile In Debian/Ubuntu2005-05-19T06:56:47Z<p>JohnGH: =Are you sure you want to compile?=</p>
<hr />
<div><center><h2><u><b>HowTo compile aMule in [[Debian]]</b></u></h2><br><br />
<h2>by <i>[[User:Jacobo221|Jacobo221]]</i></h2><br><br />
<br />
<h3>Very special thanks to <i>darknox</i>, <i>Arathornz</i>, <i>guest234</i>, <i>parasito</i>, <i>maya</i> and <i>klando</i> for their tests!</h3></center><br><br />
<br><br />
<br />
'''NOTE:''' This howto will also work for [http://www.ubuntulinux.com Ubuntu Linux].<br />
<br />
== Are you sure you want to compile? ==<br />
<br />
You can just install latest [[aMule CVS]] through debs adding the following lines into your ''/etc/apt/sources.list'' file:<br />
<br />
deb http://www.vollstreckernet.de/debian/ testing amule<br />
deb http://www.vollstreckernet.de/debian/ testing wx<br />
<br />
'''NOTE:''' The second line is necessary for Sarge users and strongly recommended for Sid users.<br />
<br />
Now run ''apt-get update && apt-get install amule''<br />
<br />
You might also want to take a look at the other available [[aMule]] utilities:<br />
*amule<br />
*amule-common<br />
*amuled<br />
*amule-remote-gui<br />
*amuleweb<br />
*amulewebdlg<br />
*amule-cas<br />
*amule-wxcas<br />
*amule-xas<br />
*amule-utils<br />
<br />
If you still want to compile aMule instead of just installing a binary, keep reading...<br />
<br />
== <h4><u>Notes before starting</u></h4> ==<br />
<b>Important:</b> Have in mind that this HowTo was done having in mind aMule 2.0.0 or greater in [[Debian]] 3.0 (Woody/Sarge/Sid).<br><br />
<br><br />
This HowTo is based on using the apt-get package installer tool, which means you'll have to be able to get super-user (root) access. Also, apt-get requires a perfect packet dependencies installed system. If you usually use apt-get for installing any application, skip this and go to the next section. If you rarely use apt-get but, instead, use dpkg, you can<br><br />
<br><br />
A) (Recommended) Solve all the dependencies problems on your system. This can be done by taking a look at the <code>"dpkg -C"</code> output and installing/removing/updating the packages it mentions depending on what's required. This option is the recommended since it will not only ensure your aMule compilation will be most surely correct, but it will also make your system the most stable it can possibly be and from now on you'll be able to use apt-get to not only make easier installations, but also to easily upgrade your system.<br><br />
<br><br />
B) Force apt-get to ignore the dependencies problems using the -f or --fix-broken switches (just one of them, since they're exactly the same, so that'd be, for example, <code>"apt-get install -f ..."</code>). This option may cause a corrupt installation of some packages which may cause the apps not to work. Also have in mind that using this switch in a system with dependencies problems may cause the system to completely brake if the package being installed is a base package (although this is not the case).<br><br />
<br><br />
C) Follow this instructions but, instead of using <code>"apt-get install foo"</code>, use <code>"dpkg -i foo"</code> where foo is the package to install. Remember the packages must be already on the system when installing packages with dpkg. Remember also to download any "Depends" package since it most-surely will be necessary for successfully compiling [[aMule]]. Avoid using whichever of the following dpkg switches: --force-all --force-depends-version --force-depends --force-conflicts<br><br />
<br><br />
If you usually install applications from source, read deltaHF's [[Compilation_Installation|"aMule compilation / installation HowTo"]] since your system might not be complying the Debian aMule package dependencies although <code>"dpkg -C"</code> shows no errors.<br><br />
<br><br />
<br><br />
== <h4><u>The easiest: Preparing the system</u></h4> ==<br />
Once you decided to use apt-get, you must make sure you'll be downloading the latest versions of the packages (aMule team has discovered bugs in some deb packages that would make aMule impossible to compile on Debian without compiling some other libraries too. This bugs have been mostly fixed in those affected debian packages, so it is very important to be sure to have the packages up to date). This is done by<br><br />
<br><br />
<code>apt-get update && apt-get dist-upgrade</code><br><br />
<br><br />
<i><b>Note 1:</b> You must be root user to do this. Log in as root or <code>"su"</code> or use <code>"sudo"</code> (<code>"sudo"</code> must be specified on both apt-get commands, that is <code>"sudo apt-get update && sudo apt-get dist-upgrade"</code>). <code>"sudo"</code> is not a base command, so it may not be installed on your system, although it most probably will. Be aware that following this HowTo entirely as root may bring some problems later such as being unable to delete certain files as a normal user, so please only use tooy priviledges when necessary.</i><br><br />
<i><b>Note 2:</b> Woody users (that is, people stuck in the stable Debian 3.0 branch) will be unable to install the wxGTK, wxbase and Crypto++ libraries since they were not available in the current minimum compatible versions (2.4.2 and 2.5.1 respectively) when Woody was released.</i><br><br />
<i>The best for Woody users is to switch to the Sarge or Sid branch. That can be done with the following command (again, you must be root) <code>"sed s/stable/testing/g /etc/apt/sources.list > /etc/apt/sources.list"</code> or <code>"sed s/woody/sarge/g /etc/apt/sources.list > /etc/apt/sources.list"</code> to switch to the Sarge/testing branch, or with <code>"sed s/unstable/testing/g /etc/apt/sources.list > /etc/apt/sources.list"</code> or <code>"sed s/woody/sid/g /etc/apt/sources.list > /etc/apt/sources.list"</code> to switch to the Sid/unstable branch.</i><br><br />
<i>But Woody users might not be interested in switching to Sarge. Such users will have to download Woody-backported debian packages by adding the following line to /etc/apt/sources.list (remember to <code>"apt-get update"</code> after adding this line):</i><br><br />
<i><code>deb http://debian.thermoman.de/ woody wxwindows2.4 libcrypto++</code></i><br><br />
What's more, [http://www.thermoman.de thermoman] stopped working on the [[aMule]] backports for [http://www.debian.org Woody] on the [[aMule]] 2.0.0-rc5 release, so newer [[aMule]] releases backports are unavailable. Sorry.<br><br />
<i><b>Note 3:</b> Sarge users won't have any dependecy problems any longer, sicne both crypto++ and wxWidgets are both in Sarge since some time ago. So, there's no longer any need to update ''sources.list'' on Debian Sarge distributions.</i><br><br />
<i><b>Note 4:</b> Sid users (that is, people holding the cutting-edge unstable Debian 3.0 branch) could suffer problems from packages not completely implemented or with broken dependencies (both are normal issues in the unstable branch). It is very important to keep this in mind since a compiler (g++) will be installed so it could also be broken and, with it, most applications compiled with it (once upgraded, of course). If a package was broken, to downgrade you can use the --force-downgrade switch with dpkg.</i><br><br />
<br><br />
If for whatever reason you think this is too much of a complication, you can just wait a few days until the aMule binary version comes out for your architecture (that is, a .deb file).<br><br />
<br><br />
<br><br />
<br />
== <h4><u>The fastest: Installing the necessary packages</u></h4> ==<br />
Remember you need to be root to install applications using apt-get, since apt-get installs system-wide applications. So, log in as root, use "su" or add "sudo" before every command shown here.<br><br />
<br><br />
The following are the packages which must be installed:<br><br />
<br><br />
1) Install the latest stable g++ compiler and the C++ Standard Library<br><br />
<br><br />
<code>apt-get install g++</code><br><br />
<br><br />
the required libraries for compiling [[aMule]] (wxbase is not really a requiered packet to compile aMule but, unless you know what you're doing, be sure you install it. I won't show in this this guide how to force aMule's compilation without wxbase):<br><br />
<br><br />
<code>apt-get install libwxbase2.4-dev libcurl3-dev libgtk1.2-dev libwxgtk2.4-dev</code><br><br />
Alternatively you can use <code>apt-get build-dep amule</code> to get all the required depencies for compilation. Anyway, this last method is not sure to work, since it will depend on the latest version on the Debian repository and later versions or CVS versions might have different dependencies.<br />
<br><br><br />
and the required utilities for compiling [[aMule]], at the moment only gettext (necessary for internationalization support):<br><br />
<br><br />
<code>apt-get install gettext</code><br><br />
<br><br />
<i><b>Note 5:</b> This can all be done in a single command line, which might be more handy for users using <code>"sudo"</code> to gain root priviledges: <code>apt-get install g++ libwxbase2.4-dev libcurl3-dev libgtk1.2-dev gettext</code></i><br><br />
<i><b>Note 6:</b> From aMule 2.0.0-rc1 to aMule 2.0.0-rc5 (inclusive) the package ''libcrypto++-dev'' is was necessary for compiling aMule, so if you are compiling any of such versions, apt-get libcrypto++-dev too.<br><br />
Also, you might be interested in installing libgd2-noxpm-dev if you plan to compile CAS. It is not a required library for compiling CAS, this library is only used by CAS for creating images (since v2.0.0-rc3) on the current aMule status (by running <code>cas -o</code>). If you plan to use this feature of CAS, you need to install LibGD2. Anyway, CAS will compile perfectly well even if LibGD2 isn't installed, since it detects, on compilation time, if this library is installed.</i><br><br />
<i><b>Note 7:</b> Woody users will most probably be unable to get libgd2-xpm-dev and libcurl3-dev since those packages aren't available for Woody. For libcurl3-dev you can just install libcurl2-dev and go on, everything will be ok For libgd2-xpm, at the moment there is no backport available but, since this library is only used by CAS (and suggested, not even required), it won't give any problems on compilation time. Just be aware that <code>cas -o</code> won't work.</i><br><br />
<br><br />
2) Download the latest released [[aMule]] source code from [http://www.amule.org/files/files.php?cat=6 here] (or look [[AMule_CVS|here]] for an up-to-date link).<br><br />
<br><br />
<i><b>Note 8:</b> From now on, I will suppose we are installing aMule 2.0.0-rc3</i><br><br />
<br><br />
3) Fix Crypto++ Library 5.1 if using it<br><br />
From [[aMule]] 2.0.0-rc1 to a aMule 1.0.0-rc5 (inclusive) this library is required because [[aMule]] is now supporting SecureIdent (remember, since aMule 2.0.0-rc6, libcrypto++ is optional and not needed by default), but the [[Libcrypto|Crypto++]] [[Debian]] package has had lots of compiling bugs and still has one (although the rest have been fixed after aMule team's reports). Remember you should have update and dist-upgraded apt-get before installing any [[Debian]] package in this HowTo, otherwise, you could be installing (or already have installed) a buggy Crypto++ package and this fix will not suit your needs. To fix the latest [[Libcrypto|crypto++]] [[Debian]] package only a symbolic link is needed:<br><br />
<br><br />
<code>ln -s /usr/include/crypto++/cryptopp_config.h /usr/include/crypto++/config.h</code><br><br />
<br><br />
If you still can't compile crypto++, try compiling it after running the following command:<br><br />
<br><br />
<code>ln -s /usr/include/crypto++ /usr/include/cryptopp''</code><br><br />
<br><br />
<i><b>Note 9:</b> Since this link needs write permissions in /usr/lib, super-user (root) priviledges are needed. Again, this can be done easily with <code>"su"</code> or <code>"sudo"</code>.</i><br><br />
<br><br />
<br><br />
<br />
== <h4><u>The hardest: Compiling [[aMule]]</u></h4> ==<br />
4) Extract the sources. The following will create a folder on your user's home directory where it will extract the sources with the -C switch into it (the following command understands that [[aMule]]'s sources are on the current directory):<br><br />
<br><br />
<code>mkdir ~/aMule-compilation/ && tar xzfv aMule-2.0.0rc3.tar.gz -C ~/aMule-compilation/ && cd ~/aMule-compilation/</code><br><br />
<br><br />
<i><b>Note 10:</b> Remember I'm supposing you are extracting [[aMule]] 2.0.0-rc3. Change the file name if it doesn't correspond to the actual packed source code filename.</i><br><br />
<br><br />
5) Compile [[aMule]]! The following command will actually switch to the directory containing [[aMule]] 2.0.0rc3 and compile it:<br><br />
<br><br />
<code>cd ~/aMule-compilation/aMule-2.0.0rc3/ && ./configure && make</code><br><br />
<br><br />
<i><b>Note 11:</b> Please take a look at the [[configure|configure article]].</i><br><br />
<i><b>Note 12:</b> You should check <code>"./configure --help | more"</code> to see if there is any configure switch which might be of your interest, such as --disable-debug --enable-optimise or --bindir= </i><br><br />
<i><b>Note 13:</b> if you get an error message, while compiling, similar to: "In file included from /usr/include/wx/***:***, [...] /usr/include/wx/******:***: internal compiler error: Segmentation fault", then you most probably have problems with wxWidgets. Try with <code>"apt-get install --reinstall wxwin2.4-headers libwxbase2.4 libwxgtk2.4-dev"</code>, which will reinstall wxWidgets and will most probably fix the compilation error.</i><br />
<br><br />
<br><br />
== <h4><u>Meeting satisfaction: Installing aMule!</u></h4> ==<br />
8) What's left? Install aMule (remember you must be root, so log in as root or use <code>"su"</code> or <code>"sudo"</code>):<br><br />
<br><br />
<code>make install</code><br><br />
<br><br />
Now you can remove the sources so you free up space in your hard disk by running:<br><br />
<br><br />
<code>rm -rf ~/aMule-compilation/</code><br><br />
<br><br />
<br><br />
== <h4><u>The end: Final checks</u></h4> ==<br />
If you have sometime installed aMule from the Debian packages (no matter if the package came from http://gunnm.org/~soda ), you will have aMule binaries installed in /usr/bin. But <code>"make install"</code> installs binnaries in /usr/local/bin (unless --prefix= is set in configure). This leads us to the point that when typing "amule" anyone of the two installed aMule versions might be invoked (which one is executed will depend on the $PATH environment variable. You can check it by typing <code>"type amule"</code>). The walk around is very easy: remove the aMule installed through [[Debian]] package. You can do this with the command "apt-get remove amule" (do not use <code>"apt-get remove --purge"</code> or you might loose your [[aMule]] settings) or with <code>"dpkg --remove amule"</code> (again, never ever use <code>"dpkg --purge"</code> or you might loose your [[aMule]] settings). apt-get will remove aMule-utils if you have them installed (only available as a separate package in Sid, in Sarge and Woody aMule utils are included in the base aMule package) while dpkg will leave aMule-utils installed on the system (which, in general, is a bad idea).<br><br />
Also, if you installed xmule sometime or you are planing to install it, have in mind that the [[ed2k command]] exists both in [[aMule]] and [[xMule]]. You might want to run `type ed2k` to see which [[ed2k command]] will be executed and rename the other so you make sure it's never executed by mistake.<br><br />
<br><br />
<br><br />
== <h4><u>You're done...</u></h4> ==<br />
That's it! Your own compiled [[aMule]] is installed on your system and ready to go.<br><br />
To run [[aMule]], just type <code>"amule"</code>. You can check if everything worked by typing <code>"amule -v"</code> and check if the displayed version corresponds with the one you were compiling/installing.<br><br />
If this HowTo didn't help, you have a rare problem on your system ;-) Take a look at http://www.amule.org ([http://www.amule.org/amule aMule Forums] at http://forum.amule.org ) or visit us in #amule on irc.freenode.net and (don't doubt) we'll try to do our best to help you.<br><br />
<br />
== Final notes ==<br />
<br />
If you are in one of those rare cases when you wish to compile [[aMule]] statically, install also ''libtiff4-dev'' (through ''apt-get install libtiff4-dev''). Anyway, this is '''NOT''' recommended and, in fact, will probably not do any better or even, not work at all.</div>JohnGH