updating discord .deb one-liner

by

in

Discord will often require you to install an update. When this happens it quits itself and auto downloads the latest .deb, but you end up with lots of sequentially numbered versions of the .deb so it’s fiddly to find and install the latest one.

I came up with this approach to apt install the most recent one:

sudo apt install \
   $(find /home/jason/Downloads/ \
       -name 'discord*.deb' -type f -printf '%T+ %p\n' | \
      sort -r | head -1 | cut -d' ' -f2)

or you can build it into a bash function:

update-discord()
{
sudo apt install \
  $(find /home/jason/Downloads/ -name 'discord*.deb' -type f -printf '%T+ %p\n' | \
  sort -r | head -1 | cut -d' ' -f2)
}

One could also consider deleting the .deb after successful install. That is an excercise left for the reader

Free Palestine!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *