when i want install file.tgz, i found an error like
I think you are confusing some things here.
tgz files are compressed files,
They are used in slackware to install programs, like ubuntu uses deb files.
installkg is a command in slackware to install these packages.
You can however extract these packages in ubuntu using the tar command
This will not install the package on ubuntu.
As sycamorex suggested, look in the ubuntu package manager for the program you want to install,
or find the deb file.