Ceci est une ancienne révision du document !
1
If you are new to Debian/Ubuntu, then you'll need help installing and managing apps on it. Sure, you can do it via a GUI installer/package manager if a specific Linux distribution already has one pre-installed. But where's the fun in that? If you are managing a virtual server, you probably would not have a GUI. Installing and removing software through a command line is not hard to do, and people have fun with it. You can even do it by using different methods which we will explain in the article below. For the purposes of this tutorial, we will use our Debian 8 VPS, but the same instructions apply to any other Debian-based distribution, including Ubuntu, both for desktop and server versions. Manage software using dpkg Ever seen a .deb file and wondered what it is? Well, that's the Linux version of the Windows “.exe”. You can't click on it to install it, but you can use dpkg, which is a package manager for Debian-based distributions. Note that dpkg can't automatically download and install software for you, you'll have to download a .deb file first, and then install it using dpkg. So, to install a locally-available .deb file using dpkg, use the following command syntax: sudo dpkg -i app-file-name.deb Of course, replace app-file-name.deb with the actual filename of the app you are trying to install.
2
And that's it. It's that simple. If you want to uninstall a package, you can do so using the following command: sudo dpkg -r packagename Although, removing packages with dpkg is not recommended, because it will remove the main package, but it will retain other dependencies that the package has. There's a lot more you can do with dpkg, like listing all installed packages using: dpkg -l Beware, this may give you a huge output, depending on the number of packages you have installed on your system, so you may want to use the less command, for example: dpkg -l | less Refer to the manual for more information and help, by typing the following command: man dpkg
3
Use apt-get to download, install and remove apps Using apt-get is a lot easier way of installing packages or applications. The big upside of using apt-get instead of dpkg is that you can do pretty much everything with apt-get. You don't have to download a package before installing it with apt-get, you can do it instantly by using the following command: sudo apt-get install package_name That's it. The package is installed. You can update a single package using: sudo apt-get –only-upgrade install package_name Note that this will not install any new packages. This just upgrades it. Before installing or updating a package or application, it is a good idea to download the package lists from the repositories and update them to get information on the newest versions of packages, so do it with this command: sudo apt-get update This will update your package lists and the versions you have installed on your system. You should always run the update command first, and then run: sudo apt-get upgrade which will update all of your software to their latest versions. The difference between apt-get update and apt-get upgrade is that the former updates your package information and the latter command actually upgrades your packages.
5
To uninstall (remove) an app from Debian/Ubuntu, use the following commands: sudo apt-get remove package_name This will remove all the files from the package, but it would not remove any configuration files or dependencies. To remove (just about) everything, including configuration files, use: sudo apt-get purge package_name You can remove the dependencies of a package by using this command: apt-get autoremove That's just about it. There's a lot more stuff you can do with apt, just refer to the manual page by using: man apt
6
Installing software from source code on Linux Although not the easiest way of installing software, especially compared to apt-get, it's still fun to compile and install software from source code on Linux. Sometimes it's the only way of doing it. This method should work on almost every Linux distribution. Always refer to the software's official documentation/manual to get the right information. This method can be very different depending on the software you are trying to build. To compile and install an application from source code, you must first unpack it. If the archive is in .tar.gz format, use: tar xvzf package_name.tar.gz If the archive is in tar.bz2 format, use: tar xvjf package_name.tar.bz2 If the archive is in .tar format, use: tar -xvf package_name.tar If the archive is in .zip format, use: unzip package_name.zip
7
Then, you need to configure the software using the ./configure command. First, navigate to the directory where you've unpacked the software: cd package_name Then enter the following command to use the default configuration for the software: ./configure This is the recommended way of doing it, unless the official software distributor recommends doing some other changes. You can see a list of all the options you can use with: ./configure –help The next step is to compile the software. To do so, use the following command: make The compiling process can take from a few minutes to a couple of hours, even days. It all depends on the software you are installing and your machine's hardware specs. For most apps it usually takes a few minutes or so. Watch out for some errors in the output. The most common ones are missing dependencies. You'll need to install them if you notice such errors where there's an output with “not found”, “unable to locate” or something similar. Refer to the official documentation of the app you are compiling to get help with any errors.
8
After the compiling is finished, you can finally install the app using the following command: make install Uninstalling software you've previously manually compiled and installed can be tricky. If the developer has included the option, you can run the following command: make uninstall and the software should be removed, but in some cases that option may not be available to you, so you can run: make clean to remove any files the installation process has outputted, but this will remove only the files in your source/build tree. It won't affect the rest of the filesystem. Again, you should refer to the official documentation of the app you are trying to install/remove. They'll most probably have an in-depth tutorial of doing everything you need. We've covered most methods of managing software on Debian-based distros. What's your favorite way of installing and managing software on Linux? Which method do you prefer? BIO : RoseHosting.com is a privately held company founded in 2001 and based in St. Louis, Missouri - RoseHosting offers quality managed Linux VPS hosting with 24/7 support.