Can sudo be reinstalled after being removed?

1


Question:

This seems to be a chicken-egg problem. The most common task using sudo is installing and removing software.

sudo apt-get purge

But sudo itself can be removed.

sudo apt-get purge sudo # Do not run this command on production computers!

This is where the fun comes

ubuntu@ubuntu:~$ sudo bash: /usr/bin/sudo: No such file or directory

Although it's obvious that no person in his right mind will purge sudo (other than me), someone can be fooled to run this command (not directly, in its hex mode, or whatever it's called) or a person could SSH in disguised as tech guru and do the mess.

So is there a way of reinstalling sudo?


Solution:1

I can install applications using:

pkexec apt-get install

From man pkexec:

pkexec allows an authorized user to execute PROGRAM as another user. If username is not specified, then the program will be executed as the administrative super user, root. ...
0 0
2

This seems to be a chicken-egg problem. The most common task using sudo is installing and removing software.

sudo apt-get purge

But sudo itself can be removed.

sudo apt-get purge sudo # Do not run this command on production computers!

This is where the fun comes

[email protected]:~$ sudo bash: /usr/bin/sudo: No such file or directory

Although it's obvious that no person in his right mind will purge sudo (other than me), someone can be fooled to run this command (not directly, in its hex mode, or whatever it's called) or a person could SSH in disguised as tech guru and do the mess.

So is there a way of reinstalling sudo?

I can install applications using:

pkexec apt-get install

From man pkexec:

pkexec allows an authorized user to execute PROGRAM as another user. If username is not specified, then the program will be executed as the administrative super user, root.

So, I suppose that pkexec apt-get install sudo should work as...

0 0
3

Removing vim-minimal was a mistake. If you intend to make use of sudo you have to have that package installed on Fedora. You can tell that sudo requires it like so:

$ rpm -q --requires sudo | grep vim vim-minimal

I'd suggest putting it back, and working around whatever the other issue actually was with vim. Fedora has always had excellent support when it came to all the varieties of vim and having them installed together.

I'm using F19 and F20 and they both have pretty much all the Vim's installed simultaneously without issues.

$ yum list installed | grep vim | expand vim-X11.x86_64 2:7.4.179-1.fc19 @updates vim-common.x86_64 2:7.4.179-1.fc19 @updates vim-enhanced.x86_64 2:7.4.179-1.fc19 @updates vim-filesystem.x86_64 2:7.4.179-1.fc19 @updates vim-minimal.x86_64 2:7.4.179-1.fc19 @updates vim-vimoutliner.noarch 0.3.7-3.fc19 @updates

If you know the password to...

0 0
4

My primary reason for using Ubuntu Linux, is that I find it a far more productive, cost effective and customizable system. Everyone has their own reasons and needs for any particular OS. That said, I’m often asked by new Linux (Ubuntu) users what things I do immediately after installing Ubuntu; to tweak it a bit more. I’m still using Hardy (8.04 64 Bit) as I prefer to stick with LTS releases – This means another year to go with 8.04 before the next LTS (10.04). Until then, here’s the answers for the 10 things I do to customize a new Ubuntu Hardy installation:

Update June 16, 2009: Steven and Coder’s Wasteland has taken this post even further! In my opinion, he’s done a great job in providing a bash script that implements all the changes described in this post. Way to go Steven! You can read more about that (and get the script) at: Initial Ubuntu Install Items Script.

Update June 19, 2009: Steven and Coder’s Wasteland has migrated the script from a CLI to a GUI based...

0 0
5

I believe it can be, but windows will overwrite the boot partition of your drive to be windows only. You may have to use a rescue disk to install a boot manager (I think that's what it's called, it's grub on most Linux computers, I believe) and make Ubuntu bootable again. There are free isos (disks images) you can download that will help rescue your Linux partition. Also, when installing windows, you will have to make sure you don't overwrite your Ubuntu partition. So, you may have to make your Ubuntu partition smaller, and you may have to use advanced options when installing windows.

You can also simply install windows inside Ubuntu, using a virtual machine, which I don't reccommend because you would have to have a powerful enough computer (running an operating system inside another operating system is hard, then imagine playing a game like fallout or skyrim on the guest os.)

Lastly , you could buy a second hard drive, install windows on that, and when you want to...

0 0
6
Oct 12, 2010

I sudo apt-get removed Firefox from my system in favor of Google Chrome. However, Ubuntu still prompts me to upgrade Firefox. How do I stop that? Also, whenever I click on HTML files, Firefox is still the one that loads by default. How can that be if I've sudo apt-get removed it? And Firefox is still in my Applications->Internet menu... So, was my sudo apt-get remove successful?

Ubuntu :: Remove Firefox Without Removing Java Plugin? Ubuntu :: Remove A Package Without Removing Dependencies Ubuntu :: Removing Empathy Sets Up Autoremove To Remove Almost Everything Ubuntu :: Write To Terminal "sudo Firefox" It Opens The Firefox? Software :: Yum - Remove Without Removing Dependencies Ubuntu :: Can't Remove File With Sudo? Debian :: Remove A Package That Is A Dependency Without Removing Anything Else? Ubuntu :: Can't Remove Firefox 3.6 (Namoroka) And Reinstall Firefox 2 Ubuntu :: Removing Plugin From Firefox Debian :: How To Remove Sudo Applications :: Update...
0 0
7

Thanks for you quick reply.

In fact, firstly I used ./install.sh. As an error occurred in mkl installation, I tried to install the mkl itself by gdebi.

I'll provide my terminal outputs and logs below:

Terminal

$ sudo ./install.sh
[sudo] password for jeco:

Press [Enter] key to display the Microsoft R Open license. When finished reading, press q to continue:

Do you wish to install the Intel MKL libraries?
Choose [y]es|[n]o y

Press [Enter] key to display the Intel MKL license. When finished reading, press q to continue:
Do you agree to the terms of the previously displayed license?
Choose [y]es|[n]o y

Updating apt package repositories...done
Installing apt package dependencies libxt6 libsm6 libpango1.0-0 libgomp1 curl...done
Installing /home/jeco/Downloads/microsoft-r-open/deb/microsoft-r-open-mro-3.3.deb...done
Installing...

0 0
8

Code:

jpayton@SERVER:~$ sudo apt-get install squidReading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: squid 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded. Need to get 6,246 B of archives. After this operation, 129 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu/ raring/universe squid amd64 3.1.20-1ubuntu3 [6,246 B] Fetched 6,246 B in 0s (25.3 kB/s) Selecting previously unselected package squid. dpkg: warning: files list file for package 'squid3' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'squid-langpack' missing; assuming package has no files currently installed dpkg: warning: files list file for package 'squid3-common' missing; assuming package has no files currently installed (Reading database ... 164196 files and directories currently installed.) Unpacking squid (from...
0 0
9

Listing pluginsedit

A list of the currently loaded plugins can be retrieved with the list option:

sudo bin/elasticsearch-plugin list

Alternatively, use the node-info API to find out which plugins are installed on each node in the cluster

Removing pluginsedit

Plugins can be removed manually, by deleting the appropriate directory under plugins/, or using the public script:

sudo bin/elasticsearch-plugin remove [pluginname]

After a Java plugin has been removed, you will need to restart the node to complete the removal process.

By default, plugin configuration files (if any) are preserved on disk; this is so that configuration is not lost while upgrading a plugin. If you wish to purge the configuration files while removing a plugin, use -p or --purge. This can option can be used after a plugin is removed to remove any lingering configuration files.

Updating pluginsedit

Plugins are built for a specific version of Elasticsearch, and...

0 0
10


Note: Be sure to use

sudo

when running

dpkg --configure -a

.

If that does not help, then try:

Code:

sudo dpkg --clear-avail && sudo apt-get update

Then see if you can update and install packages.

If that still does not work, then try:


Code:

sudo apt-get install -f sudo dpkg --configure -a sudo apt-get update Sudo apt-get upgrade

In the future, stick with packages from the Ubuntu repositories and you will not have these problems.

This is not the expected behavior.

Post your

/etc/apt/sources.list

file. Also post any files you have in your

/etc/apt/sources.d/

directory.

If you have added any third party repositories to Ubuntu, then comment those out

(place a

#

in front of them) and try those commands again.

This is why I avoid third party repositories in Ubuntu.

Last edited by tommcd; 12-09-2010 at . ...
0 0
11

Update your Ubuntu 14.04 LTS

$ sudo apt-get update $ sudo apt-get upgrade

Install usefull Apps

Install Restricted Extras

There are some Restricted Extras in Ubuntu which can't be install while installation of Ubuntu by default but you can install these Restricted extras by yourself.

$ sudo apt-get install ubuntu-restricted-extras

Classic Menu Indicator

Classic Menu Indicator Package

$ sudo apt-get install classicmenu-indicator

SMPlayer
SMPlayer is great front-end for MPlayer with built-in codecs.

SMPlayer can search and download subtitles from opensubtitles.org

SMplayer Package

$ sudo apt-get install smplayer

Once the SMPlayer is installed, the totem is no longer needed.

$ sudo apt-get remove totem

Skype

Uncomment the following lines in /etc/apt/sources.list to enable Cannnonical Partners repository.

deb http://archive.canonical.com/ubuntu trusty partner deb-src...
0 0
12

You can safely chmod the /etc/sudoers file providing you duplicate it first.


Because sudo won't work until you change the permissions on the file, you'll need to use su to enable root user. Take extreme care as you will be at the root of the drive and NOT your User folder, so check you're in the correct location by using the command pwd first. So, type su and after the prompt, your password where the ~username$ will change to a #

Check the current permissions with ls -l /etc/sudoe* which should now list sudoers & sudoers copy with permissions of -rwxrwxrwx which we now need to change to -r--r----- by using the command chmod 440 /etc/sudoers

Recheck the permissions with the ls -l /etc/sudoe* and you should see the two files with these perms

-r--r----- 1 root wheel 2299

-rwxrwxrwx 1 user wheel 2299

type exit to get out of Super User (the prompt will change from a # to $)

now confirm sudo is working by typing

sudo ls -l...

0 0
13

In my previous post, I tried to show how to install Enterprise Manager Cloud Control 12c, now I’ll show how to add target hosts to our Enterprise Manager system. I assume that you’re in a similar position (installed Cloud Control but haven’t added any target yet).

As you know, we have to install Oracle Management Agent to the targets to be able to manage them via our Enterprise Manager. In OEM Cloud Control 12c, we can “Add Host Targets Wizard” which is accessible from the web interface. We can manually enter required information of host or we can use auto-discovery method.

If we’ll use auto discovery, we need an active agent to discover targets in network. This agent can scan local services or network. “Nmap” is used for scanning network. Nmap requires root privileges to be able to use raw sockets for “Syn Scanning” (a method to detect open ports through firewalls). So we need to configure “privilege delegation” in the host of our agent (which we’ll use for...

0 0
14

If you have tried to delete Safari, Mail, FaceTime, Chess, Photo Booth, Stickies, QuickTime, or any of the other default Mac OS X apps before, you’ll know the Finder prevents you from doing so. Try to move one of these apps to the trash to uninstall it and you’ll get a message saying: ‘”Safari.app” can’t be modified or deleted because it’s required by Mac OS X.’


That message is more to dissuade you than anything else, because there is a way to delete any of these default apps that are required by Mac OS X, it’s just generally not recommended to do so.

For apps like Safari and QuickTime Player, this is particularly true, as other apps may use Safari or it’s elements to function properly (including other web browsers), but for apps like Stickies, Chess, FaceTime, and Photo Booth, you can safely delete them without any mal effects.

How to Delete Safari, Mail, FaceTime, Photo Booth, & Other Default Apps

Warning: There is no undoing the...

0 0
15
...
0 0