Difference between revisions of "Install Apertium core using packaging"
(9 intermediate revisions by 5 users not shown) | |||
Line 34: | Line 34: | ||
=== Debian-based === |
=== Debian-based === |
||
If you have a |
If you have a Debian or Debian-based system (e.g. Ubuntu, Mint...). |
||
First, remove any Apertium packages you have installed from operating system repositories. They will be out-of-date, sometimes by years. |
First, remove any Apertium packages you have installed from operating system repositories. They will be out-of-date, sometimes by years. |
||
Line 42: | Line 42: | ||
<pre> |
<pre> |
||
# Pick one: |
# Pick one: |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
</pre> |
</pre> |
||
Line 56: | Line 58: | ||
sudo apt-get -f install apertium-all-dev |
sudo apt-get -f install apertium-all-dev |
||
</pre> |
</pre> |
||
Note: If you get any errors such as uninstallable unmet dependencies, try updating your ubuntu to the latest normal version. |
|||
====About the Debian repository install==== |
====About the Debian repository install==== |
||
Line 61: | Line 65: | ||
<pre> |
<pre> |
||
apt-cache policy | grep apertium |
|||
</pre> |
</pre> |
||
Line 72: | Line 76: | ||
Which will, if nothing else, tell you a lot about byways of the Apertium project. |
Which will, if nothing else, tell you a lot about byways of the Apertium project. |
||
==== Cleaning up a mixed install ==== |
|||
If you have installed some of the core tools from source and want to switch to packages, you can remove the source install with something like this. Be extremely careful with getting this right so it doesn't wipe your whole machine. (If Apertium isn't working no matter what you try, then this is a helpful step to take after uninstalling and reinstalling it) |
|||
<pre> |
|||
# Wipe most files |
|||
rm -rfv /usr/local/*/*apertium* /usr/local/*/*/*apertium* |
|||
rm -rfv /usr/local/bin/lt-* /usr/local/bin/lrx-* /usr/local/bin/lsx-* |
|||
rm -rfv /usr/local/*/*lttoolbox* /usr/local/*/*/*lttoolbox* |
|||
rm -rfv /usr/local/*/*hfst* /usr/local/*/*/*hfst* |
|||
rm -rfv /usr/local/bin/cg-* |
|||
rm -rfv /usr/local/*/*cg3* /usr/local/*/*/*cg3* |
|||
# Wipe any certain conflicting file |
|||
grep -h '^Package:' /var/lib/apt/lists/apertium.projectjj.com* \ |
|||
| awk '{print $2}' | xargs -rn1 dpkg-query -L 2>/dev/null | grep '^/usr' \ |
|||
| xargs -rn1 '-I{}' bash -c "if [[ -f '{}' ]]; then echo '{}'; fi;" \ |
|||
| sed 's/\/usr\//\/usr\/local\//;' | xargs rm -fv |
|||
</pre> |
|||
=== Red Hat-based === |
=== Red Hat-based === |
||
Line 82: | Line 104: | ||
<pre> |
<pre> |
||
# Pick one |
# Pick one |
||
⚫ | |||
# Nightly, unstable, new, almost always use this: |
|||
⚫ | |||
⚫ | |||
# Or nightly, unstable: |
|||
⚫ | |||
⚫ | |||
⚫ | |||
</pre> |
</pre> |
||
Line 99: | Line 123: | ||
</pre> |
</pre> |
||
=== Arch Linux === |
|||
<pre> |
|||
curl -sS https://apertium.projectjj.com/archlinux-apertium-all-dev.sh | sudo bash |
|||
</pre> |
|||
== And now... == |
== And now... == |
||
Maybe you want to test this is working. So download a test language, [[Install language data using packaging]]. Then [[Install quick tests]] can make you sure. |
Maybe you want to test this is working. So download a test language, [[Install language data using packaging]]. Then [[Install quick tests]] can make you sure. |
||
If you know you need the HFST or CG3 modules, packages are available, or see [[Installation of grammar libraries]]. You may also be interested in the many tips at [[Bash completion]]. |
|||
If you are developing, now you can [[Install language data by compiling]] or [[How to bootstrap a new pair]]. If you are not, [[Install language data using packaging]] and go speak many languages :) |
If you are developing, now you can [[Install language data by compiling]] or [[How to bootstrap a new pair]]. If you are not, [[Install language data using packaging]] and go speak many languages :) |
Latest revision as of 18:26, 27 April 2021
You are using a Debian/Red Hat-based operating system. You want a fast clean install.
You could use a public repository[1] but you will be more up-to-date with the Apertium package repository.
The Apertium package repository[edit]
Tino Didriksen provides a repository of Debian/RPM packages. Downloading packages from there, you can install all prerequisites and Apertium tools. You also get, for optional install; release-level language pairs, service providers, constraint grammar code, and more. All under package management.
Before we start, a comment from the mail list, from an admin-level contributor,
If you're going to be developing, I'd say pick nightly. The -release versions of lttoolbox and apertium might not be up-to-date with what apertium-init expects.
Debian-based[edit]
If you have a Debian or Debian-based system (e.g. Ubuntu, Mint...).
First, remove any Apertium packages you have installed from operating system repositories. They will be out-of-date, sometimes by years.
Add the repository,
# Pick one: # Nightly, unstable, new, almost always use this: curl -sS https://apertium.projectjj.com/apt/install-nightly.sh | sudo bash # Release, stable, old: curl -sS https://apertium.projectjj.com/apt/install-release.sh | sudo bash
You should see messages.
Install dev tools,
sudo apt-get -f install apertium-all-dev
Note: If you get any errors such as uninstallable unmet dependencies, try updating your ubuntu to the latest normal version.
About the Debian repository install[edit]
Check the script installed Apertium repository details,
apt-cache policy | grep apertium
Unfortunately, due to the seamless upgrading of Debian packaging, it is difficult to see which packages the new repository has added, and where. Even Synaptic, the wonder GUI, has no way through. You could try this brute force commandline,
find /var/lib/apt/lists/ |grep projectjj.*Packages | xargs grep -h Package
Which will, if nothing else, tell you a lot about byways of the Apertium project.
Cleaning up a mixed install[edit]
If you have installed some of the core tools from source and want to switch to packages, you can remove the source install with something like this. Be extremely careful with getting this right so it doesn't wipe your whole machine. (If Apertium isn't working no matter what you try, then this is a helpful step to take after uninstalling and reinstalling it)
# Wipe most files rm -rfv /usr/local/*/*apertium* /usr/local/*/*/*apertium* rm -rfv /usr/local/bin/lt-* /usr/local/bin/lrx-* /usr/local/bin/lsx-* rm -rfv /usr/local/*/*lttoolbox* /usr/local/*/*/*lttoolbox* rm -rfv /usr/local/*/*hfst* /usr/local/*/*/*hfst* rm -rfv /usr/local/bin/cg-* rm -rfv /usr/local/*/*cg3* /usr/local/*/*/*cg3* # Wipe any certain conflicting file grep -h '^Package:' /var/lib/apt/lists/apertium.projectjj.com* \ | awk '{print $2}' | xargs -rn1 dpkg-query -L 2>/dev/null | grep '^/usr' \ | xargs -rn1 '-I{}' bash -c "if [[ -f '{}' ]]; then echo '{}'; fi;" \ | sed 's/\/usr\//\/usr\/local\//;' | xargs rm -fv
Red Hat-based[edit]
If you have a RHEL/CentOS/Fedora/OpenSUSE or similar system.
First, remove any Apertium packages you have installed from operating system repositories. They will be out-of-date, sometimes by years.
Add the repository,
# Pick one # Nightly, unstable, new, almost always use this: curl -sS https://apertium.projectjj.com/rpm/install-nightly.sh | sudo bash # Release, stable, old: curl -sS https://apertium.projectjj.com/rpm/install-release.sh | sudo bash
Install dev tools,
# RHEL/CentOS: sudo yum install apertium-all-devel # Fedora: sudo dnf install apertium-all-devel # OpenSUSE: sudo zypper install apertium-all-devel
Arch Linux[edit]
curl -sS https://apertium.projectjj.com/archlinux-apertium-all-dev.sh | sudo bash
And now...[edit]
Maybe you want to test this is working. So download a test language, Install language data using packaging. Then Install quick tests can make you sure.
If you know you need the HFST or CG3 modules, packages are available, or see Installation of grammar libraries. You may also be interested in the many tips at Bash completion.
If you are developing, now you can Install language data by compiling or How to bootstrap a new pair. If you are not, Install language data using packaging and go speak many languages :)
Notes[edit]
- ↑
Using public repositories, such as Debian Stable[edit]
Not recommended, except for assessment. See the main section on the Apertium package repository.
Apertium is a mature project, so you will find packages for Apertium in well-known public repositories. Moreover, the Apertium core is well-developed, so often backwards-compatible. If you use one of these package downloads, they will work, and can give you a good idea of what Apertium is and can do.
In Debian repositories, Apertium core is listed simply as,
apertium
And can be installed by
sudo apt get
or similar method. Also, several language translation pairs will be available. For various reasons, the author has successfully developed language pairs using public repository versions of Apertium core.There are good reasons not to use these downloads. First, although Apertium is often backwards-compatible, this is not a key aim of the project. The code may break between versions. Next, although Apertium is an older project, it is actively developed. Honest! Although Apertium core does not change often, it has been changed, and may be changed again. And Apertium has found a place, for example, supporting languages under threat. This is work without end. Check the main repository and you will find a steady stream of contributions. And then we can talk about the many projects surrounding Apertium. Despite organisation, key contributors can not always remember what is available, and where it is! And, finally, contributors to Apertium put a lot of effort into maintaining a package system that is up-to-date and ready to go.
Sometimes there is a good reason not to use the Apertium-provided packages. A workplace may place a restriction on install or rollout. Go ahead, use versions from a public repository. But the Apertium-provided packages are reliable, a key resource, and most people should use them.