ubuntu 16.04
在安装ubuntu操作系统时,需要配置用于登录系统的用户名和密码,却没有提示配置root密码。
ubuntu默认的root用户没有固定密码,root密码随机产生,动态改变,即每次开机都有一个新的root密码。
使用提前配置的用户(例如dancen)登录ubuntu系统后,在终端输入以下命令:
sudo passwd
然后输入登录用户dancen的密码,继而输入并确认root用户的密码,即可设定root用户密码,此过程中不需要知晓root用户的默认密码:
sudo passwd
[sudo] password for dancen:
New password:
Retype new password:
passwd: password updated successfully
Linux可能已经默认安装了第三方开源的驱动程序nouveau,在安装nvidia官方显卡驱动之前,首先需要禁用nouveau。
lsmod | grep nouveau
如果有内容输出,说明nouveau已被启用,需要执行后续步骤以将其禁用,否则可以直接安装nvidia驱动。
vi /etc/modprobe.d/blacklist.conf
在文件最后部分插入以下两行内容:
blacklist nouveau
options nouveau modeset=0
update-initramfs -u
reboot
lsmod | grep nouveau
如果没有信息显示,说明nouveau已被禁用,接下来可以安装nvidia的显卡驱动。
如果系统已经安装过特定版本的nvidia驱动,需要先执行卸载操作。
systemctl stop lightdm
方式一. 通过runfile卸载
./NVIDIA-Linux-x86_64-460.91.03.run --uninstall
方式二. 通过反安装脚本卸载
如果/usr/bin目录存在nvidia反安装脚本nvidia-uninstall,直接执行之:
cd /usr/bin
./nvidia-uninstall
方式三. 通过apt卸载
apt-get --purge remove nvidia*
reboot
在下载驱动之前,需要确认GPU型号,以及将要使用的CUDA Toolkit版本等。
查看GPU型号:
lspci | grep -i nvidia
00:09.0 3D controller: NVIDIA Corporation GV100GL [Tesla V100 SXM2 32GB] (rev a1)
然后在nvidia驱动下载地址:
https://www.nvidia.com/Download/index.aspx?lang=en-us
根据显卡型号、操作系统版本、CUDA Toolkit版本等信息,找到合适的驱动程序,然后下载之。
驱动程序是一个以.run为后缀的可执行程序,如:
NVIDIA-Linux-x86_64-460.91.03.run
如果要安装特定版本的驱动程序,可自行修改下载链接中的版本号相关内容,例如,假设要修改为下载460.106.00的版本:
https://us.download.nvidia.cn/tesla/460.106.00/NVIDIA-Linux-x86_64-460.106.00.run
chmod +x NVIDIA-Linux-x86_64-460.91.03.run
./NVIDIA-Linux-x86_64-460.91.03.run -no-x-check -no-nouveau-check -no-opengl-files
-no-x-check:安装驱动时关闭X服务
-no-nouveau-check:安装驱动时禁用nouveau
-no-opengl-files:只安装驱动文件,不安装OpenGL文件
安装过程中可能遇到一些问题。
问题一.
The distribution-provided pre-install script failed! Are you sure you want to continue?
选择 continue 继续。
问题二.
Would you like to register the kernel module souces with DKMS? This will allow DKMS to automatically build a new module, if you install a different kernel later?
选择 No 继续。
问题三.
ERROR:Unable to find the kernel source tree for the currently running kernel.
Please make sure you have installed the kernel source files for your kernel and that they are properly configured on Red Hat Linux system, for exzmple ,be sure you have the 'kernel-source' or 'kernel-devel' RPM installed .If you know the correct kernel source files are installed ,you may specify the kernel source path with the '--kernel-source-path' command line option.
即无法为当前运行的内核找到内核源代码树。
解决办法:
1). 查看内核版本
uname -r
显示4.15
2). 下载内核包
打开Ubuntu官方内核库:
https://kernel.ubuntu.com/~kernel-ppa/mainline/
找到Linux Kernel 4.15
根据系统架构下载需要的内核包:
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15/linux-headers-4.15.0-041500_4.15.0-041500.201802011154_all.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15/linux-headers-4.15.0-041500-generic_4.15.0-041500.201802011154_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.15/linux-image-4.15.0-041500-generic_4.15.0-041500.201802011154_amd64.deb
3). 安装 Linux Kernel
对上一步骤下载的deb包执行安装操作:
dpkg -i *.deb
4). 更新系统引导
使用如下命令更新 Grub 引导加载程序:
update-grub
如果使用 BURG 引导加载程序,请运行:
update-burg
5). 重新启动系统,然后重启执行驱动安装程序
reboot
问题四.
The CC version check failed.

即内核编译所使用的gcc版本和当前系统中的gcc版本不一致,如果系统中的gcc版本不是太古老的话,可以尝试忽略该错误,看安装程序能够执行成功,如果安装程序无法安装成功,则需要安装匹配的gcc,本文不再赘述。
modprobe nvidia
nvidia-smi
方式一.
直接到CUDA Toolkit安装目录执行反安装程序即可。CUDA Toolkit安装目录一般为/usr/local/cuda-x.x,反安装程序位于即目录下的bin/cuda-uninstaller。
cd /usr/local/cuda-x.x/bin
./cuda-uninstaller
方式二.
apt-get autoremove nvidia-cuda-toolkit
首先从nvidia cuda官方下载站
https://developer.nvidia.com/cuda-toolkit-archive
根据cuda版本号、系统环境,找到并下载需要的CUDA Toolkit版本,这里官方直接提供了runfile、deb包的下载命令,我们选择runfile的方式来安装cuda。
wget https://developer.download.nvidia.com/compute/cuda/11.2.2/local_installers/cuda_11.2.2_460.32.03_linux.run
chmod +x cuda_11.2.2_460.32.03_linux.run
./cuda_11.2.2_460.32.03_linux.run
这里需要指出的是,安装程序包括多个模块:
Driver
CDUA Toolkit
CUDA Samples
CUDA Demo Suite
CUDA Documentation
由于我们已经安装了nvidia驱动,因此在安装cuda时需要取消勾选Driver模块,否则安装程序将无法执行成功。
编辑特定用户目录下的.bashrc文件,如,/root/.bashrc,或者令环境变量对所有用户生效,直接修改/etc/profile:
vi /root/.bashrc
或
vi /etc/profile
在文件末尾添加以下内容:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-11.2/lib64
export PATH=$PATH:/usr/local/cuda-11.2/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-11.2
令设置生效:
source ~/.bashrc
或
source /etc/profile
nvcc --version
如果命令执行成功,说明CUDA Toolkit安装成功。
我想为Heroku构建一个Rails3应用程序。他们使用Postgres作为他们的数据库,所以我通过MacPorts安装了postgres9.0。现在我需要一个postgresgem并且共识是出于性能原因你想要pggem。但是我对我得到的错误感到非常困惑当我尝试在rvm下通过geminstall安装pg时。我已经非常明确地指定了所有postgres目录的位置可以找到但仍然无法完成安装:$envARCHFLAGS='-archx86_64'geminstallpg--\--with-pg-config=/opt/local/var/db/postgresql90/defaultdb/po
我打算为ruby脚本创建一个安装程序,但我希望能够确保机器安装了RVM。有没有一种方法可以完全离线安装RVM并且不引人注目(通过不引人注目,就像创建一个可以做所有事情的脚本而不是要求用户向他们的bash_profile或bashrc添加一些东西)我不是要脚本本身,只是一个关于如何走这条路的快速指针(如果可能的话)。我们还研究了这个很有帮助的问题:RVM-isthereawayforsimpleofflineinstall?但有点误导,因为答案只向我们展示了如何离线在RVM中安装ruby。我们需要能够离线安装RVM本身,并查看脚本https://raw.github.com/wayn
我有一个奇怪的问题:我在rvm上安装了rubyonrails。一切正常,我可以创建项目。但是在我输入“railsnew”时重新启动后,我有“程序'rails'当前未安装。”。SystemUbuntu12.04ruby-v"1.9.3p194"gemlistactionmailer(3.2.5)actionpack(3.2.5)activemodel(3.2.5)activerecord(3.2.5)activeresource(3.2.5)activesupport(3.2.5)arel(3.0.2)builder(3.0.0)bundler(1.1.4)coffee-rails(
我刚刚为fedora安装了emacs。我想用emacs编写ruby。为ruby提供代码提示、代码完成类型功能所需的工具、扩展是什么? 最佳答案 ruby-mode已经包含在Emacs23之后的版本中。不过,它也可以通过ELPA获得。您可能感兴趣的其他一些事情是集成RVM、feature-mode(Cucumber)、rspec-mode、ruby-electric、inf-ruby、rinari(用于Rails)等。这是我当前用于Ruby开发的Emacs配置:https://github.com/citizen428/emacs
我正在尝试在我的centos服务器上安装therubyracer,但遇到了麻烦。$geminstalltherubyracerBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingtherubyracer:ERROR:Failedtobuildgemnativeextension./usr/local/rvm/rubies/ruby-1.9.3-p125/bin/rubyextconf.rbcheckingformain()in-lpthread...yescheckingforv8.h...no***e
我的最终目标是安装当前版本的RubyonRails。我在OSXMountainLion上运行。到目前为止,这是我的过程:已安装的RVM$\curl-Lhttps://get.rvm.io|bash-sstable检查已知(我假设已批准)安装$rvmlistknown我看到当前的稳定版本可用[ruby-]2.0.0[-p247]输入命令安装$rvminstall2.0.0-p247注意:我也试过这些安装命令$rvminstallruby-2.0.0-p247$rvminstallruby=2.0.0-p247我很快就无处可去了。结果:$rvminstall2.0.0-p247Search
我实际上是在尝试使用RVM在我的OSX10.7.5上更新ruby,并在输入以下命令后:rvminstallruby我得到了以下回复:Searchingforbinaryrubies,thismighttakesometime.Checkingrequirementsforosx.Installingrequirementsforosx.Updatingsystem.......Errorrunning'requirements_osx_brew_update_systemruby-2.0.0-p247',pleaseread/Users/username/.rvm/log/138121
由于fast-stemmer的问题,我很难安装我想要的任何rubygem。我把我得到的错误放在下面。Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingfast-stemmer:ERROR:Failedtobuildgemnativeextension./System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/rubyextconf.rbcreatingMakefilemake"DESTDIR="cleanmake"DESTDIR=
当我尝试安装Ruby时遇到此错误。我试过查看this和this但无济于事➜~brewinstallrubyWarning:YouareusingOSX10.12.Wedonotprovidesupportforthispre-releaseversion.Youmayencounterbuildfailuresorotherbreakages.Pleasecreatepull-requestsinsteadoffilingissues.==>Installingdependenciesforruby:readline,libyaml,makedepend==>Installingrub
我试过重新启动apache,缓存的页面仍然出现,所以一定有一个文件夹在某个地方。我没有“公共(public)/缓存”,那么我还应该查看哪些其他地方?是否有一个URL标志也可以触发此效果? 最佳答案 您需要触摸一个文件才能清除phusion,例如:touch/webapps/mycook/tmp/restart.txt参见docs 关于ruby-如何在Ubuntu中清除RubyPhusionPassenger的缓存?,我们在StackOverflow上找到一个类似的问题: