A new user here, running ubuntu on version 21.10 impish.
I was installing youtube-dl with the instructions on the github page (https://github.com/ytdl-org/youtube-dl#installation):
$ sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
$ sudo chmod a+rx /usr/local/bin/youtube-dl
After the commands had downloaded the python script, multiple applications stopped functioning completely, as if they had been replaced by youtube-dl [UPDATE 3: the applications themselves weren't replaced, merely their links and shortcuts]. Some of the software affected were Ubuntu's default applications, like the default text editor (gedit) and the gnome-calculator, while others were manually installed like qbittorrent and steam.
Some things like firefox, nano, and lutris are still working.
Trying to run the text editor for example from terminal results in following output:
$ gedit
Usage: gedit [OPTIONS] URL [URL...]
gedit: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
The error is same with all the affected applications:
$ gnome-calculator
Usage: gnome-calculator [OPTIONS] URL [URL...]
gnome-calculator: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.
Only thing I've tried so far is reinstalling gedit via apt but nothing changed.
I'd like to know what went wrong, and if it's fixable or if I need to do a reinstall.
UPDATE 1: Outputs of requested commands:
$ history
867 sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
868 sudo chmod a+rx /usr/local/bin/youtube-dl
869 youtube-dl sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
870 sudo chmod a+rx /usr/local/bin/youtube-dl
No clue why it seems be listed twice.
$ which gedit
/usr/local/bin/gedit
$ which gnome-calculator
/usr/local/bin/gnome-calculator
$ ls -al $(which gedit)
lrwxrwxrwx 1 root root 17 loka 28 19:55 /usr/local/bin/gedit -> /usr/bin/firejail
$ ls -al $(which gnome-calculator)
lrwxrwxrwx 1 root root 17 loka 28 19:55 /usr/local/bin/gnome-calculator -> /usr/bin/firejail
$ file $(which gedit)
/usr/local/bin/gedit: symbolic link to /usr/bin/firejail
$ file $(which gnome-calculator)
/usr/local/bin/gnome-calculator: symbolic link to /usr/bin/firejail
"loka" seems to be short for October, I've got the system in English but the date seems to still use Finnish.
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
UPDATE 2: further requested command outputs from :
The fsck ran via a thumb drive
$ sudo fsck -p /dev/nvme0n1p1
fsck from util-linux 2.36.1
fsck.fat 4.2 (2021-01-31)
/dev/nvme0n1p1: 11 files, 1336/130812 clusters
$ sudo fsck -p /dev/nvme0n1p2
fsck from util-linux 2.36.1
/dev/nvme0n1p2: clean, 478908/31227904 files, 49277410/124895488 blocks
Back on the system:
$ whereis gedit
gedit: /usr/bin/gedit /usr/lib/x86_64-linux-gnu/gedit /usr/local/bin/gedit /usr/share/gedit /usr/share/man/man1/gedit.1.gz
$ sha256sum /usr/bin/gedit /usr/local/bin/youtube-dl
27545f7fb059c356feeb88a872719c074d0fd5169564ec3fbb3cbb312b093184 /usr/bin/gedit
7880e01abe282c7fd596f429c35189851180d6177302bb215be1cdec78d6d06d /usr/local/bin/youtube-dl
Tried to use sudo ldconfig
as well, as suggested by the answer, but got no output nor did anything seemingly change.
UPDATE 3: Just now found out that all the affected software still work with the full path (e.g./usr/bin/gedit
), the issue seems to have to do with links and shortcuts to these applications. Things like the right-click option "Open with Text Editor" is also still broken.
history
and confirm that what was typed was what was expected?which gedit
,which gnome-calculator
,ls -al $(which gedit)
,ls -al $(which gnome-calculator)
,file $(which gedit)
,file $(which gnome-calculator)
,echo $PATH
.