RST: How to have an item of a numbered list show itself as multiple lines - restructuredtext

I want the following visual format:
1. Install Miniconda for Python 3.6 from https://conda.io/miniconda.html
2. Open a command prompt
3. Type *conda install numpy*
4. Type *conda install pyopengl*
5. Type *python -m pip install simpylc*
6. Install freeglut as explained on http://freeglut.sourceforge.net/index.php#download
Alternatively, type:
*sudo apt-get update*
*sudo apt-get install build-essential*
*sudo apt-get install freeglut3-dev*
7. Yet another item
8. And yet another
How can I achieve that with RST without introducing double line spacing to all "normal" list items?

I suggest you use rst2html5 instead of docutils.
Your list:
1. Install Miniconda for Python 3.6 from https://conda.io/miniconda.html
2. Open a command prompt
3. Type :code:`conda install numpy`
4. Type :code:`conda install pyopengl`
5. Type :code:`python -m pip install simpylc`
6. Install freeglut as explained on http://freeglut.sourceforge.net/index.php#download Alternatively, type::
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install freeglut3-dev
7. Yet another item
8. And yet another
And the result will be:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<ol type="1">
<li>Install Miniconda for Python 3.6 from https://conda.io/miniconda.html</li>
<li>Open a command prompt</li>
<li>Type <code class="code">conda install numpy</code></li>
<li>Type <code class="code">conda install pyopengl</code></li>
<li>Type <code class="code">python -m pip install simpylc</code></li>
<li>Install freeglut as explained on http://freeglut.sourceforge.net/index.php#download Alternatively, type:
<pre>sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install freeglut3-dev</pre>
</li>
<li>Yet another item</li>
<li>And yet another</li>
</ol>
</body>
</html>

Related

Upgrading r-base from v3.6 to v4.0 Linux

I am trying to install R-base 4.0, but it keeps installing v3.6. I've tried:
sudo apt install deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/
sudo apt-get install r-base
and v3.6, not 4.0 was installed. Next I tried:
sudo apt install deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/
sudo apt-get upgrade r-base
and it didn't work.
How do I upgrade to Rv4.0? I am using Pop_Os, no Ubuntu. Could that be the issue?
First off, your initial line is wrong. There is not such apt install deb command. You are supposed to edit the apt sources file by hand (though these days there may be GUI solutions to it as well).
Second, you omitted to actually use the new repo by not running sudo apt update (or equally sudo apt-get update). You must update the local indices.
Third, a preferred way is to just upgrade as you (almost) did in the second paragraph. But upgrade takes no package argument!
Fourth, this has nothing to do with Pop!OS as we are talking only about apt and apt-get here.
For completeness, I did a little blog and video about the R 3.6.* to R 4.0.* upgrade. More info here if you care.
PS Fifth, as r2evans noted in the comment, be sure to pick the right distro. I run straight Ubuntu so "focal" it is more me. You probably want R 4.0.* from the Ubuntu build matching your Pop!OS build.

How to upgrade IRKernel in Ubuntu?

On Ubuntu 18.04 LTS, while working R in JupyterNotebook (without Anaconda), the IRKernel is reading the R version 3.4. For using some packages like cowplot it is necessary to have at least version 3.5.
Basically, two steps should be taken:
Update R. These and that answers were a guideline.
Update IRKernel. The offical IRKernel instructions for Linux were useful.
Next, is described the complete procedure
1. Add Key to server
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
2. Add Entry to sources.list
echo 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' | sudo tee -a /etc/apt/sources.list
Depending on the linux you're using you should change, for example, bionic by xenial or cosmic, check out https://cran.r-project.org/bin/linux/ubuntu/README.html
3. Update Programs
According to the instructions in the above link, we should do the following:
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
4. Update /.local/share/jupyter/kernels/ir
type R in the console and follow the next steps according to this link
# In the console
R
# Inside R
install.packages(c('repr', 'IRdisplay', 'IRkernel'), type = 'source')
getRversion() # to verify the new R version
IRKernel::installspec()
This should show the following message:
[InstallKernelSpec] Removing existing kernelspec in /home/user_name/.local/share/jupyter/kernels/ir
[InstallKernelSpec] Installed kernelspec ir in /home/user_name/.local/share/jupyter/kernels/ir
As a final remark, you should remove the older version of R, which you can find in ~/R/x86_64-pc-linux-gnu-library, where you will now have two directories with two different versions or R (remove the older one).

How to upgrade R version on WSL?

I'm running Ubuntu in Windows Subsystem for Linux, and apt-get update isn't finding the newest versions of r-base. On Ubuntu 16.04, the newest R version it gets is 3.2.3. How do I upgrade to newer versions of R?
It turns out that the version of r-base in the default Ubuntu repository is behind the newest version of r-base from CRAN.
The solution is to add R-CRAN to /etc/apt/sources.list, using the instructions here: https://cran.r-project.org/bin/linux/ubuntu/
sudo sh -c 'echo "deb https://cloud.r-project.org/bin/linux/ubuntu xenial-cran35/" >> /etc/apt/sources.list'
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get update
sudo apt-get install --only-upgrade r-base # This upgrades r-base if it's already installed; otherwise it doesn't install it
As #DirkEddelbuettel said in his comments, this README has helpful information for how you can update your R version in a Windows subsystem for Linux (WSL) setting. For me, I updated from R 3.4 to R 4.0 on Ubuntu 18.04.
I am running bionic (I used lsb_release -a to find out), and I wanted R 4.0 so I picked the appropriate deb line (for me: deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/) to add to my /etc/apt/sources.list file (had to use sudo vim /etc/apt/sources.list to add this line to the end). Then I ran sudo apt-get update and sudo apt-get install r-base. Now I have 4.0.2, the newest version. Just pick the particular Ubuntu/R combo that you want based on the options from the README. I hope this can help someone.

How to install Swoole in ubuntu

Simply my Question is How to Install Swoole in Ubuntu 14.04 LTS
I have tried
sudo pecl install swoole
am getting handfull of errors, already posted here
Is there any alternate way to install the same...
Swoole Installation alternate ways
1.Install from source
sudo apt-get install php7-dev
git clone https://github.com/swoole/swoole-src.git
cd swoole-src
phpize
./configure
make && make install
2.Example for static compile
git clone -b PHP-7.2 --depth 1 https://github.com/php/php-src.git
cd php-src/
git clone -b master --depth 1 https://github.com/swoole/swoole-src.git ext/swoole
./buildconf --force
./configure --prefix=/usr/local/php7 --disable-all --enable-cli --disable-cgi --disable-fpm --disable-phpdbg --enable-bcmath --enable-hash --enable-json --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --enable-sockets --enable-pdo --with-sodium --with-password-argon2 --with-sqlite3 --with-pdo-sqlite --with-pcre-regex --with-zlib --with-openssl-dir --enable-swoole-static --enable-openssl --with-swoole
time make -j `cat /proc/cpuinfo | grep processor | wc -l`
sudo make install
Some Linux distributions do not include the PHP-XML extension in their PHP package and will need to be enabled before using PECL. You can install using apt-get install php-xml and you may need to install PHPize to compile Swoole, you can install it using apt-get install php7.*-dev or whatever PHP version you are using.
Then try again with sudo pecl install swoole
For those who installed PHP from ondrej/php PPA (quite common way to install PHP in Ubuntu) it's quite easy now:
sudo apt install php-swoole
Or for specific version:
sudo apt install php7.4-swoole
Tip. This is how you usually install ondrej/php PPA:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
Install swoole for version specific should work for example if you have php 7.3 use
sudo apt install php7.3-swoole
replace the version to your local php env

How to upgrade Atom Editor on Linux?

What is the best way to upgrade atom on Linux Ubuntu ?
I install atom using official doc
git clone https://github.com/atom/atom
cd atom
script/build
sudo script/grunt install
I created the following script to update my atom on Ubuntu 14.10.
#!/bin/bash
# Update atom from downloaded deb file
rm -f /tmp/atom.deb
curl -L https://atom.io/download/deb > /tmp/atom.deb
dpkg --install /tmp/atom.deb
echo "***** apm upgrade - to ensure we update all apm packages *****"
apm upgrade --confirm false
exit 0
The file atom_update is executable and needs to be called using su:
sudo ./atom_update
The above works, but nowadays I use the following:
sudo add-apt-repository -y ppa:webupd8team/atom
sudo apt -y update
sudo apt -y install atom
apm install \
file-icons \
tabs-to-spaces \
trailing-spaces \
xml-formatter
With the above setup
sudo apt -y upgrade
will update an installed atom to the latest version. The ppa is generally up to date.
Now, it looks like the easiest way is to download the new packaged version (.deb or .rpm) from the official releases and install it over your previous one: https://github.com/atom/atom/releases
It's now even easier with the APT package.
sudo add-apt-repository ppa:webupd8team/atom
sudo apt update
sudo apt install atom
And now you can upgrade / dist-upgrade as usual
sudo apt upgrade
Current official documentation seem to recommend another method:
Atom Github Page
Debian Linux (Ubuntu)
Atom is only available for 64-bit Linux systems.
Download atom-amd64.deb from the Atom releases page.
Run sudo dpkg --install atom-amd64.deb on the downloaded package.
Launch Atom using the installed atom command.
The Linux version does not currently
automatically update so you will need to repeat these steps to upgrade
to future releases.
Red Hat Linux (Fedora 21 and under, CentOS, Red Hat)
Atom is only available for 64-bit Linux systems.
Download atom.x86_64.rpm from the Atom releases page.
Run sudo yum localinstall atom.x86_64.rpm on the downloaded package.
Launch Atom using the installed atom command.
The Linux version does not currently
automatically update so you will need to repeat these steps to upgrade
to future releases.
Fedora 22+
Atom is only available for 64-bit Linux systems.
Download atom.x86_64.rpm from the Atom releases page.
Run sudo dnf install ./atom.x86_64.rpm on the downloaded package.
Launch Atom using the installed atom command.
The Linux version does not currently
automatically update so you will need to repeat these steps to upgrade
to future releases.
As of this writing, the best option to upgrade to the latest released version of Atom is to check out the most recent tag and build it, especially if you built it in the first place.
cd atom
git pull
git checkout v0.115.0 (or whatever the latest release is: https://github.com/atom/atom/releases)
script/build
sudo script/grunt install
wget https://atom.io/download/deb -O atom64.deb
sudo dpkg --install atom64.deb
or
wget https://atom.io/download/rpm -O atom64.rpm
sudo dnf install atom64.rpm
the above URLs redirect to https://atom-installer.github.com/
An easier way is to install the atom-updater-linux from the packages on the atom website.
Go to edit > preferences > install and search for atom-updater-linux
or from the terminal:
apm install atom-updater-linux
This should check for updates after every launch and prompt you to install new updates.
Currently the preferred procedure is described at the atom pages Installing Atom - Platform-linux
When using the add-apt-repository suggested in the top answer, this URL is suggested.
The apt repository mentioned at the Atom pages:
curl -sL https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
sudo apt-get update
If you are onn Ubuntu you can go to the Ubuntu Software Center, search for Atom and just click on Update. Then job done!
If anybody is interested, I wrote a small atom package for this purpose.
The package is meant to timely inform the user of new versions being available (stable or beta, configurable via settings) and uses GitHub API under the hood. It is platform independent, so it should work with any linux distro, but also with Windows or other systems.
It does not perform the upgrade automatically as I wrote it for my needs and I was not interested in such feature. I may add it in the future should strong interest for it manifest itself, though.
Feedback is welcome, best as tickets on github.
I upgraded from
Atom : 1.26.1
Electron: 1.7.11
Chrome : 58.0.3029.110
Node : 7.9.0
to
Atom : 1.40.1
Electron: 3.1.10
Chrome : 66.0.3359.181
Node : 10.2.0
I followed these simple steps,
create a file
sudo nano /usr/local/bin/atom-update
copy following snippet and save with Ctrl+o and "enter" and Ctrl+x
your code
#!/bin/bash
wget -q https://github.com/atom/atom/releases/latest -O /tmp/latest
wget --progress=bar -q 'https://github.com'$(cat /tmp/latest | grep -o -E 'href="([^"#]+)atom-amd64.deb"' | cut -d'"' -f2 | sort | uniq) -O /tmp/atom-amd64.deb -q --show-progress
dpkg -i /tmp/atom-amd64.deb
Make it executable
sudo chmod +x /usr/local/bin/atom-update
Run the script to upgrade atom
sudo atom-update
Ubuntu 16.04 and later
Run these commands to quickly and easily install and upgrade the Atom text editor snap package from the terminal in Ubuntu 16.04 and later (64-bit only).
Install Atom text editor:
sudo snap install --classic atom
Note that a snap in classic confinement behaves as a traditionally packaged application with full access to the system, and Atom extension packages are installed into the user's home directory.
Upgrade Atom text editor:
sudo snap refresh --classic atom
I would add that you should probably clean before updating the build to prevent some nasty errors.
cd atom
git pull
script/clean
script/build
sudo script/grunt install
For debian I have created a bash script which does the following:
Check with https://api.github.com and dpkg if atom is installed and/or up-to date.
Download and install the atom.deb from github if needed.
Provide a --beta switch if somebody wants to maintain the beta version as well.
Fell free to use it, it is located here: https://gist.github.com/rumpelsepp/8a953d6c092cbeb043695cfada114bef
Since December 2017 Atom provides official repositories for all major Linux distributions. You can find the latest installation instructions here.
Latest Way is to first install $ apm install atom-updater-linux then simply press Alt+Ctrl+U or go to Help and there is option for check for updates

Resources