您的位置:时时app平台注册网站 > 时时app平台注册网站 > Linux 配置本地源 (Ubuntu / CentOS)时时app平台注册

Linux 配置本地源 (Ubuntu / CentOS)时时app平台注册

2019-10-12 10:38

1. 本地ISO

# 首先挂载本地镜像
mount -o loop -t iso9660 ./ubuntu.iso /media/cdrom
# 手动添加ISO镜像至源列表,这样就可以在软件库中找到ISO中的所有包
apt-cdrom -m -d=/media/cdrom add
# 刷新软件库
apt update
# 完成后查看sources.list ,本地源应该在第一条,否则默认还是从网上下载

e.g.

root@ubuntu:/# mount -t iso9660 /dev/cdrom /media/cdrom/
mount: /dev/sr0 is write-protected, mounting read-only
root@ubuntu:/# sudo apt-cdrom -m -d /media/cdrom/ add
Using CD-ROM mount point /media/cdrom/
Identifying... [83cd189f3f418ae846baff8ecfba5390-2]
Scanning disc for index files...
Found 4 package indexes, 0 source indexes, 0 translation indexes and 1 signatures
Found label 'Ubuntu-Server 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)'
This disc is called: 
'Ubuntu-Server 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)'
Copying package lists...gpgv: Signature made Tue 31 Jul 2018 08:39:26 AM CST using RSA key ID EFE21092
gpgv: Good signature from "Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>"
Reading Package Indexes... Done
Writing new source list
Source list entries for this disc are:
deb cdrom:[Ubuntu-Server 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)]/ xenial main restricted
Repeat this process for the rest of the CDs in your set.
root@ubuntu:/# vim /etc/apt/sources.list
# 此时sources.list中多出一行本地源
# deb cdrom:[Ubuntu-Server 16.04.5 LTS _Xenial Xerus_ - Release amd64 (20180731)]/ xenial main restricted

root@ubuntu:/# 
root@ubuntu:/# sudo apt update

root@localhost:~/freetype-2.1.10# ./configure --prefix=/usr/local/freetype

正文长久更新链接地址:http://www.linuxidc.com/Linux/2015-04/116470.htm

2. 创立地点源

平日apt-get install安装软件时,下载的deb文件都会存放在/var/cache/apt/archives/下,为了以往重装或给人家用 。

步骤:

# 新建离线源目录
mkdir ~/packs
# 将缓存复制到目录
cp -rv  /var/cache/apt/archives/* ~/packs

    # 拷贝过来发现在packs当中为文件都是root账户的,需要修改
    # 修改所有者
    # sudo chown -R someone.someone * $pack_dir
    # 修改权限
    # sudo chmod ug rw,o r * $pack_dir

# 建立Packages包,里面记录了packs目录下的软件包信息,包括依赖信息
dpkg-scanpackages ~/packs /dev/null |gzip > packs/Packages.gz -r
# 将~/packs复制到目标计算机,或本机的某处
vim /etc/apt/sources.list
# 添加 deb file:/// /home/someone/packs/ 
# 注意: packs后面有一个斜杠,全路径前面还要有空格
# 更新源
sudo apt-get update ---allow-insecure-repositories
sudo apt-get install -f
sudo apt-get xxxx --allow-unauthenticated
# 本地的源是没有签名的,直接更新ubuntu1604下的apt会提示找不到release文件,是一种不安全的源,默认是被禁用的。如果还要安装的话需要加上 --allow-unauthenticated 选项。
# N: Updating from such a repository can't be done securely, and is therefore disabled by default.

浏览器查看有无gd参数

偏偏明天又有职业须求el5的包,原来不维护el5了。卒然想起QashqaiVM(Ruby Version Manager),轻巧消除:

  • Linux local source list
    • A. Ubuntu
      • 1. 本地ISO
      • 2. 成立地点源
    • B. CentOS
      • 1. 本地ISO

Checking for mmap support... Yes.

时时app平台注册网站 1

Linux local source list

  libtool-doc autoconf automaken gfortran fortran95-compiler gcj

自行重装

A. Ubuntu

deb file:///media/cdrom precise main

Ruby中的遍历钦点目录的文本措施 http://www.linuxidc.com/Linux/2015-01/111525.htm

1. 本地ISO

1. 首先创建挂载点
2. 然后挂载光驱
3. 移除原有源
4. 新建local.repo文件,内容如下:
​```
[name]
name="local repo"
baseurl=file:///media/cdrom/
enabeld=1
gpgcheck=0
​```
5. 对yum进行初始化操作

e.g.

[root@cent7 ~]# mkdir /media/cdrom
[root@cent7 ~]# mount -t iso9660 /dev/cdrom /media/cdrom
mount: /dev/sr0 is write-protected, mounting read-only
[root@cent7 ~]# cd /etc/yum.repos.d/
[root@cent7 yum.repos.d]# pwd
/etc/yum.repos.d
[root@cent7 yum.repos.d]# ls
CentOS-Base.repo  CentOS-Base.repo.bak  CentOS-CR.repo  CentOS-Debuginfo.repo  CentOS-fasttrack.repo  CentOS-Media.repo  CentOS-Sources.repo  CentOS-Vault.repo  epel.repo  epel-testing.repo  mysql-community.repo  mysql-community-source.repo
[root@cent7 yum.repos.d]# mkdir bak
[root@cent7 yum.repos.d]# mv *.repo bak/
[root@cent7 yum.repos.d]# vim local.repo
写入以下内容:
        [name]
        name="local repo"
        baseurl=file:///media/cdrom/
        enabeld=1
        gpgcheck=0

[root@cent7 yum.repos.d]# yum clean all  # 清除缓存
Loaded plugins: fastestmirror
Cleaning repos: name
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
[root@cent7 yum.repos.d]# yum makecache  # 建立新缓存
Loaded plugins: fastestmirror
Determining fastest mirrors
name                                                                                                                                                                                                                                                   | 3.6 kB  00:00:00     
(1/4): name/group_gz                                                                                                                                                                                                                                   | 3.5 kB  00:00:00     
(2/4): name/primary_db                                                                                                                                                                                                                                 | 776 kB  00:00:00     
(3/4): name/other_db                                                                                                                                                                                                                                   | 198 kB  00:00:00     
(4/4): name/filelists_db                                                                                                                                                                                                                               | 298 kB  00:00:00     
Metadata Cache Created
[root@cent7 yum.repos.d]# yum list | wc -l  # 查看可用个数
546
[root@cent7 yum.repos.d]# 

root@localhost:~/freetype-2.1.10# make

gem sources -l
gem sources --remove
gem sources -a
gem sources -l

目录

 

实测 Ubuntu 13.10 上搭建 Ruby on Rails http://www.linuxidc.com/Linux/2014-02/96399.htm

B. CentOS

root@localhost:~/freetype-2.1.10# make install

在一部分CentOS 5机器上设置进度出现谬误,施行`rvm reinstall ruby --verify-downloads 1`重装后健康:

The following NEW packages will be installed:

时时app平台注册网站 2

安装php

Ruby on Rails 4 Tutorial 粤语版 高清完整PDF http://www.linuxidc.com/Linux/2014-04/100253.htm

输入指针函数字展现示php音信

好,在此Ruby顺遂安装达成。和Python类似,Ruby供给加上的第3方库方显活力。官方网址源由于互联网原因下载会比异常的慢,谢谢Tmall提供了可相信的本国财富。速度安插上:

安装libpng

修改宾馆源

 

 安装示例

root@localhost:/etc/apt# apt-get install libtool

时时app平台注册网站 3

The following extra packages will be installed:

Ruby用得非常少,但意识有事情须求配置钦点的版本和插件。开首找了有的Fedora的src.rpm重新打包,开采依赖难题相当多,最终依旧为难的把el6的包编出来了。

root@localhost:/etc/apt# ls

时时app平台注册网站 4

root@localhost:~# cd php-5.4.4/

时时app平台注册网站 5

After this operation, 2,561 kB of additional disk space will be used.

EnclaveVM近期(v1.22.19)仅援助理编辑译安装,若须要批量布局建议用FPM制作RPM包扩丰硕发,打包 '/usr/local/rvm/ /etc/rvmrc /etc/profile.d/rvm.sh' 就可以。RAV4VM笔者表示v2.0将支撑rpm的变动!

root@localhost:~/zlib-1.2.3# ./configure --prefix=/usr/local/zlib

然后,安装所需的开采库吧`gem install googleplay_dev_scraper`:

root@localhost:~# /usr/local/apache2/bin/apachectl stop

# curl -L | bash -s stable --autolibs=enabled --ruby #
echo insecure >> ~/.curlrc # CentOS 5 需要
curl -L | bash -s stable
source  /etc/profile
sed -i 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' /usr/local/rvm/config/db # 使用Taobao源,普通客户被设置在 ~/.rvm目录下
rvm list known # 查看扶助安装的组件和版本
yum -y install gcc-c readline-devel zlib-devel libyaml-devel libffi-devel openssl-devel make autoconf automake libtool bison # 理论上福睿斯VM会自动检查评定并安装依赖包
rvm install ruby # 下载 编写翻译安装
ruby -v

正文永远更新链接地址:http://www.linuxidc.com/Linux/2014-06/103510.htm

好,至此。玩得欢快!

root@localhost:~# tar zxvf zlib-1.2.3.tar.gz

设置所需库扶持

生育条件实用之LNMP架构的编写翻译安装 SSL加密实现 http://www.linuxidc.com/Linux/2013-05/85099.htm

Ruby 的详实介绍:请点这里
Ruby 的下载地址:请点这里

Ubuntu安装Nginx php5-fpm MySQL(LNMP情形搭建) http://www.linuxidc.com/Linux/2012-10/72458.htm

时时app平台注册网站 6

root@localhost:~# cd freetype-2.1.10/

Ubuntu下搭建Ruby On Rails http://www.linuxidc.com/Linux/2012-06/61981.htm

mkdir -p /usr/local/jpeg/include
 mkdir -p /usr/local/jpeg/lib
 mkdir -p /usr/local/jpeg/bin
 mkdir -p /usr/local/jpeg/man/man1

rm -f *.o *.lo libjpeg.a libjpeg.la

root@localhost:~/jpeg-6b# cp /usr/share/libtool/config/config.sub .

编写翻译安装

rm -f -r knr .libs _libs

Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()

写入内容如下

sources.list  sources.list_bak2  trusted.gpg

 

Checking for vsnprintf() in stdio.h... Yes.

安装freetype

Do you want to continue [Y/n]? Y

?>

在布置LNMP的时候境遇Nginx运行失利的2个难题 http://www.linuxidc.com/Linux/2013-03/81120.htm

root@localhost:~# tar zxvf jpegsrc.v6b.tar.gz

Reading state information... Done

root@localhost:~/jpeg-6b# make 

CentOS 6.3 安装LNMP (PHP 5.4,MyySQL5.6) http://www.linuxidc.com/Linux/2013-04/82069.htm

root@localhost:~# /usr/local/apache2/bin/apachectl start

root@localhost:~/jpeg-6b# make install

Checking for unistd.h... Yes.

[root@orcl10g ~]# cd /usr/local/apache2/htdocs/

root@localhost:~/jpeg-6b# make clean

root@localhost:~# tar zxvf freetype-2.1.10.tar.gz 

sources.list_bak2为本人要好创设的本地源列表

0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.

 

root@localhost:~# cd jpeg-6b/

root@localhost:~# tar zxvf gd-2.0.33.tar.gz

root@localhost:/etc/apt# cat sources.list_bak2 

  autotools-dev libltdl-dev

root@localhost:~# cd zlib-1.2.3/

root@localhost:~/zlib-1.2.3# make

root@localhost:~/php-5.4.4# ./configure --prefix=/usr/local/php5/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql5/ --enable-mbstring --with-gd --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-freetype-dir=/usr/local/freetype
 
root@localhost:~/php-5.4.4# make 

 

root@localhost:~/libpng-1.2.8# make

root@localhost:~/php-5.4.4# make install

Suggested packages:

root@localhost:~/jpeg-6b# ./configure --prefix=/usr/local/jpeg6 --enable-shared --enable-static
 
--enable-shared参数用来安装生成分享库 

Building static library libz.a version 1.2.3 with gcc.

make: *** [jcapimin.lo] Error 127

root@localhost:~/jpeg-6b# ./configure --prefix=/usr/local/jpeg6 --enable-shared --enable-static
 
该版本有待改良 不大概自动创造安装目录,本人创办一下:

./libtool --mode=compile gcc -O2  -I. -c ./jcapimin.c

 

[root@orcl10g htdocs]# vi index.php

preferences.d  sources.listbak    trustdb.gpg    trusted.gpg.d

root@localhost:/etc/apt# cp sources.list_bak2 sources.list

apt.conf.d    sources.list~      sources.list.d  trusted.gpg~

 

root@localhost:/etc/apt# apt-get update

安装zlib

Checking for return value of vsnprintf()... Yes.

root@localhost:~/libpng-1.2.8# make install

phpinfo();

Building dependency tree       

安装GD

root@localhost:~/zlib-1.2.3# make install

Reading package lists... Done

Need to get 0 B/547 kB of archives.

LNMP 全职能编写翻译安装 for CentOS 6.3笔记 http://www.linuxidc.com/Linux/2013-05/83788.htm

root@localhost:~# tar zxvf php-5.4.4.tar.gz 

root@localhost:~# rm -rf /usr/local/php5

测试

root@localhost:~/zlib-1.2.3# 

  autotools-dev libltdl-dev libtool

 

root@localhost:~/gd-2.0.33# make install

<?

root@localhost:~/gd-2.0.33# ./configure --with-png --with-jpeg --with-freetype=/usr/local/freetype
 
root@localhost:~/gd-2.0.33# make

make: ./libtool: Command not found

Checking for gcc...

root@localhost:~# tar jxvf libpng-1.2.8.tar.bz2

时时app平台注册网站 7

PHP 的事无巨细介绍:请点这里
PHP 的下载地址:请点这里

root@localhost:~/jpeg-6b# cp /usr/share/libtool/config/config.guess .

 

Checking for errno.h... Yes.

root@localhost:~# cd gd-2.0.33/

《细说PHP》高清扫描PDF 光盘源码 全套教学录制 http://www.linuxidc.com/Linux/2014-03/97536.htm

 

rm -f cjpeg djpeg jpegtran rdjpgcom wrjpgcom

root@localhost:~/libpng-1.2.8# mv ./scripts/makefile.linux ./makefile

 

注:假如已经设置过php 删除安装目录就可以:

安装Jpeg

root@localhost:~# cd jpeg-6b/

时时app平台注册网站 8

rm -f ansi2knr core testout* config.log config.status

root@localhost:~/jpeg-6b# make 

本文由时时app平台注册网站发布于时时app平台注册网站,转载请注明出处:Linux 配置本地源 (Ubuntu / CentOS)时时app平台注册

关键词: