bash: sudo: apt-get: command not found












1















I'm new using Ubuntu and I'm trying to experiment with pgrouting
Everything went fine until I tried to install posgresql 9.5 on ubuntu 18.04 ... I used the following command:



sudo apt-get install libedit2 libpq5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-common locales ssl-cert tzdata sysstat 


But it wasn't installed correctly, so I thought to remove and reinstall and used this:



sudo apt-get remove libedit2 libpq5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-common locales ssl-cert tzdata sysstat


But something horrible happened: more things were removed than I wanted and I could no longer use my computer, I did not accept commands like



bash
sudo
apt
sudo apt-get


Even the networks were formatted and now I can't be online. Does anyone know how to install everything again without using those commands?










share|improve this question









New contributor




Martha Carmen Vergara Trix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 3





    Yes, but you must be skilled with chrooting, which is not easy for a beginner. It's generally easier (and much faster) for a new user to simply reinstall the entire system. Suggestion: Install 16.04 (instead of 18.04), and simply sudo apt-get install postgresql. 9.5 is in the 16.04 repositories. Munging an older version onto a newer system is not recommended for new users - bit of a learning curve.

    – user535733
    Jan 26 at 4:40













  • Using synaptic or aptitude should alert you to additional packages that will be installed or removed, and allow a final confirmation before making changes

    – Xen2050
    yesterday
















1















I'm new using Ubuntu and I'm trying to experiment with pgrouting
Everything went fine until I tried to install posgresql 9.5 on ubuntu 18.04 ... I used the following command:



sudo apt-get install libedit2 libpq5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-common locales ssl-cert tzdata sysstat 


But it wasn't installed correctly, so I thought to remove and reinstall and used this:



sudo apt-get remove libedit2 libpq5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-common locales ssl-cert tzdata sysstat


But something horrible happened: more things were removed than I wanted and I could no longer use my computer, I did not accept commands like



bash
sudo
apt
sudo apt-get


Even the networks were formatted and now I can't be online. Does anyone know how to install everything again without using those commands?










share|improve this question









New contributor




Martha Carmen Vergara Trix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 3





    Yes, but you must be skilled with chrooting, which is not easy for a beginner. It's generally easier (and much faster) for a new user to simply reinstall the entire system. Suggestion: Install 16.04 (instead of 18.04), and simply sudo apt-get install postgresql. 9.5 is in the 16.04 repositories. Munging an older version onto a newer system is not recommended for new users - bit of a learning curve.

    – user535733
    Jan 26 at 4:40













  • Using synaptic or aptitude should alert you to additional packages that will be installed or removed, and allow a final confirmation before making changes

    – Xen2050
    yesterday














1












1








1








I'm new using Ubuntu and I'm trying to experiment with pgrouting
Everything went fine until I tried to install posgresql 9.5 on ubuntu 18.04 ... I used the following command:



sudo apt-get install libedit2 libpq5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-common locales ssl-cert tzdata sysstat 


But it wasn't installed correctly, so I thought to remove and reinstall and used this:



sudo apt-get remove libedit2 libpq5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-common locales ssl-cert tzdata sysstat


But something horrible happened: more things were removed than I wanted and I could no longer use my computer, I did not accept commands like



bash
sudo
apt
sudo apt-get


Even the networks were formatted and now I can't be online. Does anyone know how to install everything again without using those commands?










share|improve this question









New contributor




Martha Carmen Vergara Trix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I'm new using Ubuntu and I'm trying to experiment with pgrouting
Everything went fine until I tried to install posgresql 9.5 on ubuntu 18.04 ... I used the following command:



sudo apt-get install libedit2 libpq5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-common locales ssl-cert tzdata sysstat 


But it wasn't installed correctly, so I thought to remove and reinstall and used this:



sudo apt-get remove libedit2 libpq5 postgresql-client-common zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 postgresql-common locales ssl-cert tzdata sysstat


But something horrible happened: more things were removed than I wanted and I could no longer use my computer, I did not accept commands like



bash
sudo
apt
sudo apt-get


Even the networks were formatted and now I can't be online. Does anyone know how to install everything again without using those commands?







apt bash package-management sudo postgresql






share|improve this question









New contributor




Martha Carmen Vergara Trix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Martha Carmen Vergara Trix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 2 days ago









Thomas

3,77181527




3,77181527






New contributor




Martha Carmen Vergara Trix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Jan 26 at 3:23









Martha Carmen Vergara TrixMartha Carmen Vergara Trix

61




61




New contributor




Martha Carmen Vergara Trix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Martha Carmen Vergara Trix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Martha Carmen Vergara Trix is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 3





    Yes, but you must be skilled with chrooting, which is not easy for a beginner. It's generally easier (and much faster) for a new user to simply reinstall the entire system. Suggestion: Install 16.04 (instead of 18.04), and simply sudo apt-get install postgresql. 9.5 is in the 16.04 repositories. Munging an older version onto a newer system is not recommended for new users - bit of a learning curve.

    – user535733
    Jan 26 at 4:40













  • Using synaptic or aptitude should alert you to additional packages that will be installed or removed, and allow a final confirmation before making changes

    – Xen2050
    yesterday














  • 3





    Yes, but you must be skilled with chrooting, which is not easy for a beginner. It's generally easier (and much faster) for a new user to simply reinstall the entire system. Suggestion: Install 16.04 (instead of 18.04), and simply sudo apt-get install postgresql. 9.5 is in the 16.04 repositories. Munging an older version onto a newer system is not recommended for new users - bit of a learning curve.

    – user535733
    Jan 26 at 4:40













  • Using synaptic or aptitude should alert you to additional packages that will be installed or removed, and allow a final confirmation before making changes

    – Xen2050
    yesterday








3




3





Yes, but you must be skilled with chrooting, which is not easy for a beginner. It's generally easier (and much faster) for a new user to simply reinstall the entire system. Suggestion: Install 16.04 (instead of 18.04), and simply sudo apt-get install postgresql. 9.5 is in the 16.04 repositories. Munging an older version onto a newer system is not recommended for new users - bit of a learning curve.

– user535733
Jan 26 at 4:40







Yes, but you must be skilled with chrooting, which is not easy for a beginner. It's generally easier (and much faster) for a new user to simply reinstall the entire system. Suggestion: Install 16.04 (instead of 18.04), and simply sudo apt-get install postgresql. 9.5 is in the 16.04 repositories. Munging an older version onto a newer system is not recommended for new users - bit of a learning curve.

– user535733
Jan 26 at 4:40















Using synaptic or aptitude should alert you to additional packages that will be installed or removed, and allow a final confirmation before making changes

– Xen2050
yesterday





Using synaptic or aptitude should alert you to additional packages that will be installed or removed, and allow a final confirmation before making changes

– Xen2050
yesterday










1 Answer
1






active

oldest

votes


















3














Boot into recovery mode.



Immediately after the BIOS/UEFI splash screen during boot, with BIOS, quickly press and hold the Shift key, which will bring up a GNU GRUB menu screen. With UEFI press (perhaps several times) the Esc key to get to the GNU GRUB menu screen. Sometimes the manufacturer's splash screen is a part of the Windows bootloader, so when you power up the machine it goes straight to the GNU GRUB menu screen, and then pressing Shift is unnecessary.



You will see a GNU GRUB menu screen that looks like this:



enter image description here



The timing when to press the left Shift key can be tricky, so sometimes if you miss it you need to try it again.



Press the down arrow key until you select the 2nd entry from the top (the one with the recovery mode in the description) and then press Enter twice.



Now you should see this menu:



enter image description here



Press the down arrow key until you select network and press Enter. This is the step I'm worried about. Will the network option give you networking? I don't know, but it's worth a try.



Press the down arrow key one more time and select root and press Enter. Now that you are root you can run commands.



wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.6ubuntu0.1_amd64.deb    
dpkg -i apt_1.6.6ubuntu0.1_amd64.deb
reboot


After the computer reboots apt will work, so open the terminal and type:



pkexec apt install sudo  
sudo apt install coreutils
sudo apt install libedit2 zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 locales ssl-cert tzdata sysstat


You can also test the first command by simulating it without installing anything:



pkexec apt install --simulate sudo   





share|improve this answer


























  • Is the reboot needed to install apt, or is it for getting out of the recovery mode's root shell? Or would immediately installing sudo, coreutils, etc... after apt, while still in the recovery root shell be advised?

    – Xen2050
    yesterday











  • The reboot is optional not necessary, but it does have the useful feature that if there are any error messages when running pkexec apt install sudo and sudo apt install coreutils then it will be easier to copy/paste these error messages from the terminal to a .txt file to Ubuntu Pastebin. In case something doesn't work, this will give me another chance to fix it.

    – karel
    yesterday













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Martha Carmen Vergara Trix is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112980%2fbash-sudo-apt-get-command-not-found%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









3














Boot into recovery mode.



Immediately after the BIOS/UEFI splash screen during boot, with BIOS, quickly press and hold the Shift key, which will bring up a GNU GRUB menu screen. With UEFI press (perhaps several times) the Esc key to get to the GNU GRUB menu screen. Sometimes the manufacturer's splash screen is a part of the Windows bootloader, so when you power up the machine it goes straight to the GNU GRUB menu screen, and then pressing Shift is unnecessary.



You will see a GNU GRUB menu screen that looks like this:



enter image description here



The timing when to press the left Shift key can be tricky, so sometimes if you miss it you need to try it again.



Press the down arrow key until you select the 2nd entry from the top (the one with the recovery mode in the description) and then press Enter twice.



Now you should see this menu:



enter image description here



Press the down arrow key until you select network and press Enter. This is the step I'm worried about. Will the network option give you networking? I don't know, but it's worth a try.



Press the down arrow key one more time and select root and press Enter. Now that you are root you can run commands.



wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.6ubuntu0.1_amd64.deb    
dpkg -i apt_1.6.6ubuntu0.1_amd64.deb
reboot


After the computer reboots apt will work, so open the terminal and type:



pkexec apt install sudo  
sudo apt install coreutils
sudo apt install libedit2 zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 locales ssl-cert tzdata sysstat


You can also test the first command by simulating it without installing anything:



pkexec apt install --simulate sudo   





share|improve this answer


























  • Is the reboot needed to install apt, or is it for getting out of the recovery mode's root shell? Or would immediately installing sudo, coreutils, etc... after apt, while still in the recovery root shell be advised?

    – Xen2050
    yesterday











  • The reboot is optional not necessary, but it does have the useful feature that if there are any error messages when running pkexec apt install sudo and sudo apt install coreutils then it will be easier to copy/paste these error messages from the terminal to a .txt file to Ubuntu Pastebin. In case something doesn't work, this will give me another chance to fix it.

    – karel
    yesterday


















3














Boot into recovery mode.



Immediately after the BIOS/UEFI splash screen during boot, with BIOS, quickly press and hold the Shift key, which will bring up a GNU GRUB menu screen. With UEFI press (perhaps several times) the Esc key to get to the GNU GRUB menu screen. Sometimes the manufacturer's splash screen is a part of the Windows bootloader, so when you power up the machine it goes straight to the GNU GRUB menu screen, and then pressing Shift is unnecessary.



You will see a GNU GRUB menu screen that looks like this:



enter image description here



The timing when to press the left Shift key can be tricky, so sometimes if you miss it you need to try it again.



Press the down arrow key until you select the 2nd entry from the top (the one with the recovery mode in the description) and then press Enter twice.



Now you should see this menu:



enter image description here



Press the down arrow key until you select network and press Enter. This is the step I'm worried about. Will the network option give you networking? I don't know, but it's worth a try.



Press the down arrow key one more time and select root and press Enter. Now that you are root you can run commands.



wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.6ubuntu0.1_amd64.deb    
dpkg -i apt_1.6.6ubuntu0.1_amd64.deb
reboot


After the computer reboots apt will work, so open the terminal and type:



pkexec apt install sudo  
sudo apt install coreutils
sudo apt install libedit2 zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 locales ssl-cert tzdata sysstat


You can also test the first command by simulating it without installing anything:



pkexec apt install --simulate sudo   





share|improve this answer


























  • Is the reboot needed to install apt, or is it for getting out of the recovery mode's root shell? Or would immediately installing sudo, coreutils, etc... after apt, while still in the recovery root shell be advised?

    – Xen2050
    yesterday











  • The reboot is optional not necessary, but it does have the useful feature that if there are any error messages when running pkexec apt install sudo and sudo apt install coreutils then it will be easier to copy/paste these error messages from the terminal to a .txt file to Ubuntu Pastebin. In case something doesn't work, this will give me another chance to fix it.

    – karel
    yesterday
















3












3








3







Boot into recovery mode.



Immediately after the BIOS/UEFI splash screen during boot, with BIOS, quickly press and hold the Shift key, which will bring up a GNU GRUB menu screen. With UEFI press (perhaps several times) the Esc key to get to the GNU GRUB menu screen. Sometimes the manufacturer's splash screen is a part of the Windows bootloader, so when you power up the machine it goes straight to the GNU GRUB menu screen, and then pressing Shift is unnecessary.



You will see a GNU GRUB menu screen that looks like this:



enter image description here



The timing when to press the left Shift key can be tricky, so sometimes if you miss it you need to try it again.



Press the down arrow key until you select the 2nd entry from the top (the one with the recovery mode in the description) and then press Enter twice.



Now you should see this menu:



enter image description here



Press the down arrow key until you select network and press Enter. This is the step I'm worried about. Will the network option give you networking? I don't know, but it's worth a try.



Press the down arrow key one more time and select root and press Enter. Now that you are root you can run commands.



wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.6ubuntu0.1_amd64.deb    
dpkg -i apt_1.6.6ubuntu0.1_amd64.deb
reboot


After the computer reboots apt will work, so open the terminal and type:



pkexec apt install sudo  
sudo apt install coreutils
sudo apt install libedit2 zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 locales ssl-cert tzdata sysstat


You can also test the first command by simulating it without installing anything:



pkexec apt install --simulate sudo   





share|improve this answer















Boot into recovery mode.



Immediately after the BIOS/UEFI splash screen during boot, with BIOS, quickly press and hold the Shift key, which will bring up a GNU GRUB menu screen. With UEFI press (perhaps several times) the Esc key to get to the GNU GRUB menu screen. Sometimes the manufacturer's splash screen is a part of the Windows bootloader, so when you power up the machine it goes straight to the GNU GRUB menu screen, and then pressing Shift is unnecessary.



You will see a GNU GRUB menu screen that looks like this:



enter image description here



The timing when to press the left Shift key can be tricky, so sometimes if you miss it you need to try it again.



Press the down arrow key until you select the 2nd entry from the top (the one with the recovery mode in the description) and then press Enter twice.



Now you should see this menu:



enter image description here



Press the down arrow key until you select network and press Enter. This is the step I'm worried about. Will the network option give you networking? I don't know, but it's worth a try.



Press the down arrow key one more time and select root and press Enter. Now that you are root you can run commands.



wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/apt_1.6.6ubuntu0.1_amd64.deb    
dpkg -i apt_1.6.6ubuntu0.1_amd64.deb
reboot


After the computer reboots apt will work, so open the terminal and type:



pkexec apt install sudo  
sudo apt install coreutils
sudo apt install libedit2 zlib1g libgssapi-krb5-2 libldap-2.4-2 libpam0g libxml2 locales ssl-cert tzdata sysstat


You can also test the first command by simulating it without installing anything:



pkexec apt install --simulate sudo   






share|improve this answer














share|improve this answer



share|improve this answer








edited 2 days ago

























answered 2 days ago









karelkarel

58.6k13128147




58.6k13128147













  • Is the reboot needed to install apt, or is it for getting out of the recovery mode's root shell? Or would immediately installing sudo, coreutils, etc... after apt, while still in the recovery root shell be advised?

    – Xen2050
    yesterday











  • The reboot is optional not necessary, but it does have the useful feature that if there are any error messages when running pkexec apt install sudo and sudo apt install coreutils then it will be easier to copy/paste these error messages from the terminal to a .txt file to Ubuntu Pastebin. In case something doesn't work, this will give me another chance to fix it.

    – karel
    yesterday





















  • Is the reboot needed to install apt, or is it for getting out of the recovery mode's root shell? Or would immediately installing sudo, coreutils, etc... after apt, while still in the recovery root shell be advised?

    – Xen2050
    yesterday











  • The reboot is optional not necessary, but it does have the useful feature that if there are any error messages when running pkexec apt install sudo and sudo apt install coreutils then it will be easier to copy/paste these error messages from the terminal to a .txt file to Ubuntu Pastebin. In case something doesn't work, this will give me another chance to fix it.

    – karel
    yesterday



















Is the reboot needed to install apt, or is it for getting out of the recovery mode's root shell? Or would immediately installing sudo, coreutils, etc... after apt, while still in the recovery root shell be advised?

– Xen2050
yesterday





Is the reboot needed to install apt, or is it for getting out of the recovery mode's root shell? Or would immediately installing sudo, coreutils, etc... after apt, while still in the recovery root shell be advised?

– Xen2050
yesterday













The reboot is optional not necessary, but it does have the useful feature that if there are any error messages when running pkexec apt install sudo and sudo apt install coreutils then it will be easier to copy/paste these error messages from the terminal to a .txt file to Ubuntu Pastebin. In case something doesn't work, this will give me another chance to fix it.

– karel
yesterday







The reboot is optional not necessary, but it does have the useful feature that if there are any error messages when running pkexec apt install sudo and sudo apt install coreutils then it will be easier to copy/paste these error messages from the terminal to a .txt file to Ubuntu Pastebin. In case something doesn't work, this will give me another chance to fix it.

– karel
yesterday












Martha Carmen Vergara Trix is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Martha Carmen Vergara Trix is a new contributor. Be nice, and check out our Code of Conduct.













Martha Carmen Vergara Trix is a new contributor. Be nice, and check out our Code of Conduct.












Martha Carmen Vergara Trix is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112980%2fbash-sudo-apt-get-command-not-found%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

數位音樂下載

When can things happen in Etherscan, such as the picture below?

格利澤436b