Gnu linux install packages

Installing and Working with Packages in Ubuntu

In Ubuntu, much like any other OS, one needs software. The primary method of software installation is via the GUI Ubuntu Software tool. This, however, is neither the preferred nor the only way of installing packages. Beginners tend to stick to GUIs; however, as you spend more time on Ubuntu, you end up having to resort to existing repositories and adding repositories, and worse comes to worst, manually install the packages. In this tutorial, we will learn to install and work with packages in Ubuntu.

Method 1: Repositories

The best part about Ubuntu and any flavor of Linux is that it comes with its own repository. A repository is basically like a store filled with thousands of packages or software. However, all the software available in the repository is open source and for Linux.

You can, of course, search the repository for available packages using the apt command. To search the repository in Ubuntu:

For example, suppose that I’m looking for a package called MySQL:

Suppose that you’ve found the package you want but are looking for more information about the found package, then you’d use the apt show command.

Next, you can check for the dependencies using the following code:

Once you’re satisfied with the package you’ve found, you can install it. The apt-get install command will fetch and install the dependencies first and then install the package itself so that you can sit back and relax while the command does everything automatically for you. To install using the repository in Ubuntu:

Once installed, it is always a possibility that you might not like the package and wish to completely remove it from your system. To remove an installed package, type:

Apt -get remove will not remove the configuration files of the program you installed, and in those cases, you may use purge instead. To remove everything, including configuration files, you would type:

Method 2: Adding to a repository

There are many instances when and where the package you’re looking for will not be in the repository; however, it might be available in a totally different repository. So what do we do then? We add the repository that does have the file to our own. Apt primarily look for repositories in /etc/apt/sources.list – this is where all the repositories are found.

In order to add another repository to the ones you currently own, you can use the Personal Package Archives (PPAs). It is advised that you do not randomly add repositories, as it is not scanned for malware! Only add from trusted sources!

Читайте также:  Преимущества командной строки linux

For example, if you want to add the ppa for the simple screen recorder:

To remove the ppa repository for the simple screen recorder:

For example, when you want to install Wine for Linux, they ask you to add a repository.

The latter will add the repository specified to /etc/apt/sources.list.

Method 3: Manually install the package

At times, there’s just no other way around it; you need to install the package manually. In such cases, the packaging format you get depends on the software you’re downloading.

DEB Packages
In order to install a DEB packaging, I personally use gdebi:

Once gdebi is installed, you can use the following code to install the .deb package.

Alternatively, most users use the dpkg command. The dpkg command is used to install, build, remove, and manage debian packages. Sometimes, you simply download a deb file and can’t use the apt command; in such cases, we use the dpkg command.

To install a package using dpkg:

One can also use dpkg to scan the deb file to see its contents:

To uninstall using dpkg, you need the package name used by the system; you can get it by typing:

And then uninstall it using the following:

And should it require reconfiguration because it’s corrupt, you can type:

RPM Package
RPM packages are typically used by CentOS, RHEL, and Fedora. However, there are times when as an Ubuntu user, you just need to use an rpm package. You can turn the rpm package into a deb package and install it in such cases.

First, let’s install alien, a package used to convert rpm files into deb files.

Then, download the rpm file and type:

For example, the latter will create a deb version of the same package that you can install with gdebi.

Tarballs
With tarballs, it’s harder to satisfy dependencies, and it’s harder to remove and update. However, there are times when tarballs are the only option, especially if you are prone to downloading off of github. In such cases, to install tarballs:

tar -xvzf package.tar.gz (or tar -xvjf package.tar.bz2)
cd package
./configure
make
sudo make install

Advanced Linux users prefer to install packages via the command line; this is a fact. Packages come in all shapes and forms; this is another fact. Some packages are rpm packages, others are tarballs, others can be found in a repository, and others require you to add novel repositories. In this tutorial, we learned the various ways in which one can install and manage packages. In fact, we rely on the apt and the dpkg commands to manage them overall. Using apt and dpkg, we can install, update, and remove packages.

Читайте также:  Как перезагрузить linux mint через терминал

Источник

Installing Software on Linux¶

One of the most difficult things to get used to in the Linux world is installing new software packages. In the world of Windows, every program comes with a Setup.exe program that asks you some very easy questions and takes care of the job for you. While Linux software can be almost that easy to install, you will sometimes find software that seems to fight every step of the way. I can’t cover all the problems you might run into, but I’ll try to give you the basics and a few pointers to help get you over the rough spots.

Software tends to come in “packages”. In the Windows world a package is a Setup.exe or a program.zip file. On a Mac a package is a program.dmg or a program.sit file. In the Linux world, there are several kinds of packages, and each distribution has its own preferred package format.

The standard Linux package format (according to the Linux Standard Base) is RPM. RPM is a packaging system originally developed by Red Hat and widely used in the Linux community. Distributions using it include Fedora, Mandriva, Red Hat (naturally), and SUSE. An RPM package file normally will be named something like program-version-other.rpm

Another popular package format is DEB, the Debian software package. Debian packages and the Advanced Packaging Tool (APT) were the first to introduce several advanced features that are now common, such as automatic dependency resolution and signed packages. Debian packages are used by Debian GNU/Linux (naturally), and distributions based on it, including Ubuntu, Knoppix, and Mepis. A Debian package file normally will be named something like program-version-other.deb

Remember, you will need to become SuperUser to install software.

Debian, Ubuntu: APT¶

There is a broad array of tools for working with DEB packages, but the one you will commonly use is apt-get , arguably the easiest of Linux package management tools. apt-get is so easy because it not only keeps track of what packages are installed, but also what other packages are available. It will even download them from the Internet for you (if properly configured).

To remove software is just as easy.

Although the repositories that contain installable packages might live on the Internet or on a disc somewhere, APT keeps a local database on your hard drive with a list of all available packages and where to find them. This database needs to be explicitly updated. To update the APT database:

A common idiom is to update your package database, and then upgrade all the packages that have patches or security updates to install. The following command will do this all at once.

apt-get update; apt-get upgrade

For a more indepth apt-get tutorial and other resources, see Managing Software with APT and dpkg .

Читайте также:  Linux ssh указать порт

Fedora, Red Hat: yum ¶

yum does for RPM packages roughly what apt-get does for Debian packages. Like apt-get , yum can download and install packages from a configured repository.

To remove software is just as easy.

yum does not keep a local copy of your package database by default, so normally there is no need to update it. To install all available security patches and bug fixes, use this command:

You can also explicitly update a single package with:

For a more indepth yum tutorial and other resources, see Managing Software with yum and rpm .

Mandriva: urpm ¶

Mandriva Linux (formerly Mandrake and Connectiva) has a toolset similar to APT called urpmi . To install software:

To update the local package database:

To install security updates and bug fixes:

For a more indepth yum tutorial and other resources, see Managing Software with urpm .

Tar Balls¶

No, this is not a naughty term! A tar ball is a (usually compressed) archive of files, similar to a Zip file on Windows or a Sit on the Mac. Tar balls come in files that end in .tar , .tar.gz , .tgz , or something along these lines. To unpack a tar ball, use this command.

The parameters are x to extract files, z to filter through gzip for decompression (leave this off if the file does not have a gz extension), v for verbose mode so you can tell what’s going on, f indicating there will be a filename to follow. You may want to create an alias called “untar” that feeds in these options if you have a hard time remembering command line options as I do.

This command will not install the software, it will only extract the archived files. It is your job then to find the README file or INSTALL file and read its instructions for installation. If the archive contains binaries there will usually be a setup script (often called install.sh ) that you must execute as SuperUser .

Very often, software delivered in tar balls is not in executable form, but in source code, which must first be compiled before it can be installed. For more details on this, see Installing Software from Source Code .

Other Systems¶

Some other Linux distributions have their own way of managing packages, notably SUSE. SUSE uses RPM as its native package format, but has its own high level tool to manage system software installation.

SUSE Linux uses a tool called yast (which allegedly is an acronym for Yet Another Setup Tool) to perform all kinds of system administration tasks, including installing software. Having no experience with it, I cannot give you more details. man yast for help.

Источник

Оцените статью
Adblock
detector