2

I can see and apt-get in /usr/bin/:

gradinafrica@host:/usr/bin$ ls -l apt-get
-rwxr-xr-x 1 root root 178608 Apr 20  2012 apt-get

But when I try to run it, I get

gradinafrica@host:/usr/bin$ apt-get
-bash: /usr/bin/apt-get: No such file or directory

I think I may have messed it up. Is there a way to reinstall it without completely reinstalling Ubuntu?

I'm on Ubuntu 14.04 LTS, btw

EDIT:

PATH: /home/gradinafrica/.dnx/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

Also, sudoing and/or running directly from /usr/bin (ie cd /usr/bin && sudo ./apt-get) give the same output; they don't help.

6
  • 1
    What does file /usr/bin/apt-get say?
    – muru
    Aug 6, 2015 at 0:39
  • /usr/bin/apt-get: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24 , BuildID[sha1]=2bfee6c630165339 6534c1646e4c787f198542, stripped Aug 6, 2015 at 0:43
  • have you tried using sudo? btw, when I want to run something from the current directory, I usually do it like so: ./apt-get or sudo ./apt-get
    – mchid
    Aug 6, 2015 at 0:49
  • gradinafrica@host:/usr/bin$ sudo . /apt-get [sudo] password for gradinafrica: sudo: unable to execute ./apt-get: No such file or directory Aug 6, 2015 at 0:50
  • Please run the command echo $PATH and let us know the output by editing your question. Aug 6, 2015 at 1:43

2 Answers 2

2

That is a really old version of apt. I think the last security update for apt was on october of 2014 and should at least have a different build id.

In any case, run the following commands:

cd
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.5_amd64.deb
sudo rm /usr/bin/apt-get
sudo dpkg -i apt_1.0.1ubuntu2.5_i386.deb

please post any errors


EDIT

Okay, since it didn't want to install at first, we can at least copy the new apt-get files to where they need to go to get things started. Run the following commands:

cd 
mkdir aptget
cp apt_1.0.1ubuntu2.5_i386.deb aptget
cd aptget
ar xvf *
tar xvf data*
sudo mv ./usr/bin/apt-get /usr/bin
sudo mv ./usr/bin/apt /usr/bin

Now, run apt-get:

sudo apt-get update
sudo apt-get clean
sudo apt-get -f install
11
  • okay, i fixed that last command if it didn't run for you
    – mchid
    Aug 6, 2015 at 1:03
  • /usr/bin/apt doesn't exist. Did you mean /usr/bin/apt-get? Aug 6, 2015 at 1:24
  • dpkg: error processing package apt (--install): dependency problems - leaving unc onfigured Processing triggers for man-db (2. 6.7.1-1ubuntu1) ... Errors were encountered while proc essing: apt Aug 6, 2015 at 2:21
  • Just the error; the entire output wouldn't fit in the input box Aug 6, 2015 at 4:33
  • @BrianGradin I have included some steps to manually insert the /usr/bin files
    – mchid
    Aug 6, 2015 at 5:16
1

You're currently in /usr/bin, therefore

If you want to run an executable file in the directory you're currently browsing, you should go for

$ ./executable_name

and not

$ executable_name
3
  • Actually that's not necessary when the executable is in PATH (which might not be the case here). Aug 6, 2015 at 1:41
  • This is the right answer I believe. OP is in usr/bin
    – A.B.
    Aug 6, 2015 at 4:58
  • /usr/bin is in PATH, so just typing sudo apt-get should reference the correct executable. In any case, even if I cd /usr/bin and run sudo ./apt-get update, I get sudo: unable to execute ./apt-get: No such file or directory Aug 6, 2015 at 6:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .