-1

I am trying to run the following command in my system after navigating to the directory cd /etc/apt

 Clean update:
cd /etc/apt
#out put stella@stella-box:/etc/apt$

sudo mv sources.list sources.list.ok

 #output mv: cannot stat ‘sources.list’: No such file or directory

#Recreate sources.list and add these 4 lines to it.
deb mirror://mirrors.ubuntu.com/mirrors.txt xenial main restricted 
universe multiverse 
deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates main 
restricted universe multiverse 
deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-backports main 
restricted universe multiverse 
deb mirror://mirrors.ubuntu.com/mirrors.txt xenial-security main 
restricted universe multiverse 


sudo apt-get clean 
sudo apt-get update
sudo apt install python3-pip
sudo apt-get install cmake  

I enter the next line it returns " mv: cannot stat ‘sources.list’: No such file or directory" please guys how do I fixed this error?

  • 2
    are you sure you are in the right directory? what does your prompt say? Can you see the file when you run ls? – Zanna Mar 12 '18 at 13:34
  • I am at the right directory Zanna. /etc/apt. when I ran the second command sudo mv sources.list sources . list . ok . it returns mv: cannot stat "source list": no such file or directory. please help me out Zanna – Stella Ella Mar 12 '18 at 13:51
  • 3
    Please edit your question and add in the output of the command ls /etc/apt – Terrance Mar 12 '18 at 13:54
  • Please copy and paste exact commands and output from your terminal. The output given in your comment does not match your command (there should indeed be no source list and spaces in commands need to be escaped if they are part of the same argument (for example a single filename)) – Zanna Mar 12 '18 at 13:57
  • 3
    I think you already have moved the file in a previous attempt. – pa4080 Mar 12 '18 at 15:24
0

"No such file or directory" means exactly that.

If you really want to rename a particular file name but there's no such file name you can always create one like it:

touch /etc/apt/sources.list

or even

: > /etc/apt/sources.list

Though I don't know what that's going to achieve or what you're trying to achieve here since didn't tell us.

  • As you’ve never accepted an answer before: if this answers your question, don’t forget to click the grey ☑ under the number at the left of this text to accept it, which means “yes, this answer is valid”! – David Foerster Mar 13 '18 at 14:16

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