Problem
Manually download and install a package from the web on Linux.
tl;dr
Red Hat/Fedora/CentOS:
wget http://example.com/package1.rpm rpm -U package1.rpm
Debian/Ubuntu:
wget http://example.com/package1.deb dpkg -i package1.deb
Solution
Usually, when you want to install a package, such as a tool or piece of software, you would do it with a package manager, such as:
yum install httpd
However, sometimes you may come across a package (for example, on SourceForge) that is not listed in a repository. While it is possible to upload it from your workstation to your server using Filezilla or another SSH file transfer client, it's easier to simply download it directly from where it's stored.
Download the package
wget http://www.example.com/yourpackage.rpm
This will download the package to your current directory. The wget command works for HTTP, HTTPS and FTP protocols. You can also save the installer to a different directory by specifying it with the -P argument. For example, to save it to/usr/temp/stuff you would run:
wget http://www.example.com/yourpackage.rpm -P /usr/temp/stuff/
If you are having difficulty with the -P /directory command, create the required directory first using mkdir.
Install the packageThen, you would need to install the package you downloaded. The exact command varies according to your Linux flavour. Assuming you downloaded the package to /usr/temp/stuff/,
Red Hat/CentOS:
rpm -U /usr/temp/stuff/yourpackage.rpm
Ubuntu/Debian:
dpkg -i /usr/temp/stuff/yourpackage.deb
- Updated