i3blocks (i3wm) - use a sudo command [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I'm configuring my i3blocks for i3wm, and I can't seem to be able to execute sudo command like:
[update-notifier]
label=UPDATE
command=sudo ~/.i3/scripts/update-notifier.sh
interval=once
inside the update-notifier.sh file I have this:
apt-get update && apt-get upgrade
plus some echo for formatting the i3blocks bar.
I've tried this:
command=sudo ~/.i3/scripts/update-notifier.sh with and without sudo with the apt-get -> The script doesn't launch
command=sudo apt-get update && sudo apt-get upgrade -> the command isn't executed
command=~/.i3/scripts/update-notifier.sh with sudo with the apt-get -> the script launch, the i3bar is properly formatted, but the apt-get isn't executed.

Do you have sudo configured so it doesn't ask for a password to your user with the apt-get command? Maybe your command is running but it asks for a password and it fails.
I was abled to accomplish what you're trying to do by allowing my user to run apt-get with sudo without password adding this to the /etc/sudoers file:
<my-user> <my-host> = (root) NOPASSWD:/usr/bin/apt-get
And then adding a block with the command property set like your second option:
command=sudo apt-get update
And verified it works by reloading i3 and checking the timestamp of my latest update with:
stat -c %y /var/lib/apt/periodic/update-success-stamp
Which showed a recent update being successfully done recently:
2015-10-13 08:29:30.996348567 -0430

Related

Cannot run Apache2 server in ubuntu [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I've installed pgAdmin4 in Ubuntu 18.04 by doing:
$ curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
$ sudo sh -c 'echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4
main" > /etc/apt/sources.list.d/pgadmin4.list && apt update'
$ sudo apt install pgadmin4
$ sudo /usr/pgadmin4/bin/setup-web.sh
After creating an account and before adding the Postgresql server in pgAdmin4 I got this message displayed:
[1]: https://i.stack.imgur.com/AHI6z.png
Since I was having problems with systemd, I've used Sysvinit system to start the apache2 by doing:
$ service apache2 start
outcome:
Starting Apache httpd web server apache2 *
The apache2 configtest failed.
Output of config test was:
mkdir: cannot create directory '/var/run/apache2': Permission denied
chown: changing ownership of '/var/lock/apache2.Y3B3u6svcJ': Operation not permitted
not sure what to do next.
You should run apache as root:
sudo service apache2 start

Installing nodejs on Ubuntu 19.04 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I'm new to Linux and I want to know how to install Node.js on Ubuntu 19.04.
I downloaded the node-v12.12.0-linux-x64.tar.xz from the website and extracted it, but I'm stuck after that, I don't know how to proceed.
I believe what you downloaded is the source for NodeJS (I could be wrong). So you'll need to build it yourself.
If you want to do that check this guide.
Otherwise you can check the NodeSource distributions repo on github.
For Node.js v12.x: run these commands in a terminal window
# Using Ubuntu
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs

"apt-get install" does not ask for confirmation as "yum install" [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
When using yum install firefox it will ask me for confirmation if I would really like to do it, but apt-get install firefox it will not ask me. Is there a way that it will ask me? Thank you
apt-get will only ask for confirmation in certain cases (if other packages are pulled or if installed packages are modified or removed); see this superuser answer for details.
To always see what apt-get is going to do before actually installing it, you may use the -s (simulate) flag.
apt-get -s install firefox
apt-get will tell you what it would do when installing firefox, but would not actually do it. If you are satisfied you can then run the install command again without the simulate flag.
apt-get by default needs root privileges to run. If you type apt-get install firefox it should ask you about root privileges. sudo apt-get firefox should prompt you for your password. So as you can see, it's an indirect way of asking for confirmation. It cannot install anything unless you confirm your password.

Undo Lubuntu install? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I had 13.04 running fine although a bit slow, so I did
sudo apt-get install lubuntu
then restarted the computer
next, lubuntu opened, but it was terrible. The dock wasn't there, alt+tab and other window-control commands didn't work, and I couldn't search through the system for programs to open as I could before.
Surely all this can't be so difficult to reverse? All I did was one command.
Try this:
sudo apt-get remove --auto-remove lubuntu
Now you must switch your desktop environment. If you want ubuntu default desktop environment
sudo dpkg-reconfigure ubuntu-desktop
Or if you have KDE
sudo dpkg-reconfigure kubuntu-desktop
It's better to try dpkg-reconfigure before package removing.

Linux Users can access git client after install... [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I installed git using the following steps
wget https://www.kernel.org/pub/software/scm/git/git-1.8.2.3.tar.gz
tar xzvf git-1.8.2.3.tar.gz
cd git-1.8.2.3
make prefix=/usr/local all
sudo make prefix=/usr/local install
After doing the above I tye in
git --version
and I get the following error
-bash: git: command not found
but it works if I sudo su and then try?
You probably don't have /usr/local/bin in you PATH environment variable. Try:
PATH=$PATH:/usr/local/bin git --version
If that works you can add it permanently by editing yoou .profile or .bash_profile and adding:
export PATH=$PATH:/usr/local/bin

Resources