Map from Google - Libya

In Libya the climate is Mediterranean in the thin coastal strip, and desert in the interior. In fact, although the temperatures are typical of the Mediterranean climate, the rains on the coast are scarce, so that the desert is found even in a part of the coast, i.e. in the Gulf of Sidra (or Sirte), while in Tripolitania and Cyrenaica there is a bit of vegetation. Only in the hills behind the coast of Cyrenaica (called Jebel Akhdar), the precipitation amount goes from 15 to 28 inches per year, and they are covered by a Maquis shrubland.
Along the coast, the only plains area that receives non-sporadic rains, most of the rainfall occurs from October to early April, with a peak in December and January. The amount is usually low: between 8 and 14 inches per year in Tripolitania and Cyrenaica, between 4 and 8 inches in the Gulf of Sirte, which becomes definitely desert in the southern part, where the rainfall amount drops to 4 in, and, beyond Cyrenaica, again around 4 inches in the easternmost part of the coast, on the border with Egypt (see Tobruk). The rains on the coast are due to the passage of disturbances from the Atlantic or the Mediterranean, alternating with long periods of sunshine even in winter; since the period in which the rains fall is limited, in some years a decrease in winter rainfall may cause drought, whose effects are felt until the following autumn.
In summer, the sun shines and it almost never rains throughout Libya, although in the southern part of the desert, some showers may occur, due to the African monsoon which affects the Sahel region in the warmer months, and whose extreme offshoots can sometimes arrive here. Along the coast, the afternoon breezes blow, which give relief even though the air humidity is high, but in reality in summer the northern winds blow even at high altitude, as they are due to the baric configuration of the region, with the high pressure over the western part of the Mediterranean and the low pressure on the eastern side, and this is why the Libyan desert is less hot than the Algerian. The average maximum temperature in summer goes from 86 °F along the coast, to 95/100 °F in the north-central inland area, and up to 104/106 °F in the south.
Libyan desert
Throughout the year, but more often in spring and autumn, Libya may be affected by the Ghibli, a hot and dry wind raising dust and causing sudden increases in temperature; the phenomenon is even more evident along the coast, where it also produces a collapse of the relative humidity, which is generally high due to the influence of the sea. In these cases, the temperature can exceed 105 °F from April to October, even on the coast, while in winter it can touch 85 °F.
The main cities located on the coast (Tripoli, Benghazi, Misrata) have a Mediterranean climate: mild and quite rainy in winter, with a minimum temperature around 48/50 °F and a maximum around 63/66 °F in January and February, and hot, sunny summers, with highs in July and August of around 90 °F in the western part (see Tripoli, Al Khums), and 86 °F in the central and eastern part, which is more affected by the northern winds which blow in summer in the eastern Mediterranean.
Here are the average temperatures of Tripoli.
Average temperatures - Tripoli
Min (°F)485052576368727370645550
Max (°F)646670758186909188827366

Tripoli is the rainiest city, with 13 inches of rain per year, including 2.4/2.8 inches per month between November and January; in Benghazi, the rainfall amounts to 10.2 inches per year, while in Misrata, near the dry Gulf of Sirte, it amounts to just 7.5 in; in Sirte, in the gulf of the same name, it's about 7.1 in, and in Tobruk in the east, only 4.3 in. Here is the average precipitation.
Average precipitation - Tripoli
Prec. (in)

The sea temperature is warm enough for swimming from July to October, while it is a bit cool in June and November.
Sea temperature - Tripoli
Sea (°F)636161636672778179757266

Proceeding inland, the summer temperature increases quite rapidly: already at the Tripoli International Airport, 10 miles from the coast, highs in July and August rise to 95 °F, and in el-Azizia to 98.5 °F; the latter has been wrongly believed to be the hottest place in the world, due an incorrect measurement carried out in 1922.
A special case is represented by Bayda, at 2,000 feet above sea level, on the hills of Cyrenaica, which receives 21 in of rain per year, and in winter can even see the snow, because of the altitude. Here is the average precipitation.
Average precipitation - Bayda
Prec. (in)

The daily average temperature here goes from 50 °F in January and February, to 74.5 °F in August.
Average temperatures - Bayda
Min (°F)434346505763646463595246
Max (°F)575964727986848482797063

South of Tripoli, there is a mountain range, the Nafusa Mountains, where there are some cities located at a higher altitude (not more than 3,300 feet), such as Nalut, Zintan, Lefren, Gharyan, which in winter are slightly colder than the same Bayda.

Snow in Bayda

In the vast desert region of Libya, the sunshine prevails throughout the year. During winter, the temperature range is high, so the nights are cold (the temperature can also go down around freezing, and even a few degrees below in the north-central part), while the days are pleasant, around 68 °F. The daytime temperature exceeds 85 °F from April to October. In summer, the highest recorded temperatures are around 120 °F. The rains are very scarce and sporadic, in the form of downpour: some areas can see no rain for years. The desert is almost everywhere uninhabited, except near the oases, fed by springs of water that emerge from the ground, like the oases of Kufra and Sabha.
Average temperatures - Sabha
Min (°F)414552616875737370635243
Max (°F)667279909710210010097887768

When to go

While waiting for the conditions of the country to be normalized, we can give some indication on when to visit. To visit Tripoli, Benghazi and the main cities of the north, you can choose spring and autumn, and in particular from mid-March to mid-April and from mid-October to mid-November.
To visit the desert areas, you can choose the winter, from December to February, keeping in mind that it can get cold at night.
The bathing season runs from mid-May to mid-October, although as we have seen the sea begins to be warm in July.

What to pack

In winter: in Tripoli and the coast, spring/autumn clothes, a jacket and a sweater, raincoat or umbrella. In the desert, spring/autumn clothes, light for the day, scarf for the wind-borne sand and dust, sweater, wind jacket, warm jacket for the night. In Bayda and Nafusa Mountains, it's better to add some warm clothes, sweater or fleece, down jacket.

In summer: in general, loose fitting, light-colored clothing, light and long shirt and pants, a wide-brimmed hat, a light scarf, sunglasses (even graduated instead of contact lenses), comfortable and breathable shoes; for women it is best to avoid shorts and miniskirts. On the coast, a light sweatshirt for the evening; in the desert, a sweatshirt for the night, sleeping bag to sleep outdoors, desert boots or sandals.