On Ubuntu 14.04 LTS, tidy is very old:

$ tidy --version
HTML Tidy for Linux released on 25 March 2009
$

What's the easiest way to get tidy-html5 installed?

Have a somehow overlooked the package for it?

share|improve this question

You can install the latest html-tidy from source using the instruction given on it's github page.

But the easiest way to install latest version of html-tidy5 would be downloading the latest binary from this page http://binaries.html-tidy.org/

If you're using 64bit Ubuntu, You'd do basically these commands

wget http://binaries.html-tidy.org/binaries/tidy-5.2.0/tidy-5.2.0-64bit.deb
sudo dpkg -i tidy-5.2.0-64bit.deb

It should be installed fine.

share|improve this answer
up vote 1 down vote accepted

From source

Follow the instructions at the GitHub page. For the prerequisites, I needed to:

sudo apt-get install -y cmake xsltproc

Package install

Here's what I did to move from the current apt-get install tidy to the latest version.

  1. Find the URL of the latest version to download at: http://binaries.html-tidy.org.

    Try the linux 64-bit DEB first if you're not sure which to pick.

  2. Download it:

    wget <LATEST URL>
    
  3. Remove unneeded tidy-lib package. tidy-lib is included in the .deb you just downloaded.

    sudo apt-get -y autoremove tidy
    
  4. Install the .deb you just downloaded:

    sudo dpkg -i tidy-5.2.0-64bit.deb
    
  5. Clean up:

    rm tidy-*.deb
    

Thanks to @Anwar for pointing me in this direction.

Troubleshooting

I needed to do hash -d tidy to get bash to run the new version from /usr/local after I installed from source. You also may need to do this if you chose to keep the previous package of tidy.

share|improve this answer
    
If you install a latest version, older one will be automatically replaced. you don't need to remove it – Anwar Sep 10 '16 at 13:52
    
If I don't remove first I get dpkg: error processing archive tidy-5.2.0-64bit.deb (--install): trying to overwrite '/usr/lib/libtidy.so', which is also in package libtidy-0.99-0 20091223cvs-1.2ubuntu1.1 – Tom Hale Sep 18 '16 at 7:13
    
You accepted my answer, then wrote your own answer saying it didn't work in Linux mint, unaccepted after some days, then again accepted. Again unaccepted. Why? – Anwar Sep 18 '16 at 7:18
    
Sorry - I don't know why it was unaccepted twice. I didn't intentionally unaccept it in the last 2 days if that's what you're asking. Perhaps it was part of the edit process I did just now. I'm accepting this answer over yours because deals with overwrite '/usr/lib/libtidy.so' and shows where to get the latest version. – Tom Hale Sep 18 '16 at 7:28
  1. On the latest Ubuntus (zesty, 17.04, and artful, 17.10), it is updated to the newest version.

  2. There is a backports ppa for trusty (14.04) and xenial (16.04): ppa:jonathonf/backports

  3. You could also use the nodejs package html-validator-cli as a workaround

    sudo -H npm install -g html-validator-cli
    html-validator --filename=path/to/file
    

    but it needs an internet connection.

share|improve this answer
    
That's 17.04 and 17.10 respectively, which are not LTS versions - for those like me not in the know. – Craig Hicks Aug 14 '17 at 1:24
    
@CraigHicks: thanks for the reminder to add the version numbers – serv-inc Aug 15 '17 at 7:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.