README.md 32.8 KB
Newer Older
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
1
# Linux Installer for Archives
2

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
3
## Table of contents
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
4

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
5
- [Features](#features)
6
- [Recent changes](#recent-changes)
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
7 8 9 10 11
- [Installation](#installation)
- [Sample use](#sample-use)
- [Documentation](#documentation)
- [Dependencies](#dependencies)
- [Tested software](#tested-software)
12
- [Unit tests](#unit-tests)
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
13
- [Docker image](#docker-image)
14
- [Try it](#try-it)
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
15
- [Similar software](#similar-software)
16
- [FAQ](#faq)
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
17
- [License](#license)
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
18

19
**L**inux **I**nstaller for **AR**chives a.k.a `liar` is an easy to use command to install software packaged as an archive on Linux systems.
pyfourmond's avatar
pyfourmond committed
20

21
Nowadays more and more software and tools are delivered as a tarball or compressed one instead of being installed from Linux official repositories. A typical example of this is [JDK](http://jdk.java.net/). It also happens that a software present in the Linux repository is not up to date enough for your needs.
pyfourmond's avatar
pyfourmond committed
22

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
23
Moreover there is an increasing need to not only being able to install software without having administrator privileges but also to have the ability to install several versions of the same software on the same machine.
pyfourmond's avatar
pyfourmond committed
24

25
That's why `liar` addresses simply these needs with a standalone Shell script to install, list and remove software packaged in an archive file of one of the following formats: **.tar** **.tar.bz2** **.tar.gz** **.gz** **.tar.xz** **.tar.Z** **.tbz2** **.tgz** and **.zip**. Single binary files are also supported.
26

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
27
Very few dependencies are needed, see [Dependencies](#dependencies) section for details.
pyfourmond's avatar
pyfourmond committed
28

29
It is developed on [Debian GNU/Linux](https://www.debian.org) version 10.5 using **dash** version 0.5.10.2-5.
30

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
31
Additionally, tests are done on Debian version 8.11 with dash version 0.5.7-4+b1.
pyfourmond's avatar
pyfourmond committed
32

33
`liar` conformance to **sh** syntax is checked with [ShellCheck](https://www.shellcheck.net) and [checkbashisms](https://sourceforge.net/projects/checkbaskisms/) tools.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
34

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
35
## Features
36

37
`liar` provides installation, listing and removal of tarball packaged software in a simple command with:
38

39
- Installation of software archives located on filesystem or network
40
- Destination folder selection
41
- Possibility to download and cache an archive before its installation
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
42
- Internal software archives cache, optional for local archives
43
- Download user agent choice (wget, curl or aria2c) for network archives
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
44
- Download resume (network archives)
45
- Secure installation to prevent software duplicates in a given destination folder
46
- Integrity for non `liar` installed software or unknown folder as `liar` does not remove nor list software it has not installed itself
47 48
- Secure software removal guaranteed by interactive user confirmation
- Optional root usage
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
49
- Symbolic links creation for installed binaries with folder selection and binaries filtering
50
- Bash command line completion to help entry of options, commands and parameters
51

52
For a full list of features, see also [New features](#new-features) section which describes what's new since `liar` version 0.1.
53

54
It can install Atom, Go, Gradle, IntelliJ IDEA, JDK Reference Implementations, Robo 3T, Sublime Text, Visual Studio Code and many more.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
55

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
56
For a complete list of tarball delivered software installable with `liar`, see [Tested Software](#tested-software).
57

58 59
## Recent changes

60 61 62 63
### Try liar with Repl.it

You can now try `liar` in your browser with [Repl.it](https://repl.it/@grumpyf0x48/liar).

64 65 66 67 68 69 70 71 72
### Cache commands parameters changes

Cache commands `display` and `clean` now accept an optional NAME parameter to be coherent with `install` and `download`
commands and ease command line completion.

Also, this parameter is now optional for `download` command.

See [cache commands](#download) documentation for more details.

73 74
### XDG Base Directory

75
[Configuration and cache files](#configuration-files) now follow the XDG Base Directory specification.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98

Moreover, some configuration files have been renamed.

As a consequence, the following files and folders:

- `$HOME/.liar_software`
- `$HOME/.liar_mime_types`
- `$HOME/.liar_cache`

are now located (when `XDG_` environment variables are set) in:

- `$XDG_CONFIG_HOME/liar/liar-software`
- `$XDG_CONFIG_HOME/liar/liar-mime-types`
- `$XDG_DATA_HOME/liar/cache`

otherwise, they are located in:

- `$HOME/.config/liar/liar-software`
- `$HOME/.config/liar/liar-mime-types`
- `$HOME/.local/share/liar/cache`

**Warning:** No migration is performed to move nor rename any file or folder.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
99
## Installation
pyfourmond's avatar
pyfourmond committed
100

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
101
`liar` [version 0.1](https://framagit.org/grumpyf0x48/liar/tree/0.1) has been released on Fri, 14 Apr 2017.
102

103
View the most commonly used commands in the [Getting started with Linux Installer for Archives](https://asciinema.org/a/109135) video:
104

105
<a href="https://asciinema.org/a/109135?autoplay=1" title="Getting started with Linux Installer for Archives" target="_blank"><img src="GettingStarted.png" width="50%" height="50%" /></a>
106

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
107
To install the released version, jump to [Released version installation](#released-version-installation).
108

109
Otherwise, go on with the development version.
110

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
111
### Development version installation
112

113
`liar` current development version is [version 0.2-dev](https://framagit.org/grumpyf0x48/liar/tree/master).
114

115
Since `liar` version 0.1, the following features and changes have been added to the current version.
116

117 118 119
#### New features

- Software archive checksum verification (md5, sha1, sha256 or sha512)
120 121
- Improvements for binaries filtering in symbolic links creation
- Simplified usage with samples only displayed in verbose mode
122
- Automatic completion of software names and urls for more than 50 tested software (for x86_64 architecture)
123
- Remove command is now able to remove several software at a time
124 125
- Complete rewrite of command line completion
- list command output can be sorted by any column
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
126
- Ability to upgrade `liar` and `liar-completion` files (development version only)
127
- Manual and periodic upgrade of [liar-software](#liar-software) file from the [Git repository](https://framagit.org/grumpyf0x48/liar)
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
128
- Several patterns can now be used for symbolic links creation
129
- Possibility to download and cache an archive before its installation
130
- New command to display cache list and cached file details
131 132
- list command accepts an optional parameter which is a list of software
- Installed software version has been added to the list command
133
- New command to clean an archive from the cache
134
- Allow executing commands from standard input or from a file
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
135
- Add [cheatsheet](cheat/liar) for `liar` command
136
- [Configuration files](#configuration-files) stored according to the XDG Base Directory specification
137
- New command [config](#config) to display `liar` configuration files
138
- Harmonized cache commands parameters with `install` command
139

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
140
#### Basic installation
141

142
```console
143
$ sudo \
144 145 146
      curl \
          -L https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar \
          -o /usr/local/bin/liar
147
```
148

149
or you can use `wget` instead:
150

151
```console
152
$ sudo \
153 154 155
      wget \
          https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar \
          -O /usr/local/bin/liar
156
```
157 158 159

Then:

160 161
```console
$ sudo chmod 755 /usr/local/bin/liar
162
```
163

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
164
#### Bash completion installation
165

166 167 168
`liar` supports Bash command line completion for options, commands and parameters. Default values for options with parameters is also handled.

To use it, enter the following command:
169

170
```console
171
$ sudo \
172 173 174
      curl \
          -L https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar-completion \
          -o /etc/bash_completion.d/liar-completion
175
```
176

177
Alternatively you can also use `wget`:
178

179
```console
180
$ sudo \
181 182 183
      wget \
          https://git.framasoft.org/grumpyf0x48/liar/raw/master/liar-completion \
          -O /etc/bash_completion.d/liar-completion
184
```
185

186
Then, start a new Bash interpreter.
187

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
188
#### Cheatsheet installation
189

190
`liar` now ships with a [cheatsheet](cheat/liar) usable with [cheat](https://github.com/cheat/cheat) command.
191

192
To install the cheatsheet, after [having installed](https://grumpyf0x48.org/?p=2247) `cheat`:
193

194
```console
195
$ curl \
196 197
      -L https://git.framasoft.org/grumpyf0x48/liar/raw/master/cheat/liar \
      -o ${HOME}/.config/cheat/cheatsheets/personal/liar
198
```
199

200
or with `wget`:
201

202
```console
203
$ wget \
204 205
      https://git.framasoft.org/grumpyf0x48/liar/raw/master/cheat/liar \
      -O ${HOME}/.config/cheat/cheatsheets/personal/liar
206
```
207 208 209

You can now use the cheatsheet with:

210 211
```console
$ cheat liar
212
```
213

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
214
### Released version installation
215

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
216
#### Basic installation
217 218

To install `liar` 0.1 version, simply enter:
219

220
```console
221
$ sudo \
222 223 224
      curl \
          -L https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar \
          -o /usr/local/bin/liar
225
```
pyfourmond's avatar
pyfourmond committed
226

227
Or you can use `wget` instead:
pyfourmond's avatar
pyfourmond committed
228

229
```console
230
$ sudo \
231 232 233
      wget \
          https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar \
          -O /usr/local/bin/liar
234
```
pyfourmond's avatar
pyfourmond committed
235 236 237

Then:

238 239
```console
$ sudo chmod 755 /usr/local/bin/liar
240
```
pyfourmond's avatar
pyfourmond committed
241

242
#### Installation without sysadmin rights
243

244
Without sysadmin rights, use the following command:
245

246
```console
247
$ curl \
248 249
      -L https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar \
      -o ~/bin/liar
250
```
251 252 253

Or:

254
```console
255
$ wget \
256 257
      https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar \
      -O ~/bin/liar
258
```
259

260
Then:
261

262
```console
263
$ sudo chmod 755 ~/bin/liar
264
```
265

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
266
#### Bash completion installation
267

268
To install Bash command line completion, enter the following command:
269

270
```console
271
$ sudo \
272 273 274
      curl \
          -L https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar-completion \
          -o /etc/bash_completion.d/liar-completion
275
```
276

277
Alternatively you can also use `wget`:
278

279
```console
280
$ sudo \
281 282 283
      wget \
          https://git.framasoft.org/grumpyf0x48/liar/raw/0.1/liar-completion \
          -O /etc/bash_completion.d/liar-completion
284
```
285 286 287

Then, start a new Bash interpreter.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
288
## Sample use
pyfourmond's avatar
pyfourmond committed
289

290
`liar` sample use has been moved to [SAMPLES](SAMPLES.md) file.
pyfourmond's avatar
pyfourmond committed
291

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
292
## Documentation
pyfourmond's avatar
pyfourmond committed
293

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
294
This section describes which commands, [options and parameters](#options-and-parameters) `liar` accepts.
pyfourmond's avatar
pyfourmond committed
295

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
296
### Commands
pyfourmond's avatar
pyfourmond committed
297

298
`liar` supports the following commands:
299 300 301 302 303

- help
- install
- list
- remove
304
- upgrade
305
- config
306
- version
307 308 309 310 311 312

used to:

- Getting help
- Install a software
- List installed software
313
- Remove one or several software
314
- Upgrade `liar`
315
- Displaying `liar` configuration
316 317 318 319 320 321
- Getting `liar` version

Additionally, the following commands act on the local archive cache:

- download
- display
322
- clean
323 324 325 326 327

to respectively:

- Download a software
- Display the cached archives or the content of a cached archive
328
- Clean an archive
329

330 331
It is also possible to read and execute commands from standard input or from a file.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
332
#### help
333

334
To get help of `liar` usage, simply enter:
335

336 337
```console
$ liar help
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373
Usage: liar [OPTIONS...] COMMAND [PARAMETERS...]

      Handles installation, removal and listing of software packaged in an archive.

      Supported archive types are: .tar .tar.bz2 .tar.gz .gz .tar.xz .tar.Z .tbz2 .tgz and .zip.
      Single binary files are also supported.

      OPTIONS:
                -d      Specify DESTINATION folder. If unspecified, installation will be done in /home/user/Programs.
                -l      Create symbolic links in /home/user/bin folder after installation.
                -h      Remove extension for SHELL symbolic links
                -s      Specify the folder for SYMBOLIC links creation.
                -p      Specify the file PATTERN(s) to restrict symbolic links creation.
                -n      Use -name find flag instead of default -wholename flag for executables search.
                -u      Specify the download user AGENT: wget, curl or aria2c. By default, wget is used.
                -e      Use content disposition header.
                -k      Bypass server certificate check.
                -c      Specify the file path expected CHECKSUM.
                -t      Specify the checksum TYPE: md5, sha1, sha256 or sha512. By default sha1 is used.
                -S      Specify the sort COLUMN to use in list command.
                -v      Activate VERBOSE mode.
                -x      Activate VERBOSE mode for download operations.
                -r      Allow ROOT usage.
                -b      Bypass CACHE use for local archives.
                -f      Bypass user CONFIRMATION.

       COMMANDS:
                 install NAME FILE_PATH      Install a software packaged in the archive FILE_PATH into the folder DESTINATION under the name NAME.
                 list NAMES...               List installed software.
                 remove NAMES...             Remove the software(s) named NAMES.
                 upgrade                     Upgrade liar.
                 config                      Display liar configuration.
                 version                     Print the version of liar.
                 help                        Display this help.

       CACHE COMMANDS:
374 375 376
                 download [NAME] FILE_PATH   Download or cache the software from the archive FILE_PATH.
                 display [NAME] [FILE_PATH]  Display the cached archives or the content of the cached archive FILE_PATH.
                 clean [NAME] FILE_PATH      Clean the cached archive FILE_PATH.
377
```
378

379 380
With `-v` option, `liar` help output also includes sample commands:

381 382
```console
$ liar -v help
383 384 385

...
      EXAMPLES:
386 387
                liar install sublime https://download.sublimetext.com/sublime_text_3_build_3211_x64.tar.bz2
                liar -l install jbang https://github.com/jbangdev/jbang/releases/download/v0.52.0/jbang-0.52.0.zip
388
                liar -l -p "sublime*" install sublime Downloads/sublime_text_3_build_3126_x64.tar.bz2
389
                liar -v -a curl install idea_community https://download.jetbrains.com/idea/ideaIC-2020.2.3.tar.gz
390
                liar remove sublime
391 392
                liar download sublimemerge https://download.sublimetext.com/sublime_merge_build_2025_x64.tar.xz
                liar display maven apache-maven-3.3.9-bin.tar.gz
393 394 395
                liar -S 4 list
                liar -r -d /opt/liar-installations list
```
396

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
397
#### install
398

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
399
In its simplest form, the install command takes only two parameters.
400 401 402

For example:

403 404
```console
$ liar install jdk8 ~/Downloads/jdk-8u101-linux-x64.tar.gz
405 406 407
Installing 'jdk8' from '/home/user/Downloads/jdk-8u101-linux-x64.tar.gz' to '/home/user/Programs/jdk8'
Extracting '/home/user/.liar_cache/jdk-8u101-linux-x64.tar.gz' to '/home/user/Programs/jdk8'
```
408 409 410

The parameters are:

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
411
- the name to give to the software being installed
412 413
- the input archive containing the software

414
Additionally, all `liar` options except `-f` can be used to alter the install command behavior.
415

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
416
See [Options and parameters](#options-and-parameters) section for more details.
417

418 419 420 421 422 423
#### download

The download command takes the same parameters as the install one but only downloads the archive to the cache without installing it.

For example:

424 425
```console
$ liar download sublimemerge https://download.sublimetext.com/sublime_merge_build_1119_x64.tar.xz
426
```
427

428
Once the archive has been downloaded it can be installed later on with slightly the same command line:
429

430 431
```console
$ liar install sublimemerge https://download.sublimetext.com/sublime_merge_build_1119_x64.tar.xz
432
```
433

434 435
Having replaced `download` by `install`.

436 437
The cached archive will then be used during the installation.

438 439
If the last argument to the download command is a local file, then this file will be cached.

440 441
**Note:** The optional software name parameter of the `download`, `display` and `clean` commands is only here to ease
bash completion of the software archive path or URL.
442 443 444 445 446

#### display

The display content can display either all cached archives:

447 448
```console
$ liar display
449
```
450

451
In this case, all archives found in `$XDG_DATA_HOME/liar/cache` folder are listed.
452 453 454

or the content of a given archive:

455 456
```console
$ liar display micronaut-1.1.0.zip
457
```
458 459

which lists the content of the chosen archive.
460

461 462 463 464 465 466
Another possible syntax is:

```console
$ liar display micronaut micronaut-1.1.0.zip
```

467 468 469 470 471 472
#### clean

The clean command deletes an archive from the cache.

For example:

473 474
```console
$ liar clean openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz
475
```
476

477 478 479 480 481 482
Other syntax:

```console
$ liar clean jdk8 openjdk-8u40-b25-linux-x64-10_feb_2015.tar.gz
```

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
483
#### list
484

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
485
The list command displays which software are installed in the DESTINATION folder:
486

487 488
```console
$ liar list
489
Listing installed software in '/home/user/Programs'
490

491
Name           Version    Folder             File Name                              Date
492

493 494 495 496 497
spring         2.2.2      spring-2.2.2.REL   spring-boot-cli-2.2.2.RELEASE-bin.zi   2019/12/28
maven          3.6.3      apache-maven-3.6   apache-maven-3.6.3-bin.tar.gz          2019/12/28
sublimemerge   1107       sublime_merge      sublime_merge_build_1107_x64.tar.xz    2019/04/27
torbrowser     7.5.4      tor-browser_fr     tor-browser-linux64-7.5.4_fr.tar.xz    2018/05/26
```
498

499 500
It is also possible to display only some of the installed software:

501 502
```console
$ liar list gradle graalvm micronaut
503
Listing installed software in '/home/user/Programs'
504

505
Name           Version    Folder             File Name                              Date
506

507 508 509 510
gradle         6.3        gradle-6.3         gradle-6.3-bin.zip                     2020/04/13
graalvm        19.2.1     graalvm-ce-19.2.   graalvm-ce-linux-amd64-19.2.1.tar.gz   2019/10/19
micronaut      1.1.0      micronaut-1.1.0    micronaut-1.1.0.zip                    2019/04/21
```
511

512 513
When using verbose mode, more info is displayed:

514 515
```console
$ liar -v list
516 517 518
Enabling verbose mode
DESTINATION option is not set, Using '/home/user/Programs' by default
Listing installed software in '/home/user/Programs'
519

520
Name           Version    Folder             File Name                              Sha1       Date         Time       Links
521

522 523 524 525 526
spring         2.2.2      spring-2.2.2.REL   spring-boot-cli-2.2.2.RELEASE-bin.zi   5f044c23   2019/12/28   10:19:06   1
maven          3.6.3      apache-maven-3.6   apache-maven-3.6.3-bin.tar.gz          cc836dc7   2019/12/28   10:54:51   3
sublimemerge   1107       sublime_merge      sublime_merge_build_1107_x64.tar.xz    1de285d2   2019/04/27   11:39:15   1
torbrowser     7.5.4      tor-browser_fr     tor-browser-linux64-7.5.4_fr.tar.xz    fdb76498   2018/05/26   05:47:58   1
```
527 528 529 530 531

By default, the list command output is ordered by last installation date.

To sort the output using another column, `-S` option may be used. For example, to sort according to the name:

532 533
```console
$ liar -S1 list
534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
Setting sort column to: 1
Setting sort order to: 'normal'
Listing installed software in '/home/user/Programs'

Name           Version    Folder             File Name                              Date

firefox        64.0.2     firefox            firefox-64.0.2.tar.bz2                 2019/01/27
graalvm_rc16   1.0.0.16   graalvm-ce-1.0.0   graalvm-ce-1.0.0-rc16-linux-amd64.ta   2019/10/20
hugo           0.31.1     hugo               hugo_0.31.1_Linux-64bit.tar.gz         2017/12/09
idea_communi   2018.2     idea-IC-182.3684   ideaIC-2018.2.tar.gz                   2018/08/06
marp           0.0.13     locales            0.0.13-Marp-linux-x64.tar.gz           2018/07/28
maven          3.6.3      apache-maven-3.6   apache-maven-3.6.3-bin.tar.gz          2019/12/28
spring         2.2.2      spring-2.2.2.REL   spring-boot-cli-2.2.2.RELEASE-bin.zi   2019/12/28
sublimemerge   1107       sublime_merge      sublime_merge_build_1107_x64.tar.xz    2019/04/27
torbrowser     7.5.4      tor-browser_fr     tor-browser-linux64-7.5.4_fr.tar.xz    2018/05/26
```
550 551

A negative value supplied to `-S` option will reverse the sort.
552

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
553
#### remove
554

555 556
The remove command takes one or more parameters, which are the name(s) of the software(s) to remove. The software name
was given by the first parameter of the install command.
557

558
A typical remove sample use is:
559

560 561
```console
$ liar remove maven3
562 563 564
Removing 'maven3' installed in '/home/user/Programs/maven3'
Do you want to remove 'maven3' installed in '/home/user/Programs/maven3' (Y/N) ? Y
```
565

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
566 567
When removing a software, a confirmation is asked to the user. This confirmation can be removed if `-f` option is used:

568 569
```console
$ liar -f remove maven3
570 571 572
Enabling force mode
Removing 'maven3' installed in '/home/user/Programs/maven3'
```
573 574 575

The remove command can be used with the general options described below.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
576
#### upgrade
577

578
The upgrade command allows to upgrade:
579

580
- `liar` and `liar-completion` files with the latest development version available (development version only)
581
- `liar-software` file  (when not customized)
582 583 584

When `liar` has been installed with root:

585 586
```console
$ sudo liar -r upgrade
587
```
588 589

For non-root installations:
590

591 592
```console
$ liar upgrade
593
```
594

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
595 596
The upgrade command prompts the user for confirmation. If you want to bypass confirmation, simply add `-f` flag to the previous commands.

597 598
#### config

599
`config` command displays `liar` configuration files and cache folder location:
600

601 602
```console
$ liar config
603 604 605 606
/usr/local/bin/liar                       755b984f   2020/09/10   07:52:27
/etc/bash_completion.d/liar-completion    19d65ca7   2020/09/09   20:15:10
/home/user/.config/liar/liar-software     cb9aad29   2020/09/10   06:59:56
/home/user/.config/liar/liar-mime-types   aeaee056   2020/09/10   07:07:46
607
/home/user/.local/share/liar/cache                   2020/09/24   08:12:29
608
```
609

610 611 612 613
#### version

To display the version of `liar` being used, enter:

614 615
```console
$ liar version
616 617
liar version 0.1
```
618

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
619
#### standard input (or file) command execution
620 621 622 623 624

`liar` commands described above can now be executed from standard input.

Typical uses are:

625 626
```console
$ liar < <(printf "version\nhelp\n-v list")
627
```
628

629 630
```console
$ printf "version\nhelp\n-v list\n" | liar
631
```
632 633 634

or from a file with:

635 636
```console
$ liar < cmd_file
637
```
638

639 640
```console
$ cat cmd_file | liar
641
```
642 643 644

Having a command file like this:

645 646
```console
$ cat cmd_file
647 648 649 650 651
version
help
install sublime Downloads/sublime_text_3_build_3126_x64.tar.bz2
list
```
652 653 654 655 656

The execution of commands will stop after the first failing command.

**Note:** When using command execution from standard input or from a file, any option passed on the command line will be ignored.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
657
### Options and parameters
658

659
Now that we have seen which commands `liar` implements, let's see the options they can use, and the parameters they need.
660 661

General options are:
pyfourmond's avatar
pyfourmond committed
662

663 664 665 666 667 668 669 670 671 672
- DESTINATION folder (`-d`)
- VERBOSE mode (`-v`)
- VERBOSE mode for download operations (`-x`)
- ROOT usage (`-r`)
- Bypass CACHE (`-b`)
- Bypass user CONFIRMATION (`-f`)
- Download user AGENT (`-u`)
- Content disposition header (`-e`)
- Bypass server certificate check (`-k`)
- CHECKSUM type and value (`-t`, `-c`)
pyfourmond's avatar
pyfourmond committed
673

674 675
Symbolic links creation options are:

676 677 678 679
- Remove extension for SHELL symbolic links (`-h`)
- folder for SYMBOLIC links creation (`-s`)
- file PATTERN(s) for SYMBOLIC links (`-p`)
- find TYPE for executables search (`-n`)
680 681

Command parameters are:
pyfourmond's avatar
pyfourmond committed
682 683 684 685

- software NAME
- archive FILE_PATH

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
686
#### Destination folder
pyfourmond's avatar
pyfourmond committed
687

688
`liar` helps you to install remove and list software that is packaged as a tarball, the FILE_PATH, in a folder of your choice, the DESTINATION folder.
pyfourmond's avatar
pyfourmond committed
689

pyfourmond's avatar
pyfourmond committed
690
DESTINATION folder default value is: `$HOME/Programs`.
pyfourmond's avatar
pyfourmond committed
691

692 693
This option can be used with install, list and remove commands.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
694
#### Name
pyfourmond's avatar
pyfourmond committed
695

696
When installing a software `liar` needs two mandatory parameters, the NAME and the FILE_PATH.
pyfourmond's avatar
pyfourmond committed
697

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
698
NAME is used to create a sub-folder in the DESTINATION folder in order to install the desired software.
pyfourmond's avatar
pyfourmond committed
699

700
The NAME parameter is also mandatory when removing a software. Several NAME parameters may also be supplied to the remove command when removing several software at a time.
pyfourmond's avatar
pyfourmond committed
701

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
702
#### File path
pyfourmond's avatar
pyfourmond committed
703 704

FILE_PATH is the path of the archive containing the software to install.
pyfourmond's avatar
pyfourmond committed
705

706 707
The FILE_PATH parameter is specific to the install command.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
708
#### Verbose mode
709

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
710
When option `-v` is set, verbose mode is activated. In this mode, some commands display more detailed output when executed.
711

712 713 714 715
#### Verbose mode for download operations

When option `-x` is set, more verbose output is displayed by download operations done with `wget`, `curl` or `aria2c`.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
716
#### Root usage
pyfourmond's avatar
pyfourmond committed
717

718
By default, `liar` will not let you install, list nor remove software when logged as root. To allow root usage `-r` option should be used.
pyfourmond's avatar
pyfourmond committed
719

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
720
#### Bypass cache
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
721

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
722 723
`liar` uses an internal cache for the archives it installs. It is used for example for download resume. This cache may be disabled when installing a local archive using `-b` option.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
724
#### Bypass user confirmation
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
725

726
When removing one or several software, or when using the command upgrade, a confirmation is asked to the user to prevent unwanted removal. To skip this confirmation, `-f` option may be used.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
727

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
728
#### Download user agent
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
729 730

When installing an archive that is downloaded from the internet, the default user agent is `wget`.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
731

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
732
It is possible to change this behavior using `-u` flag with one of the following values:
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
733

734
- aria2c
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
735 736 737
- curl
- wget

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
738 739
#### Content disposition header

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
740
Some software providers supply their URL in the form of https://dl.pstmn.io/download/latest/linux64 making use of the content disposition header. In this case, the `-e` flag should be used to get the effective file name.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
741

742 743 744 745
#### Bypass server certificate check

`-k` option allows downloading software from https servers that are not trusted locally.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
746
#### Checksum type and value
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
747 748 749 750 751 752 753

`liar` supports checksum verification for downloaded file path.

To set the checksum of the file to install, use the `-c` option followed by the SHA1 checksum. If the checksum is not a SHA1 but a MD5, SHA256 or SHA512, you can set the checksum type using the `-t` flag.

For example:

754 755
```console
$ liar -t sha256 -c a5a4f948d259734ac5649122d0c2f7e885b48162cde78e43415638cbfd7a7aa3 install idea_community https://download-cf.jetbrains.com/idea/ideaIC-2018.1.1.tar.gz
756
```
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
757

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
758 759 760 761 762 763 764 765 766 767
#### Symbolic links creation

After a software is installed `liar` can optionally create symbolic links for installed executables to a folder of your choice, the folder for SYMBOLIC links creation.

Symlinking can be done for all or only some of the executables installed.

In this case, the file PATTERN(s) used to filter the executables to symlink is(are) a(some) pattern(s) understood by the **find** command **-wholename** flag (by default).

If `-n` flag is used, the **find** command **-name** flag is used instead.

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
768
Several patterns should be separated by `|`.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
769 770 771 772 773 774 775 776

For convenience, an initial `*` is added to the beginning of each pattern if not already present.

The folder for SYMBOLIC links creation is optional and has the following default values:

- `/usr/local/bin` for root installation
- `$HOME/bin` otherwise

777 778
Additionally, `-h` flag now allows removing `.sh` extension for symbolic links pointing towards SHELL files:

779 780
```console
$ ls -l bin/jgo
781 782
lrwxrwxrwx 1 user user 46 sept. 10 07:09 bin/jgo -> /home/user/Programs/jgo/jgo-0.3.0/jgo.sh
```
783

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
784
### Configuration files
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
785

786 787 788 789
`liar` uses configuration files located in:

- `$XDG_CONFIG_HOME/liar` if `XDG_CONFIG_HOME` is set
- `$HOME/.config/liar` otherwise
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
790

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
791
These files are created at `liar` first use.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
792 793 794

The user can modify these files, but he should keep in mind that these modifications may be lost if the configuration files are updated by a new version of `liar`.

795
#### liar-mime-types
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
796

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
797
When creating [symbolic links](#symbolic-links-creation), this file is used to determine whether a file is an executable or not.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
798

799
`liar-mime-types` looks like:
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
800 801 802 803 804 805 806 807 808 809 810 811 812

```
# Updated by liar at mardi 17 juillet 2018, 20:28:59 (UTC+0200)
application/x-executable
application/x-perl
application/x-sh
application/x-shellscript
application/x-tcl
text/x-perl
text/x-python
text/x-sh
```

813 814
It is customisable by the user.

815 816 817 818 819
#### liar-software

This file is a catalog of software tested with `liar` and defines their version and archive URL.

It is used by [command line completion](#bash-completion-installation).
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
820

821
It is upgraded at `bash` startup when it is outdated and can also be upgraded manually with the [upgrade](#upgrade) command.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
822

823
`liar-software` can also be customised by the user for example to add some software.
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
824

825
In this case, upgrade of the file should be disabled as follows:
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
826

827 828
```console
$ export LIAR_SOFTWARE_FILE=custom
829
```
Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
830

Pierre-Yves Fourmond's avatar
Pierre-Yves Fourmond committed
831
## Dependencies
pyfourmond's avatar
pyfourmond committed
832

833
`liar` requires nothing more than a Bourne Shell i.e. **sh** or compatible one with the following packages installed:
pyfourmond's avatar
pyfourmond committed
834

835 836 837 838 839 840
- **coreutils**
- **debianutils**
- **diffutils**
- **findutils**
- **mawk**
- **tar**