Установка tar пакета линукс

How do I install a .tar.gz (or .tar.bz2) file?

I have downloaded tar.gz files. But I don’t know how to install it. How do I install this kind of file?

As mentioned in some of the answers below, try hard not to install packages via tarball as it will often bork managed packages and get you into in unresolvable state, and make you very sad. Installing via package manager is preferrable in 99.14159265% of cases.

14 Answers 14

The first thing you need to do is extract the files from inside the tar archive to a folder. Let’s copy the files to your desktop. You can extract an archive by right-clicking the archive file’s icon inside your file browser and pressing the appropriate entry in the context menu. Extracting the archive should create a new folder with a similar name. e.g. program-1.2.3 . Now you need to open your terminal and navigate to that directory using the following command:

cd /home/yourusername/Desktop/program-1.2.3 

Make sure you read a file called INSTALL , INSTALL.txt , README , or something similar if one was extracted. You can check if such a file exists from the terminal by using the ls command. The file can be opened and read with the command:

Where INSTALL is the name of your file. This file will contain the right steps to follow to continue the installation process. Usually, the three «classical» steps are:

./configure make sudo make install 

You may also need to install some dependencies if, for example, running configure prompted you with an error listing which dependencies you are missing.

Remember that your mileage may vary.

I would very much recommend using checkinstall, as that will make uninstalling the application much easier.

these are instructions for a specific case. a more common case I run into does not require compiling, the important information to know is where in my filesystem I should move it and how to make .desktop icon file

Tarballs are used to distribute source code almost every time. If you have any specific example of unusual tarball, you may consider adding it as an answer and that would be a specific case.

You cannot «install» a .tar.gz file or .tar.bz2 file. .tar.gz files are gzip-compressed tarballs, compressed archives like .zip files. .bz2 files are compressed with bzip2. You can extract .tar.gz files using:

Similarly you can extract .tar.bz2 files with

If you would like to see the files being extracted during unpacking, add v :

Even if you have no Internet connection, you can still use Ubuntu’s package management system, just download the .deb files from http://packages.ubuntu.com/. Do not forget to download dependencies too.

For an easier way to install packages offline, see the question How can I install software offline?.

Читайте также:  Где настройки сети линукс

@AlwaysLearning How can you post a comment here without an Internet connection. Try the linked «How can I install software offline» link.

Sometimes there is actually no need for an installation. One has only to copy/move the archived files to the right folder: First, find out where the current installation resides, e.g., via which . Then move the extracted contents of tar.gz archive to that folder to overwrite the contents.

How you compile a program from a source

  1. Open a console
  2. Use the command cd to navigate to the correct folder. If there is a README file with installation instructions, use that instead.
  3. Extract the files with one of the commands
    • If it’s tar.gz use tar xvzf PACKAGENAME.tar.gz
    • if it’s a tar.bz2 use tar xvjf PACKAGENAME.tar.bz2
  4. ./configure
  5. make
  6. sudo make install (or with checkinstall )

Download a package from the software sources or the software center.

If you install a package via the software sources and not downloading the package on your own, you will get new updates to that package and install them via the Update Manager.

You could just install MYPACKAGE by typing in a terminal:

sudo apt-get install MYPACKAGE 

or by using the software center and searching for MYPACKAGE . But if it’s not there go with the source.

Well, more generic instructions would be «download the file, unpack and look for install instructions either inside or on the website».

I’ve never got any instructions for installing from a source, I only get a folder with some install.sh or configure files. What sources do you download?

@Alvar: ./configure && make && sudo make install assumes that the package uses an autoconf style of configuring and compiling programs. You should search for the files INSTALL , README or similar. Also, make install won’t work if the prefix is set to a privileged location (which is the default). Therefore, use sudo make install or install it into a directory in the home directory using ./configure —prefix=~/yourprogram . Then put ~/yourprogram/bin in your $PATH or make symlinks to it in ~/bin/ .

Notice that the part about k3b is because this answer was merged from another question (which, I presume, was about installing k3b from source). So if you’re not trying to install k3b, don’t follow that! Not saying that k3b is bad though =P

This is only for .tar.* files which have the code pre-compiled but packed into a tar file.

Okay, this is a fairly challenging task for a beginner, but just follow my instructions, and it should be fine.

First off, download the .tar.* file, and save it. Don’t open it. (In these examples, I’ll be installing the Dropbox Beta build, because I was going to install it anyway, so I figured that I might as well document the installation.)

After you’ve downloaded your file, (assuming that you saved it to Downloads ,) type the following:

cd Downloads sudo cp dropbox-lnx.x86_64-1.5.36.tar.gz /opt/ 

NOTE: use the name of whatever file you downloaded. (e.g., for the Firefox Nightly 19.0a1 64-bit build, you would type sudo cp firefox-19.0a1.en-US.linux-x86_64.tar.bz2 /opt/ )

Читайте также:  Linux mysql внешнее подключение

Now, change to the /opt/ directory, extract the program, and remove the old file:

cd /opt/ sudo tar -xvf dropbox-lnx.x86_64-1.5.36.tar.gz sudo rm -rf dropbox-lnx.x86_64-1.5.36.tar.gz 

(again, use the name of the downloaded file. Don’t forget the extension.)

Okay, check to see what the extracted folder is called:

you’ll get something like this:

james@james-OptiPlex-GX620:/opt$ ls -a . .. .dropbox-dist james@james-OptiPlex-GX620:/opt$ 

Okay, in our example, we installed Dropbox, and the only folder there is called .dropbox-dist . That’s probably the folder we want, so plug that in to the next step (add a / to the end, since it’s a folder.):

sudo chmod 777 .dropbox-dist/ 

Okay, it’s now marked as executable, so it’s time to create a symbolic link (this is what allows you to run it from the Terminal):

sudo ln -s /opt/.dropbox-dist/ /usr/bin/dropbox 

NOTE: this is sudo ln -s /opt// /usr/bin/ . Be sure that is replaced with the simplified, lower-case version of the program’s name (e.g., for Firefox Nightly, type firefox-nightly ; for the uTorrent server, type utserver . Whatever you type here will be the command that you use whenever running the program from the Terminal. Think of /usr/bin/ as like the PATH variable on Windows systems.)

Okay, you’re done. The program is now installed and runnable from the Terminal.
What’s this? You say you want to run it from the launcher, AND you want it to have an icon? No problem!

This part is fairly simple:

gksu gedit /usr/share/applications/dropbox.desktop 

NOTE: If you’re installing OVER a previous installation, use ls -a /usr/share/applications and search for pre-existing .desktop file. Plug that file’s name in instead.

Now, here’s where you create the icon. Here’s good template; edit it appropriately.

[Desktop Entry] Version=1.0 Name=Firefox Nightly Comment=Browse the World Wide Web GenericName=Web Browser Keywords=Internet;WWW;Browser;Web;Explorer Exec=firefox-nightly Terminal=false X-MultipleArgs=false Type=Application Icon=/opt/firefox/icons/mozicon128.png Categories=GNOME;GTK;Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp;x-scheme-handler/chrome;video/webm;application/x-xpinstall; StartupNotify=true Actions=NewWindow; [Desktop Action NewWindow] Name=Open a New Window Exec=firefox-nightly -new-window OnlyShowIn=Unity; 

You may want to leave off the MimeType option completely. That could be very bad if you didn’t.

Now, click «Save», close it out, and you’re in business!

Источник

Шаг 9. Установка программ

Время от времени появляются новые задачи либо необходимость в решении старых задач новыми способами — тогда возникает потребность в дополнительном программном обеспечении. Что делать, если вам нужна новая программа для Linux? Попробую описать некий алгоритм.

1. Надо понять какое именно решение вам нужно. Для этого можно использовать поисковые системы. Формировать запрос о своей проблеме и выбирать подходящие решения.

2. Теперь необходимо понять какая программа нам позволит решить эту проблему. В Linux существует большое число аналогов одних и тех же программ, и среди них надо выбрать лучшую по важному для вас критерию, например: функционал, скорость, удобство, безопасность, бесплатность. Программу ищем также в поисковой системе, но запрос формируем уже для конкретного решения проблемы.

3. После того, как мы выбрали уже конкретную программу — можно приступать к ее поиску. Открываем Synaptic и с помощью поисковой формы пытаемся найти нужное приложение. Вместе с ним мы можем обнаружить множество расширений и дополнительных модулей. Ставим все что надо — это лучший вариант. Приложения в репозиториях обычно протестированы и работоспособны.

Читайте также:  Файл конфигурации ядра linux

Если приложение не найдено в репозитории, то можно поступить двумя способами — либо поискать его аналог, который присутствует в репозитории, либо найти данное приложение вне репозиториев:

1. Находим официальный сайт приложения и пытаемся найти там .deb пакет (У нас Ubuntu Linux — у него пакетная система основана на deb формате). Если такой пакет есть на официальном сайте, то скачиваем его и устанавливаем.

2. Если .deb пакета нет на официальном сайте, то ищем его в поисковой системе (помимо автора, другие люди могли для удобства собрать deb-пакет для приложения). Запрос может выглядеть так: «xneur deb» или «gimp deb».

3. Если нам не повезло и программа настолько редкая, что deb-пакета для нее нет, то смотрим в каком виде она вообще распространяется.

Установка приложения из tar.gz

Часто приложения распространяются в архивах tar.gz. Этот формат не так удобен в Ubuntu, так как это не пакет, а просто архив, в котором могут быть как исходные коды, так и скомпилированные приложения и библиотеки.

1. Распаковываем архив в отдельную директорию.

2. Если есть исполняемый файл — запускаем и пользуемся, если нет — читаем раздел «Компиляция».

Установка приложения из SVN

SVN — Subversion. Это система контроля версий кода, в которых хранится исходный код приложений, особенно Open Source.

1. Создаем директорию для нашего приложения.

2. Открываем терминал в директории (cd ‘путь/к/директории’);

3. Скачиваем исходные коды:

4. Читаем раздел «Компиляция».

Установка приложения из CVS

CVS — Concurrent Versions System. Это также система контроля версий кода.

1. Создаем директорию для нашего приложения.

2. Открываем терминал в директории (cd ‘путь/к/директории’);

3. Скачиваем исходные коды:

4. Читаем раздел «Компиляция».

Установка приложения из RPM

rpm-пакеты не родные для Ubuntu. Существует утилита alien, с помощью которой можно установить как обычные (sudo apt-get install alien). С ее помощью можно переконвертировать rpm-пакет в deb-пакет. Очень проста в использовании:

И в директории с rpm-пакетом появится deb-пакет. А его мы уже без труда установим.

Компиляция

1. Открываем терминал в директории с нашим приложением (cd ‘путь/к/директории’);

2. Смотрим информацию о конфигурировании приложения:

Смотрим вывод и решаем с какими параметрами надо конфигурировать. Если эта команда выдает ошибку — значит конфигуратора нет. Если конфигуратор присутствует — конфигурируем:

Можно эту команду выполнить без аргументов — будет стандартная конфигурация.

В ходе конфигурации могут быть ошибки — обычно недостаток модулей. В случае возникновения ошибок, сразу идем в поисковую систему и ищем решение.

В ходе компиляции могут быть ошибки. В случае ошибок, вам снова поможет поисковая система.

После компиляции мы получаем готовый исполняемый файл, который в большинстве случаев можно запускать и использовать.

Если приложения требует инсталляции, то выполняем (понадобятся права администратора — вспоминаем команду sudo):

Эта команда скопирует файлы приложения в необходимые системные директории.

Приложения, установленные таким образом, могут быть удалены с трудом. Поэтому, советую почитать про программу checkinstall.

Чтобы быть в курсе моих статей, можно подписаться на RSS-канал.

Источник

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