The two words are synonyms. Literally, "乏味" means insipid and "枯燥" means dull and dry, so they can replace each other in many cases. People usually use them together as "枯燥乏味" to reinforce that mood.
Sometimes they are not exchangeable according to the context, for example, you won't say "他很枯燥" instead of ”他很乏味“, or say "乏味的练习" instead of "枯燥的练习". If you are not sure which word should be used, just put them together, and you won't be wrong - ”他很枯燥乏味“ and ”枯燥乏味的练习“ are both correct.