Printer support for Ubuntu ( and Linux in general ) varies a lot.
Generally though many will just plug in and work ( Epson and HP being
the two that usually do ). Those that aren't 'plug and go' can take a
bit of getting going but usually there are instructions to follow,
which can be fairly simple bit can be complex.
However, regarding the two you have ...
B> LEXMARK X7170 MULTIFUNCTION INK JET
Simple answer here - it won't work in Ubuntu. Sorry :-(
B> CANON LBP5000 LASER PRINTER.
Canon have better support for Ubuntu and the page below has the
instructions on how to do it. Means installing the script that the
writer has created and running a command in terminal.
radu.cotescu.com/.../
Good luck with the Canon - from all accounts it will work well.