The apt-get command and the sudo command does not work for me. which apt-get returns nothing. I checked by bin folder to make sure, and there is no aptget. I however have wget. Can I install apt-get with wget? If not, how can I install it?
- 283
- 1
- 2
- 7
2 Answers
of course you can do that, although it is strange that you missed that package/command ... Anyway, a manual way to do it is to download the package and to install it with dpkg, as follows:
grab the package from the web
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.0.1ubuntu2.17_amd64.deb -O apt.deb
Edit: Check for the latest source at http://security.ubuntu.com/ubuntu/pool/main/a/apt/?C=M;O=D
install it with dpkg
sudo dpkg -i apt.deb
2 (other). Alternative use of dkpg without sudo - I didn't know about these, included after comments-
pkexec dpkg -i apt.deb
if everything goes right, that should be enough.
Probably you may find that some dependencies are not satisfied, to deal with that you may need to create a folder (something like "apt-installer") and drop all the dependencies of the apt package there. The list of dependencies required will be shown by the dpkg output and the download process is similar to the one explained above. Last, if you don't feel confident of what you are doing, my suggestion is that you may want to do a fresh install of your system.
Cheers.
-
5Good one, but remember he said sudo didn't work either. – Nonny Moose Dec 13 '16 at 22:37
-
2If only `sudo` does not work (which should get fixed as soon as possible!), you can try to replace it with `pkexec` for the moment, i.e. `pkexec dpkg -i apt.deb` – Byte Commander Dec 13 '16 at 22:42
-
Oh dear! it is true! haha... without the sudo package everything is supposed to have the admin level, right? if that's so the only easy way that comes to my mind is to uncompress the .deb file and locate the new files and folders manually in their destination, with their proper permissions... but I'm only guessing here, at this point my "real life" solution is a fresh install. :) Thanks Byte! I didn't know about pkexec. Editing. – Rho Dec 13 '16 at 22:42
-
3If the above `wget` command gets a `404` error, try `wget http://ftp.us.debian.org/debian/pool/main/a/apt/apt_1.8.2_amd64.deb -O apt.deb` – Emre Tapcı Apr 21 '20 at 13:04
-
1@EmreTapcı This one's also a 404 – AverageHelper Sep 25 '20 at 23:19
-
Where should this be installed into? – Gulzar Jan 24 '22 at 12:53
Now...
wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_2.1.10ubuntu0.2_amd64.deb -O apt.deb
In the future this will likely 404 error as well, so remove the file name apt_2.1.10ubuntu0.2_amd64.deb -O apt.deb
and enter just the http://security.ubuntu.com/ubuntu/pool/main/a/apt/ part into a browser. Look for the most current version of the file, and change the path to it.
-
I see what you’re trying to say, but can you clean the answer up with a chronological, step-by-step process for people who have a similar problem in the future? – Jan 22 '21 at 05:12
-