No such file or directory при установке linux

How to Fix “bash: no such file or directory”

Unlike other operating systems such as Windows, Linux is an OS in which the majority of its tasks are performed using the Terminal. One of the major tasks that the Linux terminal performs is the execution of programs using commands. While attempting to execute any program through this method, the user may come across this very common error statement which is the “no such file or directory” issue.

This article will elaborate on the reasons that prompt the error “no such file or directory” and also provide possible solutions to fix it

How to Resolve the “no such file or directory”?

Since this is a very general error, there are a few different reasons that can invoke this issue on the system. All these reasons are discussed below in great detail.

Reason 1: Wrong File Name

The first and the most commonly occurring reason is caused by using incorrect spellings of the file name. For example, the mistake can be the incorrect spelling of a file. Below is an example of such a mistake:

Solution: Check the File name and Path

In the example shown above, the bash file “sample.sh” is saved on the desktop. So, make sure that the error is not invoked by using the correct spellings and the correct path. Look at the following image where the name and path of the file are correct, and thus, the output is displayed:

Reason 2: Wrong File Format

The other most common cause behind this issue is that the file that is attempted to execute is in a different format than the operating system. Let’s take an example of this situation. The file that is executed using the command is a DOS file which is a script written for Windows. If this DOS file is executed in an Ubuntu system, the “no such file or directory” issue will be invoked.

Solution: Use the dos2unix Tool

There exists a very useful tool for exactly these types of scenarios. The dos2unix tool helps to convert a dos file to a script that can be read by the Ubuntu OS. The first step is to install the dos2unix tool using this command:

$ sudo apt install dos2unix

Once the tool is installed, convert the DOS file into an Ubuntu-compatible file using the following command:

Читайте также:  Linux ubuntu восстановить файлы

The system should be able to run the script file without the error being prompted after the conversion is complete.

Conclusion

The “no such file or directory” issue occurs when the name or the path of the executable file is entered incorrectly into the terminal. Another reason is that Ubuntu is not able to read the DOS script and if it is executed on the Ubuntu terminal, then the error is prompted. To fix these issues it needs to be made sure that the file path and file name are entered correctly into the terminal. The other fix is to install the dos2unix tool and convert the dos files format to run on Ubuntu. This article has demonstrated the reasons and the solutions to fix the error “no such file or directory”.

TUTORIALS ON LINUX, PROGRAMMING & TECHNOLOGY

Источник

Не устанавливается ни одна система

Пробовал установить арч, дебиан, и убунту с флешки, точнее, с двух разных для надёжности — но установка не начинается ни у одной системы.

При установке дебиана выдавалась сразу исчезающая ошибка «no such file or directory», текст которой видно при многократном нажатии энтера. Я могу попасть только в меню выбора, как устанавливать, но не далее. Сами папки и файлы проверены, что есть.

В убунту — failed to boot. в общем что то похожее.

На виртуалке образы проверены. Сама же флешка виртуалькой считается флешкой, а не установочным диском.

как образ на флешку записывал?

Образ на флешку надо записывать с помощью dd, а не всяких унебутинов

Как будь-то Unetbootin не надстройка над каким-нибудь dd.

Unetbootin пишет флешки нормально. Не раз им писал, но перешёл на Etcher

Нет, там другой способ. Если dd писать, то образ на флешку пишется как есть, и если это предусмотрено, точно будет работать.

Сама же флешка виртуалькой считается флешкой, а не установочным диском.

как писались образы на флешку(и)?

куда не ставится — на BIOS или UEFI?

Попробуй GhostBSD, раз с линуксами не получается.

Унебут и ultraISO, второй пользовался раньше и установки были более удачные

Чем оно лучше, например, TrueOS?

CryNet ★★★★★ ( 18.11.18 22:54:49 MSK )
Последнее исправление: CryNet 18.11.18 23:03:07 MSK (всего исправлений: 2)

Более десктопной ориентированностью и относительной свежестью ПО.

iZEN ★★★★★ ( 18.11.18 23:20:26 MSK )
Последнее исправление: iZEN 18.11.18 23:20:39 MSK (всего исправлений: 1)

для выполнения рекомендаций требуется компьютер с linux

обычно хватает записать установочный образ на флешку командой вроде этой

dd if=install.iso of=/dev/sdZ bs=100M
  • install.iso имя файла установочного ISO
  • sdZ имя файла устройства, которое получила флешка после подключения к компьютеру
Читайте также:  Kali linux настройки пользователей

команда выполняется из каталога с ISO (или нужно прописывать полный путь к файлу и имя). Флешка должна быть отмонтирована. Определить имя её файла после подключения возможно из «выхлопа»

Проблема в первой же строке, все действия сейчас в десятой винде, и кажется из этой системы нельзя сбежать

Зашел на wiki NetBSD, а там.

  • Версия: 8.0
  • Дата выхода: 2 июля 2018
  • Примечания: Добавлена поддержка USB 3.0

А когда-то хотел попробовать BSD.

А ты попробуй другую флэшку. Некоторые контроллеры отбрасывают флэшки, когда ядро их переинициализирует. Часто помогает смена флэшки на другую.

Не раз им писал, но перешёл на Etcher

Я вот тоже попробовал Etcher сегодня. Он мне сказал чтоб катился со своим slax.

нет, просто немного по другому это делается. К сожалению точный порядок подсказать не смогу — нет под рукой 10-ки. Там нужно что-то отключать в Windows (и BIOS тоже) чтобы оно позволило грузиться другим. Fast Boot или . (тут поискать в интернете надо).

Потом на флешку ставиться загрузочный ISO через программу типа unebootin, rufus. Но я точно ими никогда не пользовался. Почему? даже не знаю (не помню) Всегда делал из linux. Хм-м не помню, как же первую флешку сделал.

А точно! Первый linux был Dr.Web livecd. У них был образ в виде программы exe, она и делала загрузочную флешку.

Ладно, возвращаемся к Windows 10. Про unebootin, rufus я уже говорил. Если линукс не планируется единственной системой на ПК, то можно в Windows создать разделы для него. Выделить место, отформатировать в FAT32 (совсем не обязательное действие), задать метку тома (раздела), чтобы потом не перепутать.

Нужно смотреть настройки BIOS и Windows, возможно так что-то включить/выключить надо. Также в каком режиме USB находятся при старте. Для ускорения загрузки в BIOS могут пропускать их инициализацию (ОС сама разберётся), вот с них и не загрузиться

Источник

apt-get: No such file or directory [duplicate]

i don’t know why i suddenly can’t do something with apt-get such as sudo apt-get update or sudo apt-get install blabla this is output for uname -a :

Linux adelleodel-X450CC 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux 
apt-get: ERROR: cannot open `apt-get' (No such file or directory) 
DISTRIB_ID=Ubuntu DISTRIB_RELEASE=14.04 DISTRIB_CODENAME=trusty DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS" 
ls: cannot access /usr/bin/apt-get: No such file or directory 
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-=============================-===================-===================-================================================================ rc apt 1.0.1ubuntu2.11 amd64 commandline package manager 
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games 

i’ve searched before about this and some people said that i have to download something and dpkg it. how to do it then? can someone give the link and step by step how to do it? Thanks a lot. ——editted—— actually, i did sudo apt-get remove libusb-0.1-4:amd64 and some package autoremove with it i think.. i did that because i thought it wasn’t belong with my program. because i have libusb-1.0-0:amd64, libusb-1.0-0-dev:amd64, and libusb-1.0-doc i’ve tried wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.11_amd64.deb the result is :

--2016-02-08 19:56:19-- http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.11_amd64.deb Resolving security.ubuntu.com (security.ubuntu.com). 91.189.91.13, 91.189.92.200, 91.189.92.201, . Connecting to security.ubuntu.com (security.ubuntu.com)|91.189.91.13|:80. connected. HTTP request sent, awaiting response. 200 OK Length: 952468 (930K) [application/x-debian-package] Saving to: ‘apt_1.0.1ubuntu2.11_amd64.deb’ 100%[======================================>] 952.468 245KB/s in 3,8s 2016-02-08 19:56:29 (245 KB/s) - ‘apt_1.0.1ubuntu2.11_amd64.deb’ saved [952468/952468] 
dpkg: error processing archive apt_apt_1.0.1ubuntu2.11_amd64.deb (--install): cannot access archive: No such file or directory Errors were encountered while processing: apt_apt_1.0.1ubuntu2.11_amd64.deb adelleodel@adelleodel-X450CC:~$ sudo dpkg -i apt_1.0.1ubuntu2.11_amd64.deb (Reading database . 230272 files and directories currently installed.) Preparing to unpack apt_1.0.1ubuntu2.11_amd64.deb . Unpacking apt (1.0.1ubuntu2.11) over (0.8.10.3+squeeze1) . dpkg: dependency problems prevent configuration of apt: apt depends on libstdc++6 (>= 4.6); however: Version of libstdc++6 on system is 4.4.5-8. apt depends on gnupg; however: Package gnupg is not installed. dpkg: error processing package apt (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.6.7.1-1ubuntu1) . Errors were encountered while processing: apt 

Источник

Читайте также:  Linux replace string with string

Почему пишет No such file or directory хотя файл есть?

Хочу установить анаконду
для этого мне нужно запустить скрипт в командной строке
перехожу в командной строке в директорию где лежит скрипт
и прописываю его
выдвает ошибку No such file or directory
Почему так проичсходит.

root@w:/home/ut/Downloads# bash ~/Downloads/Anaconda3-2018.12-Linux-x86_64 bash: /root/Downloads/Anaconda3-2018.12-Linux-x86_64: No such file or directory

Потому что такого файла нет. Есть такой, к примеру: Anaconda3-2020.11-Linux-x86_64.sh , с .sh в качестве расширения.

И устанавливать надо не от рута, а обычным пользователем.

ddhyth, См. ответ Фаната. Я тот косяк, о котором он написал, не заметил.

И зачем ставить версию 2-летней давности, если есть гораздо более новая?

AVKor, я не понимаю о чем он говорит. Я ставлю такую версию потому что у меня питон такой версии. На сайте было написано что они должны совпадать

ddhyth, Выйти из рута. От обычного пользователя зайти в каталог, в котором лежит анаконда. Запустить этот шелл-скрипт.

/home/ut/Downloads$ bash Anaconda3-2018.12-Linux-x86_64.sh

AVKor, Почему нельзя под рутом. У меня так вообще не устанавливается
выводит ошибку я так полагаю из-за того что не под рутом

ut@w:~ $ /home/ut/Downloads/Anaconda3-2018.12-Linux-x86_64.sh bash: /home/ut/Downloads/Anaconda3-2018.12-Linux-x86_64.sh: Permission denied

ddhyth, Потому что рут для администрирования системы.

/home/ut/Downloads$ bash Anaconda3-2018.12-Linux-x86_64.sh

FanatPHP

Надо всегда обязательно читать, что написано в сообщении об ошибке.
Желательно — глазами.
Оно пишет человеческим языком — где мы сидим и какой файл пытаемся открыть

/home/ut/Downloads /root/Downloads/

Не наводит ни на какие мысли?

А что у нас означает буквочка ~?

Ну и совсем уж риторический вопрос: раз уж мы перешли в папку с файлом, то зачем указывать путь к ней?

Ну и напоследок — не зря все мудрые руководства рекомендуют не сидеть под рутом

Источник

Оцените статью
Adblock
detector