The best way for you to fix this problem might be to reinstall Ubuntu. (You should back up your documents first, even if you plan to reinstall without reformatting.)
If you do want to try to fix the system in place, then look at the package manager's log files to see what packages were removed, and reinstall them:
/var/log/dpkg.log (full information, but hard to read)
/var/log/apt/history.log (abbreviated by will tell you every package removed or otherwise modified - likely your best bet)
/var/log/apt/term.log (if you removed the packages with
apt-get in the terminal, this should show what you saw then, including lists of what packages were going to be removed - so this might be the best way)
Reinstalling just packages whose names start with
jpeg won't work, because many (almost certainly most) of the packages that were removed were removed because they relied on those packages.
In the future, I recommend carefully checking the consequences of uninstalling a package. If you're working from the command-line, you'll always be notified. (Unless you use the
-y option, in which case, usually not. I recommend against using that option unless you know what you're doing, especially for removals.)
One way to check the consequences of a package management operation carried out with
apt-get, without risking them happening, is to run
apt-get -s instead of
sudo apt-get. This merely simulates the action specified, and reports what packages are would be affected as a result and how.
apt-getwill tell you what it plans to un/install and ask you if that's OK. I get that maybe we're used to just saying 'yeah whatever' because of excessive confirmations in other contexts, but Linux is pretty good about not asking frivolously, and package-management is not a context where you should default to having your guard down.